-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support unmarshalling JSON-formatted CloudWatch Metric Streams #38407
Labels
enhancement
New feature or request
Comments
The logic can be extracted from https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsfirehosereceiver/internal/unmarshaler/cwmetricstream The receiver should probably then depend on the extension package to have support for the encoding built-in. |
MovieStoreGuy
added a commit
that referenced
this issue
Mar 11, 2025
Loading
Loading status checks…
…rshalling JSON-formatted CloudWatch Metric Streams (#38419) #### Description This PR implements the translation of JSON-formatted CloudWatch Metric Streams into OpenTelemetry metrics. It receives a record, and splits that record by each new line. Each of these parts will correspond to a JSON CloudWatch Metric Stream. It then translates this metric into an OpenTelemetry metric. The obtained metrics from the record are returned. It follows the same logic as https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsfirehosereceiver/internal/unmarshaler/cwmetricstream. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #38407. <!--Describe what testing was performed and which tests were added.--> #### Testing I have added unit tests to: - Check we can extract open telemetry metrics from JSON valid cloudwatch metric stream - Check there are no metrics extracted if the data does not have expected format (for example, no unit or no value) - Check we can obtain metrics from a record containing both valid and invalid cloudwatch metric stream. You can easily read and study what we get to what we return in the `testdata/json` files of the extension. <!--Describe the documentation added.--> #### Documentation The coding comments and the README file should be enough for documentation. --------- Co-authored-by: Andrew Wilkins <axwalk@gmail.com> Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component(s)
extension/encoding/awscloudwatchmetricstreamsencoding
Is your feature request related to a problem? Please describe.
I would like to be able to use the awscloudwatchmetricstreamsencoding extension to unmarshal JSON-formatted metrics from CloudWatch Metric Streams.
Describe the solution you'd like
Implement this:
opentelemetry-collector-contrib/extension/encoding/awscloudwatchmetricstreamsencodingextension/extension.go
Lines 46 to 49 in 7219cc4
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: