autometrics-dev / autometrics-go

Easily add metrics to your system -- and actually understand them using automatically customized Prometheus queries
https://autometrics.dev
Apache License 2.0
142 stars 9 forks source link

Exemplar support #44

Open emschwartz opened 1 year ago

emschwartz commented 1 year ago

Not entirely sure what the support is like upstream: https://github.com/open-telemetry/opentelemetry-go/issues/559

gagbo commented 1 year ago

It seems the blocking issue for autometrics is this issue https://github.com/open-telemetry/opentelemetry-go/issues/3163

As long as that is not fixed I don't think there's much we can do. Exemplars as a datastructure attached to datapoints exist in the SDK codebase but I found no way to add Exemplars to counters in the OpenTelemetry codebase. All it can do is add "attributes" that end up being labels in the Prometheus export

The prometheus client does have support for adding exemplars it seems, but it looks like we need to specify what we want as exemplars, since both key and value are mostly free-form fields. I'm not sure what's the good way to try to extract the traceID/spanID in a "framework agnostic" way in Go, it'll take some research I think

gagbo commented 1 year ago

This is done for Prometheus, still waiting on something for opentelemetry, but we can probably just use tracing