-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Relax consistency checks during gathering #417
Conversation
Also, clarify in the doc comment. Previously, the assumption was that inconsistent label dimensions are violating the exposition format spec. However, especially with the knowledge that OpenMetrics will explicitly allow inconsistent label dimensions in expositions, we should allow it in client_golang, too. Note that registration with proper Descs provided will still check for consistont label dimensions. However, you can "cheat" with custom Collectors as you can collect metrics that don't follew the provided Desc (this will be made more explicit and less cheaty once #47 is fixed). You can also create expositions with inconsistent label dimensions by merging Gatherers with the Gatherers slice type. (The latter is used in the Pushgateway.) Effectively, normal direct instrumentation will always have consistent label dimensions in this way, but you can cover special use cases with custom collectors or merging of different Gatherers. Signed-off-by: beorn7 <[email protected]>
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.
👍
prometheus/registry.go
Outdated
// prevented any meaningful metric collection) or contain a number of | ||
// MetricFamily protobufs, some of which might be incomplete, and some | ||
// might be missing altogether. The returned error (which might be a | ||
// MultiError) explains the details. In scenarios where complete |
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.
I know this is an existing comment. Collection should be an all or nothing thing by default as you're going to get unworkable semantics otherwise (e.g. that cadvisor bug), this wording implies that that's not usually the case rather than being a use case so rare we've yet to see it. I'd suggest something like "the returned MetricFamily protobufs should almost always be discarded"
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.
I have changed the wording to something stronger.
Signed-off-by: beorn7 <[email protected]>
Hi! I'd like to upgrade statsd_exporter to a version of client_golang with this change, so that a metric producer does not need to select a globally unique metric name. Is it possible to include this in a release? Thanks. |
Also, clarify in the doc comment.
Previously, the assumption was that inconsistent label dimensions are
violating the exposition format spec. However, especially with the
knowledge that OpenMetrics will explicitly allow inconsistent label
dimensions in expositions, we should allow it in client_golang, too.
Note that registration with proper Descs provided will still check for
consistont label dimensions. However, you can "cheat" with custom
Collectors as you can collect metrics that don't follew the provided
Desc (this will be made more explicit and less cheaty once #47 is
fixed). You can also create expositions with inconsistent label
dimensions by merging Gatherers with the Gatherers slice type. (The
latter is used in the Pushgateway.)
Effectively, normal direct instrumentation will always have consistent
label dimensions in this way, but you can cover special use cases with
custom collectors or merging of different Gatherers.
Signed-off-by: beorn7 [email protected]