diff --git a/src/Serilog.Sinks.Grafana.Loki/LokiBatchFormatter.cs b/src/Serilog.Sinks.Grafana.Loki/LokiBatchFormatter.cs index 568bb48..8d57d00 100644 --- a/src/Serilog.Sinks.Grafana.Loki/LokiBatchFormatter.cs +++ b/src/Serilog.Sinks.Grafana.Loki/LokiBatchFormatter.cs @@ -160,7 +160,7 @@ private Dictionary GenerateLabels(LogEvent logEvent) // to turn them into valid label keys and at the same time denote them as ordinal parameters. if (char.IsDigit(key[0])) { - key = $"Param-{key}"; + key = $"param{key}"; } // Some enrichers generates extra quotes and it breaks the payload diff --git a/test/Serilog.Sinks.Grafana.Loki.Tests/IntegrationTests/Approvals/RequestPayloadTests.LabelsForIndexedPlaceholdersShouldBeCreatedWithParamPrefix.approved.txt b/test/Serilog.Sinks.Grafana.Loki.Tests/IntegrationTests/Approvals/RequestPayloadTests.LabelsForIndexedPlaceholdersShouldBeCreatedWithParamPrefix.approved.txt index 2a8087b..d1444df 100644 --- a/test/Serilog.Sinks.Grafana.Loki.Tests/IntegrationTests/Approvals/RequestPayloadTests.LabelsForIndexedPlaceholdersShouldBeCreatedWithParamPrefix.approved.txt +++ b/test/Serilog.Sinks.Grafana.Loki.Tests/IntegrationTests/Approvals/RequestPayloadTests.LabelsForIndexedPlaceholdersShouldBeCreatedWithParamPrefix.approved.txt @@ -1 +1 @@ -{"streams":[{"stream":{"Param-0":"Namespace.Module.Method"},"values":[["","An error occured in \u0022Namespace.Module.Method\u0022"]]}]} \ No newline at end of file +{"streams":[{"stream":{"param0":"Namespace.Module.Method"},"values":[["","An error occured in \u0022Namespace.Module.Method\u0022"]]}]} \ No newline at end of file