opentelemetry-dotnet-contrib icon indicating copy to clipboard operation
opentelemetry-dotnet-contrib copied to clipboard

Loki Exporter

Open christophwille opened this issue 1 year ago • 2 comments

I was looking around the Web and then here - is there a "OpenTelemetry.Exporter.Loki" somewhere?

builder.Logging.AddOpenTelemetry(options =>
        {
            options.AddLokiExporter();
        });

Yes, I know I can do this with the collector+exporter, but I am looking for a simple solution on a developers box.

christophwille avatar Jan 24 '24 11:01 christophwille

@christophwille At least for Grafana Cloud, you can send data directly via OTLP using the OTLP exporter.

However, for a Loki instance running on-prem, there's currently no solution without running a collector or agent.

pyohannes avatar Jan 24 '24 12:01 pyohannes

My initial idea of "hacking" it was taking https://github.com/serilog-contrib/serilog-sinks-grafana-loki and rewrapping it for OpenTelemetry.

christophwille avatar Jan 24 '24 12:01 christophwille

@christophwille, native support for OTLP is planned for next release, as I understand - 2.10.0.

You can check PR introducing this functionality here. Please let me know, if it is sufficient for you. I do not think, that in this case, it is worth to invest in .NET native exporter.

Kielek avatar Mar 13 '24 08:03 Kielek

Yes, that definitely would be sufficient. (in the meantime I started using the Aspire dashboard locally)

christophwille avatar Mar 13 '24 17:03 christophwille