-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Experiment: Schematized Metrics #1427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
represents "probe" label as it really is, with no prefix
metric_name: blackbox_exporter_config_last_reload_successful | ||
brief: "Blackbox exporter config loaded successfully" | ||
instrument: "gauge" | ||
unit: "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't get any warning from Weaver? This is not the correct Otel unit type I think (just curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a valid unit!
Instruments for utilization metrics (that measure the fraction out of a total) are dimensionless and SHOULD use the default unit 1 (the unity).
https://opentelemetry.io/docs/specs/semconv/general/metrics/#instrument-units
However, I still think its the wrong unit here, as it should be seconds lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
One thing I would ensure is to embed/import the generation in the Makefile and CI of this project, so those yamls and Go files don't diverge.
NOTE: Current schema model is not great for changes later on without open-telemetry/opentelemetry-specification#4492 -- so we might want to be careful with committing to a certain yaml model. |
Uses tooling from OTel (https://github.com/open-telemetry/weaver) to strongly schematize all metrics of blackbox_exporter.
This gives:
client_golang
constructors for all metrics that make are:internal/metrics/metrics.md
) that lists all metrics, labels and their respective possible valuesI chose
blackbox_exporter
as a sufficiently simple target to try this approach and serve as a ground for future discussions around schematizing Prometheus metrics.Templates for codegen are at https://github.com/sh0rez/promconv/tree/main/templates/registry/go