I want to log from Serilog directly to Grafana Loki (no collector) using OpenTelemetry.
Logging without OpenTelemetry to grafana works:
.WriteTo.GrafanaLoki("http://localhost:3100", labels: new List<LokiLabel>()
{
new LokiLabel()
{
Key = "service.name",
Value = "tests"
}
})
OpenTelemetry doesn’t:
.WriteTo.OpenTelemetry(c =>
{
c.Endpoint = "http://localhost:3100/loki/api/v1/push";
c.Protocol = OtlpProtocol.HttpProtobuf;
c.ResourceAttributes = new Dictionary<string, object>()
{
{ "service.name", "tests" }
};
})
I have Loki configured with:
limits_config:
allow_structured_metadata: true