emit-rs / emit

Developer-first diagnostics for Rust applications
Apache License 2.0
123 stars 2 forks source link

Decide whether OTLP metrics should disambiguate names #98

Closed KodrAus closed 3 weeks ago

KodrAus commented 3 weeks ago

A metric sample includes a metric_name, like bytes_written, and a module, like app::http. To disambiguate metric names, we can either combine the name and module, like app_http_bytes_written, expect names to already be unique, or rely on the module being carried and visible elsewhere to do it.

I think we currently do the third; for instance in emit_otlp we set the module in the instrumentation scope.

KodrAus commented 3 weeks ago

For metrics produced by emit itself, we now disambiguate them, even though the module is also set. I think that's the most compatible way to go, but users can decide on their own scheme for naming their metrics.