Closed iRevive closed 1 month ago
I would take it if no one minds.
Does this cover pushing to a push gateway as well (e.g. for serverless)? Or is that separate
From my point of view, this issue covers exactly prometheus exporter part from OpenTelemetry spec. And according to spec, prometheus exporter is a pull metric exporter which responds to HTTP requests. That is, this issue doesn't imply the push model. @iRevive maybe you can comment if there is anything planned outside of spec in the future.
Ah yes, it has a MUST
not
Maybe I can add a contrib module after the basic prometheus is in? We have otel collectors at $work but only configured for traces and not metrics, we do have a push gateway though
I think it makes sense to create a separate issue where this proposal can be discussed :) But by the way you can use prometheus as opentelemetry backend by enabling OTLP receiver, without pushgateway.
I would be careful keeping non-spec functionality in the main repository. Eventually, the maintenance burden could catch us up.
If it's really needed, you can implement it here: https://github.com/typelevel/otel4s-experimental.
Prometheus exporter works as an HTTP server that exposes metrics in Prometheus-compatible format.
A prototype: https://github.com/iRevive/otel4s/pull/5.
A few things to consider: 1) Auto-configuration mode - SDK must launch an HTTP server 2) A user should be able to use exporter routes with its own HTTP server (see example) 3) Should we make a separate module? For example,
otel4s-sdk-exporter-prometheus
? 4) According to the spec, we need to support only the text writer 5) Since we need to support all platforms (JVM, Scala.js, Scala Native) we will need to partially reimplement Prometheus Writer and Scrape HandlerExamples
Auto-configuration
Env configuration:
Code:
SDK will launch a dedicated HTTP server at
localhost:9464
.Manual configuration
Instead of launching a dedicated HTTP server, a user can merge exporter routes with the app routes.