Skip to content

Commit 5b5f6a7

Browse files
authored
[receiver/awsfirehose] Fix decoding for OTLP-formatted metrics (#39720)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Fix decoding for OTLP-formatted metrics. The unmarshaler for OTLP-formatted metrics uses the [awscloudwatchmetricstreamsencodingextension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/encoding/awscloudwatchmetricstreamsencodingextension) to unmarshal the metrics, instead of a custom unmarshaler. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #39462. <!--Describe what testing was performed and which tests were added.--> #### Testing Unit tests fixed. <!--Describe the documentation added.--> #### Documentation README updated with a warning.
1 parent 795add8 commit 5b5f6a7

File tree

8 files changed

+92
-206
lines changed

8 files changed

+92
-206
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: awsfirehosereceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Fix decoding for OTLP-formatted metrics.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [39462]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: OTLP-formatted metrics were not being decoded correctly until now.
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

receiver/awsfirehosereceiver/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,8 @@ For example:
8888
```
8989

9090
### otlp_v1
91+
9192
The OTLP v1 encoding as produced by CloudWatch metric streams.
9293
See [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats-opentelemetry-100.html) for details.
94+
95+

receiver/awsfirehosereceiver/go.mod

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfir
33
go 1.23.0
44

55
require (
6-
github.com/gogo/protobuf v1.3.2
76
github.com/json-iterator/go v1.1.12
87
github.com/klauspost/compress v1.18.0
8+
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/awscloudwatchmetricstreamsencodingextension v0.0.0-00010101000000-000000000000
99
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.126.0
1010
github.com/stretchr/testify v1.10.0
1111
go.opentelemetry.io/collector/component v1.32.0
@@ -19,6 +19,7 @@ require (
1919
go.opentelemetry.io/collector/consumer v1.32.0
2020
go.opentelemetry.io/collector/consumer/consumererror v0.126.0
2121
go.opentelemetry.io/collector/consumer/consumertest v0.126.0
22+
go.opentelemetry.io/collector/extension v1.32.0
2223
go.opentelemetry.io/collector/pdata v1.32.0
2324
go.opentelemetry.io/collector/receiver v1.32.0
2425
go.opentelemetry.io/collector/receiver/receivertest v0.126.0
@@ -29,14 +30,16 @@ require (
2930

3031
require (
3132
github.com/cespare/xxhash/v2 v2.3.0 // indirect
32-
github.com/davecgh/go-spew v1.1.1 // indirect
33+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3334
github.com/felixge/httpsnoop v1.0.4 // indirect
3435
github.com/foxboron/go-tpm-keyfiles v0.0.0-20250323135004-b31fac66206e // indirect
3536
github.com/fsnotify/fsnotify v1.9.0 // indirect
3637
github.com/go-logr/logr v1.4.2 // indirect
3738
github.com/go-logr/stdr v1.2.2 // indirect
3839
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
3940
github.com/gobwas/glob v0.2.3 // indirect
41+
github.com/goccy/go-json v0.10.5 // indirect
42+
github.com/gogo/protobuf v1.3.2 // indirect
4043
github.com/golang/snappy v1.0.0 // indirect
4144
github.com/google/go-tpm v0.9.4 // indirect
4245
github.com/google/uuid v1.6.0 // indirect
@@ -48,9 +51,10 @@ require (
4851
github.com/mitchellh/reflectwalk v1.0.2 // indirect
4952
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5053
github.com/modern-go/reflect2 v1.0.2 // indirect
54+
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.126.0 // indirect
5155
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.126.0 // indirect
5256
github.com/pierrec/lz4/v4 v4.1.22 // indirect
53-
github.com/pmezard/go-difflib v1.0.0 // indirect
57+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
5458
github.com/rs/cors v1.11.1 // indirect
5559
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
5660
go.opentelemetry.io/collector/client v1.32.0 // indirect
@@ -95,3 +99,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil
9599
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
96100

97101
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden
102+
103+
replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../../extension/encoding
104+
105+
replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/awscloudwatchmetricstreamsencodingextension => ../../extension/encoding/awscloudwatchmetricstreamsencodingextension

receiver/awsfirehosereceiver/go.sum

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

receiver/awsfirehosereceiver/internal/unmarshaler/otlpmetricstream/unmarshaler.go

Lines changed: 0 additions & 76 deletions
This file was deleted.

receiver/awsfirehosereceiver/internal/unmarshaler/otlpmetricstream/unmarshaler_test.go

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)