serilog-contrib/serilog-sinks-grafana-loki
52.2
Weak · 24 September 2026
1.5k
lines of production code
F#
primary language
5
measurements over time
What this system is
This system is a high-performance logging sink for Serilog that transmits structured log events to Grafana Loki. It is implemented in F\# and features optimized JSON encoding, efficient event grouping, and support for trace context metadata. The project includes sample applications, comprehensive integration tests against a real Loki instance, and benchmarking tools to monitor serialization performance.
Features
New sample applications and pre-commit formatting hook
Added a new console sample (Serilog.Sinks.Grafana.Loki.Sample) and a new ASP.NET Core web sample (Serilog.Sinks.Grafana.Loki.SampleWebApp) to demonstrate logging configuration and usage. Additionally, introduced a pre-commit Husky hook that automatically formats staged F\# files using Fantomas before they are committed.
.husky, samples · high confidence
Architecture
Repository foundation and developer tooling overhaul
The repository has been restructured with a new solution file (\.slnx\), a FAKE-based build script (\build.fsx\), and centralized MSBuild props/targets for versioning (MinVer), strong naming, and StyleCop configuration. Developer experience is enhanced with an \.editorconfig\ enforcing consistent formatting (including F\# Fantomas rules), auto-installing Husky pre-commit hooks, and a \CLAUDE.md\ guide for AI-assisted development. Local testing is supported via a \docker-compose.yaml\ setup for Loki and Grafana, and a \SECURITY.md\ provides a reporting channel for vulnerabilities.
(repo-wide) · high confidence
Behavioural changes
2 commits (0 fixes) modifying assets
A change to existing behaviour in assets — 2 commits, 2 files.
assets · medium confidence · unverified
Benchmark suite adds custom formatter coverage and migrates to v9 API
The benchmark suite now includes a new benchmark group that measures the end-to-end sink performance when a user-supplied ITextFormatter is used, ensuring that this specific serialization path is monitored for regressions in CI. Additionally, the baseline project has been migrated to use the v9 API (pinned to version 9.0.0), updating the comparison point from the previous v8 baseline.
benchmarks · high confidence
New architecture with relaxed JSON escaping and performance improvements
The sink has been rewritten in F\# with a new internal architecture that significantly improves performance and readability. Log bodies now use a relaxed JSON encoder that outputs printable non-ASCII characters verbatim instead of escaping them as \\uXXXX sequences, making stored logs easier to read. The new grouping logic uses a custom equality comparer to group events into Loki streams without building per-event maps, and a reusable Utf8TextWriter eliminates intermediate string allocations during formatting. Additionally, the sink now supports structured metadata for trace and span IDs, and allows custom exception formatters to control how errors are serialized.
src/Serilog.Sinks.Grafana.Loki · high confidence
Test coverage
Added integration and unit tests for the Grafana Loki sink
Added a new test suite for the Serilog.Sinks.Grafana.Loki package, including integration tests that spin up a real Loki container (v3.7.2) to verify end-to-end log delivery, label querying, and body roundtrips, as well as unit tests covering configuration binding from JSON, label set construction, log event grouping, exception formatting, and wire format serialization.
tests · high confidence
Dependencies
Adopts central package management and updates dependency versions
The project now uses a centralized Directory.Packages.props file to manage dependency versions, ensuring consistency across the library, samples, benchmarks, and tests. This change updates several key dependencies, including FSharp.Core to 10.1.301, Microsoft.Extensions.Configuration.Json to 10.0.12, Testcontainers to 4.15.0, and Microsoft.NET.Test.Sdk to 18.10.1. Additionally, the main library and unit tests now target net8.0, net9.0, and net10.0, while samples and integration tests target net10.0.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 54 → 52 (-1.5)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 99 → 69 (-30.0)
- Architecture 81 → 81 (+0.0)
- Maturity 65 → 66 (+1.2)
- Readiness 70 → 59 (-11.2)
- Security 34 → 39 (+4.9)
Resolved (22)
- AppSettingsBindingTests.startCaptureServer (cognitive 30) (tests/Serilog.Sinks.Grafana.Loki.UnitTests/AppSettingsBindingTests.fs)
- Dependency hygiene not measured — no packages were read
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No exposed public API
- Off-boarding risk: anonymized user #1
- …and 2 more
New (78)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- …and 58 more
Changes since last survey
- 6 commits — 6 feature/other, 0 fixes
By area
- (root) — 3 commits
- src/Serilog.Sinks.Grafana.Loki — 2 commits
- benchmarks/Serilog.Sinks.Grafana.Loki.Benchmarks.Current — 1 commit
Notable commits
- change: Bump the dev-dependencies group with 3 updates (#355)
- change: Bump the dev-dependencies group with 4 updates (#357)
- change: Bump the dev-dependencies group with 5 updates (#353)
- change: Trim trailing newline from formatted entry bodies (#348)
- change: bench: cover the custom ITextFormatter path (#350)
- change: perf: reuse one Utf8TextWriter for custom formatter bodies (#351)
API surface
- Unchanged — 2 HTTP endpoints
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
serilog-contrib/serilog-sinks-grafana-loki was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 24 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 434a4834d718819efd8bcdec9258fb3ed4bd3d74 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-923689c465cf.