Skip to content

Commit

Permalink
fix grpc interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
shalom938 committed May 7, 2024
1 parent a9ecf80 commit 6c367e7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private void testAndVerify() throws IOException, InterruptedException {
Assertions.assertEquals(1, countSpansByName(traces, "opentelemetry.proto.collector.trace.v1.TraceService/Export"));
Assertions.assertEquals(1, countSpansByName(traces, "TestService.withSpan"));

Assertions.assertEquals(1, countSpansByAttributeValue(traces, "code.function", "withSpan"));
Assertions.assertEquals(1, countSpansByAttributeValue(traces, "code.function", "export"));
Assertions.assertEquals(2, countSpansByAttributeValue(traces, "code.namespace", "io.opentelemetry.smoketest.grpc.TestService"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.File;
import java.util.concurrent.Executor;

@SuppressWarnings("ReturnOfNull")
public class GrpcDemo extends ServerBuilder {

@Override
Expand Down
4 changes: 2 additions & 2 deletions testing/java7/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ tasks {
withType<Test>() {
jvmArgs(
"-Ddigma.autoinstrument.packages=org.digma.otel.test.simple",
//todo: maybe should be false ?
"-Dotel.instrumentation.digma-junit.enabled=true" //disable digma junit because it interferes with the test
//here digma-junit is not disabled because we don't run anything, just check the advices
"-Dotel.instrumentation.digma-junit.enabled=true"
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ void junit5Test() {
new Junit5DemoTests().test();
}

// @Test
// void grpcTest() {
// new GrpcDemo().build();
// }

}
5 changes: 4 additions & 1 deletion testing/methods/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ tasks {
withType<Test>() {
jvmArgs(
"-Ddigma.autoinstrument.packages=com.digma.otel.javaagent.extension.instrumentation.methods.test",
"-Dotel.instrumentation.digma-junit.enabled=false", //disable digma junit because it interferes with the test
//disable digma junit instrumentation module because it interferes with the test,
// the test will fail on timeout because the digma junit spans don't end.
// this is otel property convention to disable a module by name, digma-junit
"-Dotel.instrumentation.digma-junit.enabled=false",
)
}

Expand Down

0 comments on commit 6c367e7

Please sign in to comment.