Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Sep 15, 2022
1 parent 199c8f1 commit 8038293
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ private static void enableInstrumentations(Configuration config, Map<String, Str
if (config.instrumentation.quartz.enabled) {
properties.put("otel.instrumentation.quartz.enabled", "true");
// this is needed for the job.system attribute in order to map those spans to requests
properties.put("otel.instrumentation.quartz.experimental-span-attributes.enabled", "true");
properties.put("otel.instrumentation.quartz.experimental-span-attributes", "true");
// TODO (trask) this line is temporary until 1.19.0, see
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/6633
System.setProperty("otel.instrumentation.quartz.experimental-span-attributes", "true");
}
if (config.instrumentation.rabbitmq.enabled) {
properties.put("otel.instrumentation.rabbitmq.enabled", "true");
Expand All @@ -243,8 +246,11 @@ private static void enableInstrumentations(Configuration config, Map<String, Str
if (config.instrumentation.springScheduling.enabled) {
properties.put("otel.instrumentation.spring-scheduling.enabled", "true");
// this is needed for the job.system attribute in order to map those spans to requests
properties.put(
"otel.instrumentation.spring-scheduling.experimental-span-attributes.enabled", "true");
properties.put("otel.instrumentation.spring-scheduling.experimental-span-attributes", "true");
// TODO (trask) this line is temporary until 1.19.0, see
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/6633
System.setProperty(
"otel.instrumentation.spring-scheduling.experimental-span-attributes", "true");
}
if (config.preview.instrumentation.akka.enabled) {
properties.put("otel.instrumentation.akka-actor.enabled", "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public final class SpanDataMapper {
.put("thread.", true)
.put("faas.", true)
.put("code.", true)
.put("job.", true) // proposed semantic convention which we use for job.system
.build();
}

Expand Down Expand Up @@ -144,7 +145,7 @@ public static boolean isRequest(
SpanKind kind, SpanContext parentSpanContext, Function<AttributeKey<String>, String> attrFn) {
if (kind == SpanKind.INTERNAL) {
// INTERNAL scheduled job spans with no parent are mapped to requests
return !parentSpanContext.isValid() && attrFn.apply(JOB_SYSTEM) != null;
return attrFn.apply(JOB_SYSTEM) != null && !parentSpanContext.isValid();
} else if (kind == SpanKind.CLIENT || kind == SpanKind.PRODUCER) {
return false;
} else if (kind == SpanKind.CONSUMER
Expand Down

0 comments on commit 8038293

Please sign in to comment.