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

OpenTracing no longer automatically added in dd-java-agent. Registers GlobalTracer instance via instrumentation if necessary. #1519

Merged
merged 4 commits into from Jun 2, 2020

Conversation

tylerbenson
Copy link
Contributor

With this PR, if GlobalTracer is used, instrumentation will activate to automatically register a Tracer instance for it, but this behavior can be disabled.

To disable OpenTracing:

  • System Property: -Ddd.integration.opentracing.enabled=false
  • Environment Variable: DD_INTEGRATION_OPENTRACING_ENABLED=false

There are several classes that are now duplicated around the codebase. I'm not sure of a good strategy to reduce that duplication.

@tylerbenson tylerbenson marked this pull request as ready for review June 2, 2020 17:41
@tylerbenson tylerbenson requested a review from a team as a code owner June 2, 2020 17:41
@tylerbenson tylerbenson changed the title Remove OpenTracing from dd-java-agent Replace OpenTracing always being used in dd-java-agent with specific instrumentation. Jun 2, 2020
Copy link
Contributor

@randomanderson randomanderson left a comment

Choose a reason for hiding this comment

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

Straightforward and not straightforward at the same time lol. I tried to review everything. I'm relying on the tests for some of the changes to the delegates. Only a couple inline comments and these general thoughts:

Duplicate classes: No need to hold this PR up. We could probably do some shadowJar/gradle magic to get it to work but it's complicated by the fact that we need OT31 and OT32 wrappers. I'm not sure it would be simpler. I looked into Lombok's @Delegated annotation but that doesn't quite work with how we return this.

Interfaces: I still hate how everything has to implement everything. There's no fix right now until we cleanup and hopefully simplify the APIs. The Agent.Context changes do help things a little.

Overall 👍

testCompile project(':dd-trace-core')
testCompile project(':utils:test-utils')

testCompile deps.testLogging
testCompile deps.guava
testCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? Also, why is it 0.31.0 when we're using 0.32.0 everywhere else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to enable OpenTracingTest. I don't remember why I went with 31 instead of 32, but I don't think it matters. I can change if you like.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would argue that this test belongs with the OT instrumentation. It's directly testing that the OT instrumentation is enabled and works. None of the other tests at the dd-java-agent level are that specific.

I don't feel strongly about it though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already have similar tests at the OT instrumentation level. I felt this was a bit more core behavior and warranted a test at the agent level.

@tylerbenson tylerbenson merged commit 9d9a9fd into master Jun 2, 2020
@tylerbenson tylerbenson deleted the tyler/ot-split branch June 2, 2020 21:22
@github-actions github-actions bot added this to the 0.54.0 milestone Jun 2, 2020
@tylerbenson tylerbenson changed the title Replace OpenTracing always being used in dd-java-agent with specific instrumentation. OpenTracing no longer automatically added in dd-java-agent. Registers GlobalTracer instance via instrumentation if necessary. Jun 4, 2020
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.

None yet

2 participants