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
receiver/prometheusremotewritereceiver: add MetricIdentity with xxhash-based Hash method.
Creates MetricIdentity struct for uniquely identifying metrics and adds
a deterministic Hash method using xxhash with proper field separation.
partly fixesopen-telemetry#37277.
Copy file name to clipboardExpand all lines: receiver/prometheusremotewritereceiver/receiver.go
+47-7Lines changed: 47 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,46 @@ type prometheusRemoteWriteReceiver struct {
49
49
wg sync.WaitGroup
50
50
}
51
51
52
+
// MetricIdentity contains all the components that uniquely identify a metric
53
+
// according to the OpenTelemetry Protocol data model.
54
+
// The definition of the metric uniqueness is based on the following document. Ref: https://opentelemetry.io/docs/specs/otel/metrics/data-model/#opentelemetry-protocol-data-model
55
+
typeMetricIdentitystruct {
56
+
ResourceIDstring
57
+
ScopeNamestring
58
+
ScopeVersionstring
59
+
MetricNamestring
60
+
Unitstring
61
+
Type writev2.Metadata_MetricType
62
+
}
63
+
64
+
// createMetricIdentity creates a MetricIdentity struct from the required components
// TODO: Replace this with a proper hashing function.
226
-
// The definition of the metric uniqueness is based on the following document. Ref: https://opentelemetry.io/docs/specs/otel/metrics/data-model/#opentelemetry-protocol-data-model
0 commit comments