OpenTelemetry Metrics
I'm trying to configure an ASP.NET Core application to send metrics that I can then view via Grafana. I'm pretty confused about the whole observability architecture.
Key points:
- Everything is running within Docker Compose
- I've managed to configure ASP -> OTLP -> Loki -> Grafana
- I've managed to configure Prometheus to scrape OTLP metrics
Potential issue: all examples I've seen magically connect to the OTLP collector without specifying its endpoint. Whenever I've tried that, didnt work, so I use
HttpProtobuf
mode with the HTTP endpoint injected from env.
My confusion: I'm lost in the architecture.
- Do I need OTLP? Why is it useful?
- How does Prometheus come into play? Do I send metrics ASP -> OTLP and then configure Prom. to scrape that? Or expose my ASP metrics for Prom. to scrape and expose to Grafana?
Excerpt from docker-compose.yml
2 Replies
My assumption is that OTLP Collector is a collector that takes logs, metrics and traces, to then distribute them to the desired exporters - loki, prometheus, whatever.
But I cannot wrap my head around how to integrate Prometheus into the picture.
Exactly!
All apps can simply use the otlp exporter and send all their traces metrics and logs to the otel collector. Typically using the grpc endpoint.
The otel collector can tze distribute all that data and also perform some transformations, like redaction and compression.