autometrics-dev / autometrics-py

Easily add metrics to your code that actually help you spot and debug issues in production. Built on Prometheus and OpenTelemetry.
https://autometrics.dev
Apache License 2.0
214 stars 7 forks source link

Follow Prometheus' metrics naming convention #85

Closed thiromi closed 1 year ago

thiromi commented 1 year ago

The metric names don't follow the naming conventions of Prometheus

COUNTER_NAME = "function.calls"
HISTOGRAM_NAME = "function.calls.duration"
CONCURRENCY_NAME = "function.calls.concurrent"

COUNTER_NAME_PROMETHEUS = COUNTER_NAME.replace(".", "_")
HISTOGRAM_NAME_PROMETHEUS = HISTOGRAM_NAME.replace(".", "_")
CONCURRENCY_NAME_PROMETHEUS = CONCURRENCY_NAME.replace(".", "_")
SERVICE_NAME_PROMETHEUS = SERVICE_NAME.replace(".", "_")

It'd be nice to have them suffixed with the units

actualwitch commented 1 year ago

hello @thiromi and thank you for taking a moment to look into autometrics! as defined in spec, we aim to closely follow the Prometheus/OpenMetrics naming convention, which includes units in the histogram name. they are automatically included by both libraries we use when explicitly defining units in the histogram. furthermore, we also have a couple of tests that ensure the spec conformance.

thiromi commented 1 year ago

OH, you're right! Never mind, then 😅