Skip to content
CAI
Software that uses CAICheck a score

serilog-contrib/serilog-sinks-grafana-loki

49.4

Weak · 13 November 2026

1.5k

lines of production code

F#

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

New sample applications and pre-commit formatting hook

Added a console sample (Serilog.Sinks.Grafana.Loki.Sample) and an ASP.NET Core web sample (Serilog.Sinks.Grafana.Loki.SampleWebApp) to demonstrate configuring the sink via code and via appsettings.json, including logging structured records and handling exceptions. Introduced a .husky pre-commit hook that automatically formats staged F\# files using Fantomas before committing.

.husky, Serilog.Sinks.Grafana.Loki, 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: “Signed assembly with a strong name”; “Icon added”.

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 cca.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 53 → 49 (-3.9)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 69 → 56 (-12.9)
  • Architecture 84 → 84 (+0.0)
  • Maturity 64 → 54 (-10.9)
  • Readiness 60 → 60 (+0.0)
  • Security 38 → 37 (-1.0)
  • Performance 100 → 100 (+0.0)

Resolved (2)

  • Coverage not measured — no coverage collector is wired up
  • Low XML-doc coverage: Serilog.Sinks.Grafana.Loki.SampleWebApp (samples/Serilog.Sinks.Grafana.Loki.SampleWebApp/Serilog.Sinks.Grafana.Loki.SampleWebApp.csproj)

New (10)

  • Medium: security finding (details withheld)
  • Orphaned file (benchmarks/Shared/BenchConfig.fs)
  • Orphaned file (benchmarks/Shared/EventGen.fs)
  • Orphaned file (src/Serilog.Sinks.Grafana.Loki/Grouping.fs)
  • Orphaned file (src/Serilog.Sinks.Grafana.Loki/Labels.fs)
  • Orphaned file (src/Serilog.Sinks.Grafana.Loki/LoggerConfigurationExtensions.fs)
  • Orphaned file (src/Serilog.Sinks.Grafana.Loki/LokiExceptionFormatter.fs)
  • Orphaned file (src/Serilog.Sinks.Grafana.Loki/LokiSink.fs)
  • Orphaned file (src/Serilog.Sinks.Grafana.Loki/LokiSinkOptions.fs)
  • Orphaned files with no living knowledge

Changes since last survey

  • 3 commits — 3 feature/other, 0 fixes

By area

  • (root) — 1 commit
  • .config/dotnet-tools.json — 1 commit
  • .github/workflows — 1 commit

Notable commits

  • change: Bump the dev-dependencies group with 1 update (#364)
  • change: Bump the dev-dependencies group with 4 updates (#362)
  • change: build(deps): Bump actions/setup-dotnet (#363)

API surface

  • Unchanged — 2 HTTP endpoints

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.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 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit d5fe0c11cc433cf2dc9d415f7937127f8a29df94 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-b8b1a43ae4c3.