Skip to content

Conversation

@mateuszrzeszutek
Copy link
Member

…oint

As described in open-telemetry/opentelemetry-java-instrumentation#6285 (comment) (and earlier in the SIG)

This is needed so that we can deprecate the ConfigCustomizer agent SPI, and fully rely on the SDK SPIs to manipulate config.

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #4608 (946423b) into main (21abfa2) will decrease coverage by 0.00%.
The diff coverage is 94.44%.

@@             Coverage Diff              @@
##               main    #4608      +/-   ##
============================================
- Coverage     90.06%   90.06%   -0.01%     
- Complexity     5063     5069       +6     
============================================
  Files           583      583              
  Lines         15629    15646      +17     
  Branches       1500     1501       +1     
============================================
+ Hits          14077    14091      +14     
- Misses         1098     1100       +2     
- Partials        454      455       +1     
Impacted Files Coverage Δ
...autoconfigure/spi/AutoConfigurationCustomizer.java 0.00% <0.00%> (ø)
...nfigure/AutoConfiguredOpenTelemetrySdkBuilder.java 94.63% <100.00%> (+0.38%) ⬆️
...try/sdk/autoconfigure/DefaultConfigProperties.java 94.11% <100.00%> (+0.36%) ⬆️
...metry/sdk/metrics/export/PeriodicMetricReader.java 87.14% <0.00%> (-2.86%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21abfa2...946423b. Read the comment docs.

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 so I understand, the difference between this and addPropertiesSupplier(Supplier<Map<String, String>> is that this allows you to conditionally change properties based on the presence of some config in ConfigProperties?

@mateuszrzeszutek
Copy link
Member Author

Just so I understand, the difference between this and addPropertiesSupplier(Supplier<Map<String, String>> is that this allows you to conditionally change properties based on the presence of some config in ConfigProperties?

Yeah, that's exactly the point.
I believe that will be super useful for vendor distributions, where you might want to introduce a "synthetic" configuration flag that turns on/off a bunch of options at once (e.g. enable/disable all metrics), or append an auth header to OTLP headers without overwriting the user settings, etc.

@jkwatson
Copy link
Contributor

Just a final gut-check: Are we ok with owning this API forever? We're adding it to a stable module, so the name, etc is going to be un-changable.

@jack-berg
Copy link
Member

I think its reasonable. It overlaps with addPropertiesSupplier(Supplier<Map<String, String>>) and in retrospect I wish we could only have this new customizer instead of both. But the ability to layer configuration instead of overwriting it is definitely valuable: Imagine you want to have customizer that adds an API key header for authentication. With the addPropertiesSupplier route this would override or be overridden by user configuration for additional headers. In contrast with the customizer, you can notice that the user has added custom headers, and append an addition API key header.

Mateusz Rzeszutek and others added 4 commits July 29, 2022 12:38
@jack-berg jack-berg merged commit 91bd17e into open-telemetry:main Aug 7, 2022
@mateuszrzeszutek mateuszrzeszutek deleted the properties-customizer branch August 9, 2022 05:26
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.

3 participants