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

Allow multiple instances of OpenTelemetry primary objects #350

Conversation

pavolloffay
Copy link
Member

Resolves #308

Signed-off-by: Pavol Loffay [email protected]

@bogdandrutu
Copy link
Member

/cc @fmhwong - Please give us feedback for this.

@codecov-io
Copy link

codecov-io commented May 27, 2019

Codecov Report

Merging #350 into master will decrease coverage by 0.19%.
The diff coverage is 91.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #350     +/-   ##
===========================================
- Coverage     79.43%   79.24%   -0.2%     
- Complexity      571      576      +5     
===========================================
  Files            65       65             
  Lines          1921     1951     +30     
  Branches        192      195      +3     
===========================================
+ Hits           1526     1546     +20     
- Misses          338      346      +8     
- Partials         57       59      +2
Impacted Files Coverage Δ Complexity Δ
...io/opentelemetry/sdk/metrics/MeterSdkProvider.java 100% <100%> (ø) 3 <2> (+1) ⬆️
.../io/opentelemetry/sdk/trace/TracerSdkProvider.java 100% <100%> (ø) 3 <2> (+1) ⬆️
...dcontext/DistributedContextManagerSdkProvider.java 100% <100%> (ø) 3 <2> (+1) ⬆️
.../src/main/java/io/opentelemetry/OpenTelemetry.java 91.66% <90.47%> (-5.31%) 19 <12> (+4)
...ntelemetry/sdk/trace/RecordEventsReadableSpan.java 96.38% <0%> (-3.62%) 54% <0%> (-2%)

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 78e4e10...7bddc58. Read the comment docs.

@fmhwong
Copy link

fmhwong commented May 28, 2019

will do

private static <T> T loadSpi(Class<T> providerClass) {
private static <T> T loadSpi(Class<T> providerClass, ClassLoader classLoader) {
if (classLoader.getParent() != null) {
return loadSpi(providerClass, classLoader.getParent());
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment why you're making a recursive call. Why do you need the root classloader?

Copy link
Member Author

Choose a reason for hiding this comment

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

+1 will update once we can confirm this works well in multi deployment app servers.

api/src/main/java/io/opentelemetry/OpenTelemetry.java Outdated Show resolved Hide resolved
@pavolloffay
Copy link
Member Author

@fmhwong I have fixed your comments. Could you please confirm this will work in OpenLiberty?

@bogdandrutu
Copy link
Member

What is the status for this?

@pavolloffay
Copy link
Member Author

We are waiting for @fmhwong feedback if this API works well in OpenLiberty.

@fmhwong
Copy link

fmhwong commented Jul 31, 2019

I haven't got this to work in Open Liberty. Looks like this should work. I don't think we need to recursive get the parent of the classloader as classloader (at least in Liberty) will lookup from parent first .

@bogdandrutu
Copy link
Member

bogdandrutu commented Aug 15, 2019

status on this?

@pavolloffay
Copy link
Member Author

I think this could go in per @fmhwong comment.

Just to recap in an app server the instrumentation resides in the server submodules and it's not part of the application deployment. We need a mechanism for the app server to use a different tracer per deployment/app (.war). A different tracer is needed because each app might use a different tracing config (sampling, reporting) but also, more importantly, it should use a different service name.

open-telemetry/oteps#16 is also related topic, however I don't think it would solve this use case, but in contrast, we would have to provide maybe similar mechanisms for resolving the tracer components as we do here.

@pavolloffay pavolloffay changed the title WIP: Allow multiple instances of OpenTelemetry primary objects Allow multiple instances of OpenTelemetry primary objects Sep 11, 2019
@pavolloffay
Copy link
Member Author

I have rebased the PR

@jkwatson
Copy link
Contributor

This PR is super old, and once again needs a rebase. Should we keep kicking this can down the road, or close it, or what?

@jkwatson
Copy link
Contributor

There's been no activity on this PR since September. Is this still needed? Should we close this and revisit when we have a concrete need?

@carlosalberto
Copy link
Contributor

I suggest we close it and have any of the involved parties create a new PR if/when needed.

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.

API: Global registry in application server with multiple deployments
7 participants