beyla icon indicating copy to clipboard operation
beyla copied to clipboard

Expiring OTel histogram metrics

Open dashpole opened this issue 1 year ago • 0 comments

As discussed during the community call today, the opentelemetry expiry only handles counters, and not histograms: https://github.com/grafana/beyla/blob/main/pkg/internal/netolly/export/otel/expirer.go#L54. This is because synchronous APIs in OTel do not have delete methods on synchronous instruments: https://github.com/open-telemetry/opentelemetry-specification/issues/3062.

The workaround you can use for OTel is to use the SDK's Producer interface to provide aggregated histogram metric data. Alternatively, you could implement the Prometheus Collector interface (which would also solve this for the Prometheus export, and then use the prometheus bridge (go.opentelemetry.io/contrib/bridges/prometheus, which implements the Producer interface, to plug the histogram into the OTel SDK.

dashpole avatar May 08 '24 18:05 dashpole