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

fix incorrect delegate method #4630

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

breedx-splk
Copy link
Contributor

resolves #4628

I tried writing a test, but the classloading stuff was too perilous and I gave up.

@laurit
Copy link
Contributor

laurit commented Nov 10, 2021

I believe you can modify this test

def "test tracer builder"() {
when:
def tracer = GlobalOpenTelemetry.get().tracerBuilder("test").build()
def testSpan = tracer.spanBuilder("test").setSpanKind(PRODUCER).startSpan()
testSpan.end()
then:
assertTraces(1) {
trace(0, 1) {
span(0) {
name "test"

to verify the fix. Just add something like

assert it.span.instrumentationLibraryInfo.name == "test"
assert it.span.instrumentationLibraryInfo.version == "1.0"

inside the span(0) {} block and set the version on tracer builder.

@breedx-splk
Copy link
Contributor Author

I believe you can modify this test

Interesting. I was just trying to write a vanilla unit test, but that really did fail miserably, so this seems like a good consolation prize. I got it going, thanks for the suggestion.

@@ -347,6 +347,7 @@ class TracerTest extends AgentInstrumentationSpecification {
name "test"
kind PRODUCER
hasNoParent()
instrumentationLibraryVersion "1.2.3"
Copy link
Member

Choose a reason for hiding this comment

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

👍

@mateuszrzeszutek mateuszrzeszutek merged commit 5cbd09e into open-telemetry:main Nov 11, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* fix incorrect delegate method

* add version test
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.

Instrumentation version on application tracer not set correctly when using agent
5 participants