You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from go.opentelemetry.io/otel/exporters/prometheus v0.50.0 to go.opentelemetry.io/otel/exporters/prometheus v0.53.0 I see the following error exemplar label name \"wg.operation.hash\" is invalid.
We use a custom view to filter metric attributes with high cardinality. While the metric is definitely dropped in the view it seems the data is still exported on the prometheus exporter.
It is necessary to checkout 664a075 to not run into a different exemplar prometheus issue.
varopts []sdkmetric.Option// Exclude attributes from metricsattributeFilter:=func(value attribute.KeyValue) bool {
ifisKeyInSlice(value.Key, defaultExcludedOtelKeys) {
returnfalse
}
name:=sanitizeName(string(value.Key))
for_, re:=rangec.Prometheus.ExcludeMetricLabels {
ifre.MatchString(name) {
returnfalse
}
}
returntrue
}
msBucketHistogram:= sdkmetric.AggregationExplicitBucketHistogram{
Boundaries: msBucketsBounds,
}
bytesBucketHistogram:= sdkmetric.AggregationExplicitBucketHistogram{
Boundaries: bytesBucketBounds,
}
varview sdkmetric.View=func(i sdkmetric.Instrument) (sdkmetric.Stream, bool) {
// In a custom View function, we need to explicitly copy the name, description, and unit.s:= sdkmetric.Stream{Name: i.Name, Description: i.Description, Unit: i.Unit}
// Use different histogram buckets for PrometheusConfigifi.Unit==unitBytes&&i.Kind==sdkmetric.InstrumentKindHistogram {
s.Aggregation=bytesBucketHistogram
} elseifi.Unit==unitMilliseconds&&i.Kind==sdkmetric.InstrumentKindHistogram {
s.Aggregation=msBucketHistogram
}
// Filter out metrics that match the excludeMetrics regexesfor_, re:=rangec.Prometheus.ExcludeMetrics {
promName:=sanitizeName(i.Name)
ifre.MatchString(promName) {
// Drop the metrics.Aggregation= sdkmetric.AggregationDrop{}
returns, true
}
}
// Filter out attributes that match the excludeMetricAttributes regexess.AttributeFilter=attributeFilterreturns, true
}
opts=append(opts, sdkmetric.WithView(view))
Description
After upgrading from
go.opentelemetry.io/otel/exporters/prometheus v0.50.0
togo.opentelemetry.io/otel/exporters/prometheus v0.53.0
I see the following errorexemplar label name \"wg.operation.hash\" is invalid
.We use a custom view to filter metric attributes with high cardinality. While the metric is definitely dropped in the view it seems the data is still exported on the prometheus exporter.
It is necessary to checkout 664a075 to not run into a different exemplar prometheus issue.
Stacktrace of the OTEL error
Environment
Expected behavior
It should be possible to filter attributes like before including prometheus exporter support
The text was updated successfully, but these errors were encountered: