Skip to content

Conversation

@Syedowais312
Copy link
Contributor

@Syedowais312 Syedowais312 commented Jan 10, 2026

This PR fixes how mdatagen handles deprecated metric fields in metadata.yaml.

The metadata loader now aligns correctly with the schema and test expectations,
ensuring deprecated fields are only set when explicitly defined.

What was changed?

  • Updated metadata loading logic to correctly handle deprecated metric fields
  • Ensured deprecated fields are only set when explicitly specified
  • Aligned generated metadata with existing test expectations
  • All existing and sample mdatagen tests pass after this change

Testing

  • go test ./cmd/mdatagen/...
  • Verified all sample metadata generators and internal tests pass
  • All mdatagen tests pass.

Related: #14113

N/A (internal correctness and test alignment fix)

@Syedowais312 Syedowais312 requested review from a team and dmitryax as code owners January 10, 2026 21:51
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 70.27027% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.81%. Comparing base (8ba3ae3) to head (e8dfbf9).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
cmd/mdatagen/internal/metric.go 58.82% 5 Missing and 2 partials ⚠️
cmd/mdatagen/internal/metadata.go 33.33% 2 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (70.27%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14408      +/-   ##
==========================================
+ Coverage   91.80%   91.81%   +0.01%     
==========================================
  Files         677      677              
  Lines       42608    42700      +92     
==========================================
+ Hits        39116    39207      +91     
- Misses       2429     2434       +5     
+ Partials     1063     1059       -4     

☔ 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 10, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing Syedowais312:fix/mdatagen-deprecated-metrics (e8dfbf9) with main (55399d4)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 61 untouched benchmarks
⏩ 20 skipped benchmarks1

Footnotes

  1. 20 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Syedowais312
Copy link
Contributor Author

Note: generate-contrib failures are expected.

This PR enforces the metadata schema by disallowing deprecated under
telemetry.metrics. Several contrib components still use the old format
and need to migrate to stability: deprecated.

A follow-up issue will be opened in opentelemetry-collector-contrib.

@Syedowais312 Syedowais312 changed the title mdatagen: correctly handle deprecated metric fields cmd/mdatagen: fix deprecated metric handling in metadata loading Jan 10, 2026
@Syedowais312 Syedowais312 marked this pull request as draft January 12, 2026 17:56
@Syedowais312 Syedowais312 force-pushed the fix/mdatagen-deprecated-metrics branch 2 times, most recently from d43516d to 1aef5c5 Compare January 13, 2026 14:57
@Syedowais312 Syedowais312 marked this pull request as ready for review January 13, 2026 18:45
@Syedowais312 Syedowais312 requested a review from dmathieu January 13, 2026 18:46
@dmathieu dmathieu changed the title cmd/mdatagen: fix deprecated metric handling in metadata loading cmd/mdatagen: introduce additional metadata for deprecated metrics Jan 14, 2026
Syedowais312 and others added 2 commits January 15, 2026 22:07
@Syedowais312 Syedowais312 requested a review from dmathieu January 15, 2026 17:19
Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

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

This is starting to look nice 😄

Syedowais312 and others added 4 commits January 16, 2026 16:05
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
@Syedowais312
Copy link
Contributor Author

This is starting to look nice 😄

Thanks! Please let me know if any further changes are needed.

@Syedowais312 Syedowais312 requested a review from dmathieu January 16, 2026 17:15
@dmathieu
Copy link
Member

@Syedowais312 there is one open comment left 😺

@Syedowais312
Copy link
Contributor Author

@Syedowais312 there is one open comment left 😺

@dmathieu thanks for the clarification. I’ve resolved the comment.

Removed note about logging limitations in metric configuration.
@dmathieu dmathieu requested a review from ChrsMark January 22, 2026 13:32
Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

LGTM

# Optional: the stability of the metric. Set to alpha by default.
stability:
# Optional: the stability level of the metric. Set to alpha by default.
level: [alpha|stable|deprecated]
Copy link
Member

@ChrsMark ChrsMark Jan 29, 2026

Choose a reason for hiding this comment

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

Hmm, interesting that it was flattened already 🤔 .
We will handle the flattening in follow-ups in any case, but the levels here should be <development|alpha|beta|stable|deprecated> based on https://opentelemetry.io/docs/collector/internal-telemetry/#metrics.

Copy link
Member

Choose a reason for hiding this comment

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

IMHO, adding that should be its own PR though.

@dmathieu dmathieu added the ready-to-merge Code review completed; ready to merge by maintainers label Jan 29, 2026
@dmathieu
Copy link
Member

Ping @dmitryax for review, since you created the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd/mdatagen processor/memorylimiter ready-to-merge Code review completed; ready to merge by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants