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

Added MetricReader customizer for AutoConfiguredOpenTelemetrySdkBuilder #6231

Merged
merged 7 commits into from
Feb 29, 2024

Conversation

asafm
Copy link
Contributor

@asafm asafm commented Feb 15, 2024

Added an ability to customize a MetricReader created at AutoConfiguredOpenTelemetrySdkBuilder by allowing to specify a BiFunction which accepts a MetricReader and the configuration and returns a MetricReader. This allows the user to create a new MetricReader either based on the one created by AutoConfiguredOpenTelemetrySdkBuilder or a completely new one.

@asafm asafm requested a review from a team February 15, 2024 16:01
@asafm
Copy link
Contributor Author

asafm commented Feb 15, 2024

This is the second step for #6179, since without you currently won't be able to modify a Prometheus reader created by AutoConfiguredOpenTelemetrySdkBuilder - the modification is about calling setAllowedResourceAttributesFilter(Predicate<String> resourceAttributesFilter) added in that PR - this method allows you specify which attributes to copy from the Resource attributes into each exported UTS labels.

@asafm
Copy link
Contributor Author

asafm commented Feb 15, 2024

@jack-berg This is the 2nd step required for me to use it in Apache Pulsar.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.06%. Comparing base (6afb816) to head (c2c1487).

Files Patch % Lines
...autoconfigure/spi/AutoConfigurationCustomizer.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6231   +/-   ##
=========================================
  Coverage     91.06%   91.06%           
- Complexity     5695     5699    +4     
=========================================
  Files           621      621           
  Lines         16667    16679   +12     
  Branches       1707     1709    +2     
=========================================
+ Hits          15177    15188   +11     
- Misses          997      998    +1     
  Partials        493      493           

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

@asafm
Copy link
Contributor Author

asafm commented Feb 19, 2024

@jack-berg Fixed all comments.

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Just one last comment about a possible extra dependency.

@asafm
Copy link
Contributor Author

asafm commented Feb 21, 2024

@jack-berg Fixed

@jack-berg jack-berg merged commit 62a4810 into open-telemetry:main Feb 29, 2024
18 checks passed
@asafm asafm deleted the customize-metric-reader branch February 29, 2024 15:41
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.

2 participants