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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class TracerTest extends AgentInstrumentationSpecification {
// this test uses opentelemetry-api-1.4 instrumentation
def "test tracer builder"() {
when:
def tracer = GlobalOpenTelemetry.get().tracerBuilder("test").build()
def tracer = GlobalOpenTelemetry.get().tracerBuilder("test").setInstrumentationVersion("1.2.3").build()
def testSpan = tracer.spanBuilder("test").setSpanKind(PRODUCER).startSpan()
testSpan.end()

Expand All @@ -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.

👍

attributes {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public ApplicationTracerBuilder(io.opentelemetry.api.trace.TracerBuilder agentTr
}

@Override
public TracerBuilder setSchemaUrl(String s) {
agentTracerBuilder.setSchemaUrl(s);
public TracerBuilder setSchemaUrl(String schemaUrl) {
agentTracerBuilder.setSchemaUrl(schemaUrl);
return this;
}

@Override
public TracerBuilder setInstrumentationVersion(String s) {
agentTracerBuilder.setSchemaUrl(s);
public TracerBuilder setInstrumentationVersion(String version) {
agentTracerBuilder.setInstrumentationVersion(version);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class SpanAssert {
checked.name = true
}

def instrumentationLibraryVersion(String expected) {
assert span.instrumentationLibraryInfo.version == expected
checked.instrumentationLibraryVersion = true
}

def name(Pattern expected) {
assert span.name =~ expected
checked.name = true
Expand Down