Skip to content
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

Flatten field + fix u64 to string serde #1911

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

hwrdtm
Copy link
Contributor

@hwrdtm hwrdtm commented Jul 4, 2024

Changes

This PR:

  • Is a continuation of what was originally surfaced Fix serde #1856.
  • Flattens some data and value fields in order to be consistent with the JSON schema implemented on the OTEL Collector
    • See here for the struct defs and JSON tags
    • Also see here for an example resource metric in JSON
  • Adds more fields to be correctly doing serde between u64 and String
  • Without both of these changes the ./expected/metrics.json file wouldn't even deserialize correctly.

Testing

  • Run cargo test --workspace --all-features --test grpc_build -- --nocapture to generate grpc files. Running the first time is expected to fail, as it will create the files.
  • Run cargo test --workspace --all-features --test metrics 'test_serde' -- --nocapture to run the new test case introduced in this PR.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

cc @lalitb

@hwrdtm hwrdtm requested a review from a team July 4, 2024 18:38
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.9%. Comparing base (5922205) to head (677ad09).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1911   +/-   ##
=====================================
  Coverage   74.9%   74.9%           
=====================================
  Files        122     122           
  Lines      20311   20311           
=====================================
  Hits       15217   15217           
  Misses      5094    5094           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lalitb lalitb self-assigned this Jul 8, 2024
@hwrdtm
Copy link
Contributor Author

hwrdtm commented Jul 12, 2024

Any thoughts here?

@lalitb
Copy link
Member

lalitb commented Jul 12, 2024

Thanks for the PR @hwrdtm . Will review it tomorrow.

@lalitb
Copy link
Member

lalitb commented Jul 16, 2024

@hwrdtm Thanks for the PR. The fix looks good, with nit comment as we are discussing.

@cijothomas cijothomas merged commit a9b8621 into open-telemetry:main Jul 16, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants