Skip to content

Commit b551b2e

Browse files
authored
Merge branch 'master' into bdu/simplify-task-partition
2 parents 5edb54e + ce2b2fe commit b551b2e

File tree

4 files changed

+33
-13
lines changed

4 files changed

+33
-13
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ muzzle-dep-report:
539539
needs: [ build_tests ]
540540
stage: tests
541541
variables:
542-
KUBERNETES_MEMORY_REQUEST: 17Gi
543-
KUBERNETES_MEMORY_LIMIT: 17Gi
542+
KUBERNETES_MEMORY_REQUEST: 20Gi
543+
KUBERNETES_MEMORY_LIMIT: 20Gi
544544
KUBERNETES_CPU_REQUEST: 10
545545
GRADLE_WORKERS: 4
546546
GRADLE_MEM: 3G
@@ -725,7 +725,7 @@ test_smoke:
725725
GRADLE_PARAMS: "-PskipFlakyTests"
726726
CACHE_TYPE: "smoke"
727727
parallel:
728-
matrix: *test_matrix_6
728+
matrix: *test_matrix_8
729729

730730
test_ssi_smoke:
731731
extends: .test_job
@@ -736,7 +736,7 @@ test_ssi_smoke:
736736
DD_INJECT_FORCE: "true"
737737
DD_INJECTION_ENABLED: "tracer"
738738
parallel:
739-
matrix: *test_matrix_6
739+
matrix: *test_matrix_8
740740

741741
test_smoke_graalvm:
742742
extends: .test_job

dd-java-agent/instrumentation/jersey/jersey-client-2.0/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ muzzle {
33
group = "org.glassfish.jersey.core"
44
module = "jersey-client"
55
versions = "[2.0,3.0.0)"
6+
// There is no such file `jakarta.annotation-api-1.3.4.redhat-00002.jar`
7+
// in the Maven repository: https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/jakarta/annotation/jakarta.annotation-api/1.3.4.redhat-00002/
8+
excludeDependency "jakarta.annotation:jakarta.annotation-api:1.3.4.redhat-00002"
69
}
710
}
811

912
apply from: "$rootDir/gradle/java.gradle"
1013

1114
dependencies {
1215
compileOnly group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.0'
13-
1416
compileOnly project(':dd-java-agent:instrumentation:rs:jax-rs:jax-rs-client:jax-rs-client-2.0')
1517

1618
testImplementation group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.0'
17-
1819
testImplementation project(':dd-java-agent:instrumentation:rs:jax-rs:jax-rs-client:jax-rs-client-2.0')
1920
}

dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzDecorator.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString;
1111
import datadog.trace.bootstrap.instrumentation.decorator.BaseDecorator;
1212
import org.quartz.JobExecutionContext;
13+
import org.quartz.JobKey;
14+
import org.quartz.TriggerKey;
1315

1416
public class QuartzDecorator extends BaseDecorator {
1517
public static final CharSequence SCHEDULED_CALL = UTF8BytesString.create("scheduled.call");
@@ -34,11 +36,21 @@ protected CharSequence component() {
3436

3537
public AgentSpan onExecute(final AgentSpan span, JobExecutionContext context) {
3638
if (context != null) {
37-
span.setTag(DDTags.RESOURCE_NAME, context.getJobInstance().getClass()).toString();
38-
span.setTag(QUARTZ_TRIGGER_NAME, context.getTrigger().getKey().getName());
39-
span.setTag(QUARTZ_TRIGGER_GROUP, context.getTrigger().getKey().getGroup());
40-
span.setTag(QUARTZ_JOB_NAME, context.getTrigger().getJobKey().getName());
41-
span.setTag(QUARTZ_JOB_GROUP, context.getTrigger().getJobKey().getGroup());
39+
if (context.getJobInstance() != null) {
40+
span.setTag(DDTags.RESOURCE_NAME, context.getJobInstance().getClass()).toString();
41+
}
42+
if (context.getTrigger() != null) {
43+
final TriggerKey key = context.getTrigger().getKey();
44+
if (key != null) {
45+
span.setTag(QUARTZ_TRIGGER_NAME, key.getName());
46+
span.setTag(QUARTZ_TRIGGER_GROUP, key.getGroup());
47+
}
48+
final JobKey jobKey = context.getJobDetail().getKey();
49+
if (jobKey != null) {
50+
span.setTag(QUARTZ_JOB_NAME, jobKey.getName());
51+
span.setTag(QUARTZ_JOB_GROUP, jobKey.getGroup());
52+
}
53+
}
4254
}
4355
return span;
4456
}

internal-api/src/main/java/datadog/trace/api/normalize/HttpResourceNames.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities;
99
import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString;
1010
import java.util.function.Function;
11+
import javax.annotation.Nonnull;
1112

1213
public class HttpResourceNames {
1314
public static final UTF8BytesString DEFAULT_RESOURCE_NAME = UTF8BytesString.create("/");
@@ -71,6 +72,9 @@ private HttpResourceNames() {
7172

7273
public static AgentSpan setForServer(
7374
AgentSpan span, CharSequence method, CharSequence path, boolean encoded) {
75+
if (path == null) {
76+
return span;
77+
}
7478
Pair<CharSequence, Byte> result = computeForServer(method, path, encoded);
7579
if (result.hasLeft()) {
7680
span.setResourceName(result.getLeft(), result.getRight());
@@ -80,7 +84,7 @@ public static AgentSpan setForServer(
8084
}
8185

8286
public static Pair<CharSequence, Byte> computeForServer(
83-
CharSequence method, CharSequence path, boolean encoded) {
87+
CharSequence method, @Nonnull CharSequence path, boolean encoded) {
8488
byte priority;
8589

8690
String resourcePath =
@@ -96,7 +100,7 @@ public static Pair<CharSequence, Byte> computeForServer(
96100
}
97101

98102
public static Pair<CharSequence, Byte> computeForClient(
99-
CharSequence method, CharSequence path, boolean encoded) {
103+
CharSequence method, @Nonnull CharSequence path, boolean encoded) {
100104
byte priority;
101105

102106
String resourcePath =
@@ -112,6 +116,9 @@ public static Pair<CharSequence, Byte> computeForClient(
112116

113117
public static AgentSpan setForClient(
114118
AgentSpan span, CharSequence method, CharSequence path, boolean encoded) {
119+
if (path == null) {
120+
return span;
121+
}
115122
Pair<CharSequence, Byte> result = computeForClient(method, path, encoded);
116123
if (result.hasLeft()) {
117124
span.setResourceName(result.getLeft(), result.getRight());

0 commit comments

Comments
 (0)