opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Add `setMeterConfigurator` support to `MeterProvider`

Open fandreuz opened this issue 7 months ago • 4 comments

Fixes #7051

fandreuz avatar May 12 '25 22:05 fandreuz

I need to add a bunch more tests, I just wanted to check in to see if the approach is sound. The idea is to have a sort of aggregatorHolder for all storage types, which can be swapped with a DropAggregator according to the current state of the SdkMeter. The complexity lies in how to do this without having partial updates which may result in unexpected recordings.

fandreuz avatar May 12 '25 22:05 fandreuz

Codecov Report

:x: Patch coverage is 93.87755% with 3 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 90.04%. Comparing base (1c5dd50) to head (fbfc03c). :warning: Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...try/sdk/metrics/internal/SdkMeterProviderUtil.java 75.00% 2 Missing :warning:
...sdk/metrics/internal/state/EmptyMetricStorage.java 0.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7346      +/-   ##
============================================
- Coverage     90.06%   90.04%   -0.02%     
- Complexity     7104     7114      +10     
============================================
  Files           805      805              
  Lines         21484    21517      +33     
  Branches       2093     2098       +5     
============================================
+ Hits          19349    19376      +27     
- Misses         1472     1476       +4     
- Partials        663      665       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar May 16 '25 10:05 codecov[bot]

Hi @jack-berg, any comments on this? I think it's ready for a first round of review

fandreuz avatar May 22 '25 15:05 fandreuz

Hey @fandreuz - sorry for the delay. I'm swamped with internal stuff right now. Trying to get in a spot to be able to spend more time doing code reviews for otel next week.

jack-berg avatar May 22 '25 22:05 jack-berg

Hi @jack-berg, thanks for getting back on this. I agree that my solution is a bit invasive and some choices I took are arbitrary. Yours seems to be a good compromise. Let me know what I should do with this PR.

I see many tests commented, are they all failing/not compiling?

fandreuz avatar Jun 17 '25 23:06 fandreuz

Let me know what I should do with this PR. I see many tests commented, are they all failing/not compiling?

I only commented those out to quickly see if the idea was feasible. I'm happy to uncomment / fix those tests and push them to this PR branch, or let you merge in my commit and fix up the tests. No preference here!

jack-berg avatar Jun 20 '25 19:06 jack-berg

I ran the tests and some of them are failing, I'll try to fix them

fandreuz avatar Jun 20 '25 21:06 fandreuz

I ran the tests and some of them are failing, I'll try to fix them

What's the status on this?

jkwatson avatar Sep 11 '25 16:09 jkwatson

Hi @jkwatson, I'm a bit swamped. Somebody else can take it, otherwise I'll get back to this when I have some more time.

fandreuz avatar Sep 15 '25 10:09 fandreuz

I'll pick this up and push commits to this PR if you don't mind @fandreuz

jack-berg avatar Sep 16 '25 15:09 jack-berg

Thank you for your contribution @fandreuz! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

otelbot[bot] avatar Sep 19 '25 17:09 otelbot[bot]