Skip to content

Conversation

@lsj4401
Copy link
Contributor

@lsj4401 lsj4401 commented Jun 19, 2025

Description

This PR fixes an issue in exporter/exporterhelper's sending_queue where metric names were lost during metricRequest splitting. Previously, when large batches of metrics were processed, the splitting logic in metric_batch.go could cause the name field of some metrics to disappear. This fix ensures that all metric fields are properly preserved when metricRequest objects are split.

Link to tracking issue

Fixes #13236

Resolve an issue in  where metric names were lost when splitting  objects. Updated logic now ensures all metric fields, including names, are retained across splitting operations. Added relevant tests to validate the fix.
@lsj4401 lsj4401 requested review from a team, bogdandrutu and dmitryax as code owners June 19, 2025 15:28
Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a bug please add a test to reproduce it

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about new added bug. Please add tests

Ensure metric metadata is copied when splitting data points by adding a `CopyTo` call. Added comprehensive test coverage to verify correct behavior for various metric types and scenarios.
@github-actions github-actions bot requested a review from bogdandrutu June 20, 2025 22:29
lsj4401 added 2 commits June 21, 2025 07:50
Previously, RequestSizerTypeBytes was calculating datapoint size incorrectly due to the omission of 'name', 'description', and 'unit' fields. This commit rectifies the calculation by including these fields.
@lsj4401
Copy link
Contributor Author

lsj4401 commented Jun 22, 2025

See comment about new added bug. Please add tests

@bogdandrutu
Added tests to confirm the bug and fixed an issue where bytes were being calculated with missing name, description, and unit fields in existing tests.

lsj4401 added 3 commits June 24, 2025 06:25
This update ensures that metadata is copied from source to destination metrics during transformation. Tests have been updated to validate metadata handling, including verifying key-value pairs in the metadata.
@lsj4401
Copy link
Contributor Author

lsj4401 commented Jun 24, 2025

@bogdandrutu
Would you mind reviewing this again?

@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.63%. Comparing base (acb60bc) to head (9feb498).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13238   +/-   ##
=======================================
  Coverage   91.63%   91.63%           
=======================================
  Files         526      526           
  Lines       29398    29406    +8     
=======================================
+ Hits        26938    26946    +8     
  Misses       1944     1944           
  Partials      516      516           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lsj4401
Copy link
Contributor Author

lsj4401 commented Jun 29, 2025

@bogdandrutu
Could you please review this pull request?

@bogdandrutu bogdandrutu added this pull request to the merge queue Jul 3, 2025
Merged via the queue into open-telemetry:main with commit 26a1aed Jul 3, 2025
55 checks passed
@lsj4401 lsj4401 deleted the preserve-metric-names-during-metricrequest branch July 3, 2025 22:55
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.

Metric names disappear when metricRequest is split in metric_batch.go with sending_queue

4 participants