Skip to content

Conversation

@iblancasa
Copy link
Contributor

@iblancasa iblancasa commented Jul 29, 2025

Description

Add E2E test to ensure internal metrics remain with the same name after changes done to the collector or their dependencies.

Link to tracking issue

Relates #13456
Fixes #12918

@iblancasa iblancasa requested a review from a team as a code owner July 29, 2025 10:24
@iblancasa iblancasa requested a review from jade-guiton-dd July 29, 2025 10:24
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Wohoo, that is an awesome start! I wouldn't say it fixes #13456, though. What I had in mind for that issue is that we provide some kind of platform, where if a component becomes Stable, we'll automatically include it in our end-to-end tests.

Also, for a follow-up, metrics exposed by Prometheus may have different formats depending on content negotiation. Not sure if we want to assert only the scrape without negotiation or if we want to cover other kinds of content types.

Copy link
Contributor

@jade-guiton-dd jade-guiton-dd left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! You'll want to fix the conflict so the CI can run.

@iblancasa
Copy link
Contributor Author

Wohoo, that is an awesome start! I wouldn't say it fixes #13456, though. What I had in mind for that issue is that we provide some kind of platform, where if a component becomes Stable, we'll automatically include it in our end-to-end tests.

You are right. I modified the PR description to just refer to the ticket but not close it. As it was being discussed, very likely weaver is the solution for this, but we are not on that point yet. So, this ticket will help but not be the final

@iblancasa iblancasa force-pushed the 13456 branch 3 times, most recently from 5018568 to 84f37a3 Compare July 30, 2025 07:19
@codecov
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.93%. Comparing base (8b73477) to head (e77380b).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13519      +/-   ##
==========================================
- Coverage   91.95%   91.93%   -0.03%     
==========================================
  Files         529      529              
  Lines       31446    31446              
==========================================
- Hits        28917    28909       -8     
- Misses       1998     2004       +6     
- Partials      531      533       +2     

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

@iblancasa iblancasa force-pushed the 13456 branch 3 times, most recently from b0cd18a to 6df7f3d Compare July 30, 2025 09:21
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Ok, I've tested this test manually and tried changing some metric names in metadata.yaml files just to verify it fails if the name changes. It does!

What I'm concerned now is that some metrics seem to be broken already, I see duplicated units like otelcol_exporter_sent_spans__spans__total (double span), and also duplicated underscores. This isn't what they were supposed to look 🤔

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks @iblancasa! This is super exciting and something this repo has needed for some time

@ywwg
Copy link
Contributor

ywwg commented Jul 30, 2025

Not sure if we want to assert only the scrape without negotiation or if we want to cover other kinds of content types.

I think we only need to test both NoTranslation and UnderscoreEscapingWithSuffixes. the other two should be fine if those two work

@ArthurSens
Copy link
Member

Not sure if we want to assert only the scrape without negotiation or if we want to cover other kinds of content types.

I think we only need to test both NoTranslation and UnderscoreEscapingWithSuffixes. the other two should be fine if those two work

this configuration doesn't exist in Go SDK yet, so we need to implement that first

@iblancasa iblancasa force-pushed the 13456 branch 4 times, most recently from e77c066 to a4ce1a4 Compare July 31, 2025 12:02
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Please rebase or merge main, the metric names should no longer have duplicated units

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for working on this ❤️

Comment on lines +145 to +146
"otelcol_processor_batch_batch_send_size": false,
"otelcol_processor_batch_batch_send_size_bytes": false,
Copy link
Member

@ArthurSens ArthurSens Aug 1, 2025

Choose a reason for hiding this comment

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

Alright, that looked weird, but looking at the metadata.yaml file, there really are two metrics with "same" name, just changing that the unit was added as suffix.

From my understanding, this goes against OTel's spec for metric names, but let's worry about that in the right time :P

@iblancasa
Copy link
Contributor Author

@open-telemetry/collector-approvers could we have this merged?

@mx-psi mx-psi added this pull request to the merge queue Aug 4, 2025
Merged via the queue into open-telemetry:main with commit 308d321 Aug 4, 2025
56 of 57 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Aug 5, 2025
#### Description
2nd attempt to fix renovate by using exact versions

note future regressions on prometheus metrics will be caught by
#13519

#### Link to tracking issue
Fixes
#13552
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.

issues emitting metrics should be captured in e2e test

7 participants