Skip to content

Commit

Permalink
fix incorrect delegate method (#4630)
Browse files Browse the repository at this point in the history
* fix incorrect delegate method

* add version test
  • Loading branch information
breedx-splk authored Nov 11, 2021
1 parent 4719e4c commit 5cbd09e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
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"
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

0 comments on commit 5cbd09e

Please sign in to comment.