-
Notifications
You must be signed in to change notification settings - Fork 1k
Instrument extended open telemetry #15178
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
Instrument extended open telemetry #15178
Conversation
|
I'm getting @laurit can you give me a hint? |
I thin you forgot to actually use the Line 22 in 39137d1
|
|
Thanks @laurit - can you check if this PR together with the SDK PR make sense (see ticket description)? |
751e093 to
e7a46a5
Compare
|
opentelemetry-api-1.47 has this error - not sure what the problem is |
|
@laurit can you help with the error? |
I think I figured it out 😄 |
...va/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/ApplicationOpenTelemetry.java
Show resolved
Hide resolved
...y/javaagent/instrumentation/opentelemetryapi/v1_56/common/ApplicationComponentLoader156.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Override | ||
| public <T> Iterable<T> load(Class<T> type) { | ||
| return componentLoader.load(type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really work? I'd imagine that it will return agent classes that the application code can not process. Without thinking about it too much I'm not even sure it is possible to implement this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right - I can't think of a use case where this is needed after the SDK has been set up. Maybe just throw a helpful exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either exception or an empty iterable, idk which would be preferable here. cc @trask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea of exposing component loader in the configuration API is for instrumentations to use it to load misc components they might need (@jack-berg?)
in which case I think we would want to load from the user class loader here if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea of exposing component loader in the configuration API is for instrumentations to use it to load misc components they might need (@jack-berg?)
- The agent and spring boot starter use their own implementation of component loader for classloader reasons.
- This means that everything loaded via SPI during SDK intialization needs to use whatever component loader is configured
- All the SDK extension points are modeled as implementations of
ComponentProvider, and instantiated viaComponentProvider#create(DeclarativeConfigProperties). This includes things like the OTLP exporters which load compressors and senders via SPI. - So we're able to pass the agent / spring boot starter component loader down to the OTLP exporters via
DeclarativeConfigProperties#getComponentLoader(). - Any
ComponentProviderimplementation that loads via SPI should similarly useDeclarativeConfigProperties#getComponentLoader().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #15406 to discuss
.../instrumentation/opentelemetryapi/v1_56/incubator/OpenTelemetryIncubatorInstrumentation.java
Outdated
Show resolved
Hide resolved
...ry/javaagent/instrumentation/opentelemetryapi/v1_56/incubator/ExtendedOpenTelemetryTest.java
Show resolved
Hide resolved
e6e78cc to
b673cb8
Compare
|
merging, but please open an issue to track what to do with #15178 (comment) |
Fixes #14191