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 struct with xxhash-based hash method (#38795)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Creates MetricIdentity struct for uniquely identifying metrics and adds
a deterministic Hash method using xxhash with proper field separation.
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
partly fixes#37277.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
<!--Describe the documentation added.-->
#### Documentation
<!--Please delete paragraphs that you did not use before submitting.-->
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