move declarative config ObjectMapper instance to internal class
Is your feature request related to a problem? Please describe.
Spring starter with declarative config needs to use the same settings for object mapper as https://github.com/open-telemetry/opentelemetry-java/blob/e6584623ccd2c626d66b357fd7c2c837a9c862bb/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/DeclarativeConfiguration.java#L66
See https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/14062#discussion_r2527602568
Describe the solution you'd like
Move the instance to an internal class where it can be read without reflection.
Describe alternatives you've considered
Read the instance using reflection.
any other options? it would be nice not to introduce new reliance on internals where possible (#6970)
any other options? it would be nice not to introduce new reliance on internals where possible (#6970)
This is what I can think of - there really is a strong reliance on the jackson settings after all:
- copy-paste (what we have now)
- reflection
- internal class
I personally prefer a bit of copy-paste over relying on internal APIs