Skip to content

Commit e40606b

Browse files
committed
Merge branch 'master' into sarahchen6/test-dd-octo-sts-workflow
2 parents 0d5b049 + e82c8b5 commit e40606b

File tree

83 files changed

+1614
-1454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1614
-1454
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
issuer: https://gitlab.ddbuild.io
2+
3+
subject_pattern: "project_path:DataDog/apm-reliability/dd-trace-java:ref_type:tag:ref:v.*"
4+
5+
claim_pattern:
6+
project_path: "DataDog/apm-reliability/dd-trace-java"
7+
ref_type: "tag"
8+
ref: "v.*"
9+
10+
permissions:
11+
contents: "write"

.github/workflows/analyze-changes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Build dd-trace-java for creating the CodeQL database
4949
run: |
50-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
50+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
5151
JAVA_HOME=$JAVA_HOME_8_X64 \
5252
JAVA_8_HOME=$JAVA_HOME_8_X64 \
5353
JAVA_11_HOME=$JAVA_HOME_11_X64 \
@@ -93,7 +93,7 @@ jobs:
9393
9494
- name: Build and publish artifacts locally
9595
run: |
96-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
96+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
9797
JAVA_HOME=$JAVA_HOME_8_X64 \
9898
JAVA_8_HOME=$JAVA_HOME_8_X64 \
9999
JAVA_11_HOME=$JAVA_HOME_11_X64 \

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
git push -u origin $BRANCH_NAME --force
2929
- name: Update Gradle dependencies
3030
run: |
31-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
31+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
3232
JAVA_HOME=$JAVA_HOME_8_X64 \
3333
JAVA_8_HOME=$JAVA_HOME_8_X64 \
3434
JAVA_11_HOME=$JAVA_HOME_11_X64 \

components/environment/src/main/java/datadog/environment/CommandLine.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class CommandLine {
2626
private static final String SUN_JAVA_COMMAND_PROPERTY = "sun.java.command";
27-
final List<String> fullCommand = findFullCommand();
27+
private final List<String> fullCommand = findFullCommand();
2828
final String name = getCommandName();
2929
final List<String> arguments = getCommandArguments();
3030

@@ -35,14 +35,14 @@ private List<String> findFullCommand() {
3535
}
3636

3737
private String getCommandName() {
38-
return fullCommand.isEmpty() ? null : fullCommand.get(0);
38+
return this.fullCommand.isEmpty() ? null : this.fullCommand.get(0);
3939
}
4040

4141
private List<String> getCommandArguments() {
42-
if (fullCommand.isEmpty()) {
43-
return fullCommand;
42+
if (this.fullCommand.isEmpty()) {
43+
return this.fullCommand;
4444
} else {
45-
return fullCommand.subList(1, fullCommand.size());
45+
return this.fullCommand.subList(1, this.fullCommand.size());
4646
}
4747
}
4848
}

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java

Lines changed: 108 additions & 94 deletions
Large diffs are not rendered by default.

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Library.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package datadog.trace.bootstrap;
22

3+
import datadog.environment.EnvironmentVariables;
34
import java.util.EnumSet;
45
import org.slf4j.Logger;
56

@@ -15,7 +16,7 @@ public enum Library {
1516
public static EnumSet<Library> detectLibraries(final Logger log) {
1617
final EnumSet<Library> libraries = EnumSet.noneOf(Library.class);
1718

18-
final String jbossHome = System.getenv("JBOSS_HOME");
19+
final String jbossHome = EnvironmentVariables.get("JBOSS_HOME");
1920
if (jbossHome != null) {
2021
log.debug("Env - jboss: {}", jbossHome);
2122
libraries.add(WILDFLY);

dd-java-agent/agent-logging/src/main/java/datadog/trace/logging/ddlogger/DDLoggerFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package datadog.trace.logging.ddlogger;
22

3+
import datadog.environment.EnvironmentVariables;
4+
import datadog.environment.SystemProperties;
35
import datadog.trace.api.Platform;
46
import datadog.trace.logging.LogLevel;
57
import datadog.trace.logging.LogLevelSwitcher;
@@ -99,14 +101,14 @@ && isFlagEnabled(
99101

100102
private static boolean isFlagEnabled(
101103
final String systemProperty, final String envVar, final boolean defaultValue) {
102-
String value = System.getProperty(systemProperty);
104+
String value = SystemProperties.get(systemProperty);
103105
if ("true".equalsIgnoreCase(value)) {
104106
return true;
105107
}
106108
if ("false".equalsIgnoreCase(value)) {
107109
return false;
108110
}
109-
value = System.getenv(envVar);
111+
value = EnvironmentVariables.get(envVar);
110112
if ("true".equalsIgnoreCase(value)) {
111113
return true;
112114
}

dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import static datadog.context.propagation.Propagators.defaultPropagator;
44
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
55
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.traceConfig;
6-
import static datadog.trace.core.datastreams.TagsProcessor.DIRECTION_OUT;
7-
import static datadog.trace.core.datastreams.TagsProcessor.DIRECTION_TAG;
8-
import static datadog.trace.core.datastreams.TagsProcessor.TYPE_TAG;
96

107
import datadog.context.Context;
118
import datadog.context.propagation.CarrierSetter;
@@ -14,6 +11,7 @@
1411
import datadog.trace.api.cache.DDCache;
1512
import datadog.trace.api.cache.DDCaches;
1613
import datadog.trace.api.datastreams.DataStreamsContext;
14+
import datadog.trace.api.datastreams.DataStreamsTags;
1715
import datadog.trace.api.naming.SpanNaming;
1816
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
1917
import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes;
@@ -23,7 +21,6 @@
2321
import io.grpc.MethodDescriptor;
2422
import io.grpc.Status;
2523
import java.util.BitSet;
26-
import java.util.LinkedHashMap;
2724
import java.util.Set;
2825
import java.util.function.Function;
2926

@@ -35,10 +32,8 @@ public class GrpcClientDecorator extends ClientDecorator {
3532
public static final CharSequence GRPC_MESSAGE = UTF8BytesString.create("grpc.message");
3633

3734
private static DataStreamsContext createDsmContext() {
38-
LinkedHashMap<String, String> result = new LinkedHashMap<>();
39-
result.put(DIRECTION_TAG, DIRECTION_OUT);
40-
result.put(TYPE_TAG, "grpc");
41-
return DataStreamsContext.fromTags(result);
35+
return DataStreamsContext.fromTags(
36+
DataStreamsTags.create("grpc", DataStreamsTags.Direction.Outbound));
4237
}
4338

4439
public static final GrpcClientDecorator DECORATE = new GrpcClientDecorator();

dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcServerDecorator.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package datadog.trace.instrumentation.armeria.grpc.server;
22

3-
import static datadog.trace.core.datastreams.TagsProcessor.DIRECTION_IN;
4-
import static datadog.trace.core.datastreams.TagsProcessor.DIRECTION_TAG;
5-
import static datadog.trace.core.datastreams.TagsProcessor.TYPE_TAG;
6-
73
import datadog.trace.api.Config;
84
import datadog.trace.api.cache.DDCache;
95
import datadog.trace.api.cache.DDCaches;
6+
import datadog.trace.api.datastreams.DataStreamsTags;
107
import datadog.trace.api.naming.SpanNaming;
118
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
129
import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities;
@@ -18,7 +15,6 @@
1815
import io.grpc.StatusException;
1916
import io.grpc.StatusRuntimeException;
2017
import java.util.BitSet;
21-
import java.util.LinkedHashMap;
2218
import java.util.function.Function;
2319

2420
public class GrpcServerDecorator extends ServerDecorator {
@@ -33,15 +29,11 @@ public class GrpcServerDecorator extends ServerDecorator {
3329
public static final CharSequence COMPONENT_NAME = UTF8BytesString.create("armeria-grpc-server");
3430
public static final CharSequence GRPC_MESSAGE = UTF8BytesString.create("grpc.message");
3531

36-
private static final LinkedHashMap<String, String> createServerPathwaySortedTags() {
37-
LinkedHashMap<String, String> result = new LinkedHashMap<>();
38-
result.put(DIRECTION_TAG, DIRECTION_IN);
39-
result.put(TYPE_TAG, "grpc");
40-
return result;
32+
private static DataStreamsTags createServerPathwaySortedTags() {
33+
return DataStreamsTags.create("grpc", DataStreamsTags.Direction.Inbound);
4134
}
4235

43-
public static final LinkedHashMap<String, String> SERVER_PATHWAY_EDGE_TAGS =
44-
createServerPathwaySortedTags();
36+
public static final DataStreamsTags SERVER_PATHWAY_EDGE_TAGS = createServerPathwaySortedTags();
4537
public static final GrpcServerDecorator DECORATE = new GrpcServerDecorator();
4638

4739
private static final Function<String, String> NORMALIZE =

dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcTest.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,12 @@ abstract class ArmeriaGrpcTest extends VersionedNamingTestBase {
254254
if (isDataStreamsEnabled()) {
255255
StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 }
256256
verifyAll(first) {
257-
edgeTags.containsAll(["direction:out", "type:grpc"])
258-
edgeTags.size() == 2
257+
tags.hasAllTags("direction:out", "type:grpc")
259258
}
260259

261260
StatsGroup second = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == first.hash }
262261
verifyAll(second) {
263-
edgeTags.containsAll(["direction:in", "type:grpc"])
264-
edgeTags.size() == 2
262+
tags.hasAllTags("direction:in", "type:grpc")
265263
}
266264
}
267265

0 commit comments

Comments
 (0)