Skip to content

Added MetricReader customizer for AutoConfiguredOpenTelemetrySdkBuilder#6231

Merged
jack-berg merged 7 commits intoopen-telemetry:mainfrom
streamnative:customize-metric-reader
Feb 29, 2024
Merged

Added MetricReader customizer for AutoConfiguredOpenTelemetrySdkBuilder#6231
jack-berg merged 7 commits intoopen-telemetry:mainfrom
streamnative:customize-metric-reader

Conversation

@asafm
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

asafm commented Feb 15, 2024

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

@codecov
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

asafm commented Feb 19, 2024

@jack-berg Fixed all comments.

Comment thread sdk-extensions/autoconfigure/build.gradle.kts Outdated
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

asafm commented Feb 21, 2024

@jack-berg Fixed

@jack-berg jack-berg merged commit 62a4810 into open-telemetry:main Feb 29, 2024
@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