Skip to content

Commit a7cf91c

Browse files
basti1302bripkens
andauthored
[receiver/googlecloudmonitoring] Add support for delta distributions (#40688)
#### Description This adds support for converting Google Cloud monitoring delta distribution metrics to OpenTelemetry histograms. #### Link to tracking issue This is related to #39600, although it might not be a complete solution, since this only contributes delta distributions, but not cumulative distributions. #### Testing This has been tested extensively with the metric `run.googleapis.com/request_latencies`. Here is a comparison of the p95 of that metric directly in Google Cloud and of the OTel metric as produced by the new code in a third party tool (Dash0). <img width="1742" alt="20250612_request_latencies_comparison" src="https://github.com/user-attachments/assets/dd88d338-3abd-4dfb-a969-72af7c345a5c" /> There charts have minor differences which I suspect are introduced by different interpolation strategies in the two tools (we only have one datapoint per minute), but besides that, the charts clearly show the same data -- peaks and valleys are at the same timestamps and the y-axis values also match. There are also comprehensive unit tests for the new functionality in `receiver/googlecloudmonitoringreceiver/internal/metrics_conversion_test.go`. #### Remarks Unfortunately I only saw #40216 after I had more or less finished my implementation here. I realize that this is not ideal, since there are now two different PRs that attempt to add the same feature. I am not sure if the author of #40216 is still working on their PR actively. I think the last status there seems to be that tests are missing. I'm happy to port over changes from #40216 in case it has things that are missing here or help porting over changes from here to #40216, if that helps. That said, this PR has a full set of unit tests and it also has support for converting the span context exemplar (although that certainly needs to be double checked, see inline comments). --------- Co-authored-by: Ben Blackmore <[email protected]>
1 parent 38294e5 commit a7cf91c

16 files changed

+1214
-13
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: enhancement
2+
component: googlecloudmonitoringreceiver
3+
note: Add support for converting Google Cloud monitoring delta distribution metrics to OpenTelemetry histograms.
4+
issues: [39600]

receiver/googlecloudmonitoringreceiver/go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/google
33
go 1.23.0
44

55
require (
6+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.128.0
7+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.128.0
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector/component v1.34.1-0.20250610090210-188191247685
810
go.opentelemetry.io/collector/component/componenttest v0.128.1-0.20250610090210-188191247685
@@ -22,11 +24,13 @@ require (
2224
cloud.google.com/go/auth v0.16.1 // indirect
2325
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
2426
cloud.google.com/go/compute/metadata v0.7.0 // indirect
27+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2528
github.com/gobwas/glob v0.2.3 // indirect
2629
github.com/google/s2a-go v0.1.9 // indirect
2730
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
2831
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
2932
github.com/hashicorp/go-version v1.7.0 // indirect
33+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.128.0 // indirect
3034
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
3135
go.opentelemetry.io/collector/consumer/consumererror v0.128.1-0.20250610090210-188191247685 // indirect
3236
go.opentelemetry.io/collector/consumer/xconsumer v0.128.1-0.20250610090210-188191247685 // indirect
@@ -79,3 +83,9 @@ require (
7983
google.golang.org/protobuf v1.36.6
8084
gopkg.in/yaml.v3 v3.0.1 // indirect
8185
)
86+
87+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
88+
89+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil
90+
91+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden

receiver/googlecloudmonitoringreceiver/go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)