-
Notifications
You must be signed in to change notification settings - Fork 118
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
fix broken internal metrics names and make them optional #203
Conversation
@@ -227,7 +231,7 @@ func (r *scopeRegistry) removeWithRLock(subscopeBucket *scopeBucket, key string) | |||
|
|||
// Records internal Metrics' cardinalities. | |||
func (r *scopeRegistry) reportInternalMetrics() { | |||
if r.skipInternalMetrics { | |||
if r.internalMetricsOption != SendInternalMetrics { |
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.
we can eventually set a default option if it's unset
scope_registry.go
Outdated
counterCardinalityName = "tally.internal.counter-cardinality" | ||
gaugeCardinalityName = "tally.internal.gauge-cardinality" | ||
histogramCardinalityName = "tally.internal.histogram-cardinality" | ||
counterCardinalityName = "tally-internal-counter-cardinality" |
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.
The fact that this can cause a panic is not great. We should handle an invalid metric names gracefully. We could add sanitazation to the code where the metric is being registered. Though it probably makes sense to have it as a separate PR.
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.
created #204 to track this request
scope_registry.go
Outdated
counterCardinalityName = "tally.internal.counter-cardinality" | ||
gaugeCardinalityName = "tally.internal.gauge-cardinality" | ||
histogramCardinalityName = "tally.internal.histogram-cardinality" | ||
counterCardinalityName = "tally-internal-counter-cardinality" |
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 don't think either dots or dashes are accepted by prometheus reporter. At least they not legal characters according to Prom data model
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.
will change to underscore
scope_registry.go
Outdated
gaugeCardinalityName = "tally.internal.gauge-cardinality" | ||
histogramCardinalityName = "tally.internal.histogram-cardinality" | ||
counterCardinalityName = "tally-internal-counter-cardinality" | ||
gaugeCardinalityName = "tally-internal-gauge-cardinality" |
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.
can we please have a test for that?
funny enough we have a comment in Prom reporter example about dashes and dots
https://github.com/uber-go/tally/blob/master/prometheus/example/prometheus_main.go#L37
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'll have the scope's sanitizer process it during runtime instead. This way we can be agnostic about whatever scope/reporter/sanitizer is underneath.
* improved internal metrics config setup * internal metric names are sanitized at runtime
* improved internal metrics config setup * internal metric names are sanitized at runtime
This addresses #198