Skip to content

Commit 501e36e

Browse files
authored
Merge branch 'master' into mhlidd/telemetry_otel_handling
2 parents 85854df + e16815c commit 501e36e

43 files changed

Lines changed: 210 additions & 135 deletions

File tree

Some content is hidden

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

.github/workflows/run-system-tests.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ jobs:
6363
- build
6464
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
6565
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned on release branches only
66-
secrets:
67-
TEST_OPTIMIZATION_API_KEY: ${{ secrets.DATADOG_API_KEY_PROD }}
6866
permissions:
6967
contents: read
7068
id-token: write
@@ -78,7 +76,7 @@ jobs:
7876
scenarios_groups: tracer-release
7977
excluded_scenarios: APM_TRACING_E2E_OTEL,APM_TRACING_E2E_SINGLE_SPAN,PROFILING # exclude flaky scenarios
8078
skip_empty_scenarios: true
81-
push_to_test_optimization: true
79+
push_to_test_optimization: false # disabled to avoid pushing to Test Optimization while API key is transitioning to system-tests
8280

8381
# Ensure the main job is run to completion
8482
check:

dd-java-agent/agent-crashtracking/src/main/resources/datadog/crashtracking/notify_oome.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ echo "PID: $PID"
5454
unset JDK_JAVA_OPTIONS
5555
unset JAVA_TOOL_OPTIONS
5656
unset _JAVA_OPTIONS
57+
# Prevent the instrumentation injector from re-injecting the agent into the child JVM
58+
unset LD_PRELOAD
59+
unset DYLD_INSERT_LIBRARIES
5760

5861
# Execute the Java command with the loaded values
5962
"$config_java_home/bin/java" -Ddd.dogstatsd.start-delay=0 -jar "$config_agent" sendOomeEvent "$config_tags"

dd-java-agent/agent-crashtracking/src/main/resources/datadog/crashtracking/upload_crash.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ if [ -z "$1" ]; then
1111
unset JDK_JAVA_OPTIONS
1212
unset JAVA_TOOL_OPTIONS
1313
unset _JAVA_OPTIONS
14+
# Prevent the instrumentation injector from re-injecting the agent into the child JVM
15+
unset LD_PRELOAD
16+
unset DYLD_INSERT_LIBRARIES
1417

1518
"!JAVA_HOME!/bin/java" -jar "!AGENT_JAR!" uploadCrash "!JAVA_ERROR_FILE!"
1619
if [ $? -eq 0 ]; then
@@ -129,6 +132,9 @@ echo "PID: $PID"
129132
unset JDK_JAVA_OPTIONS
130133
unset JAVA_TOOL_OPTIONS
131134
unset _JAVA_OPTIONS
135+
# Prevent the instrumentation injector from re-injecting the agent into the child JVM
136+
unset LD_PRELOAD
137+
unset DYLD_INSERT_LIBRARIES
132138

133139
# Execute the Java command with the loaded values
134140
"$config_java_home/bin/java" -jar "$config_agent" uploadCrash -c "$configFile" "$config_hs_err"

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/Fingerprinter.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ public static String fingerprint(Throwable t, ClassNameFilter classNameFiltering
3232
String typeName = clazz.getTypeName();
3333
digest.update(typeName.getBytes());
3434
StackTraceElement[] stackTrace = t.getStackTrace();
35-
for (StackTraceElement stackTraceElement : stackTrace) {
36-
String className = stackTraceElement.getClassName();
37-
if (classNameFiltering.isExcluded(className)) {
38-
continue;
35+
if (stackTrace != null) {
36+
for (StackTraceElement stackTraceElement : stackTrace) {
37+
String className = stackTraceElement.getClassName();
38+
if (classNameFiltering.isExcluded(className)) {
39+
continue;
40+
}
41+
digest.update(stackTraceElement.toString().getBytes());
3942
}
40-
digest.update(stackTraceElement.toString().getBytes());
4143
}
4244
return bytesToHex(digest.digest());
4345
}

dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/exception/FingerprinterTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ void emptyStacktrace() {
6969
Fingerprinter.fingerprint(new EmptyException("test"), classNameFiltering));
7070
}
7171

72+
@Test
73+
void nullStacktrace() {
74+
assertEquals(
75+
"35ae5d9aa4d7179a7d36838ca6266ea459a7cbb6ebc92afc24098bc85cad586",
76+
Fingerprinter.fingerprint(
77+
new RuntimeException("test") {
78+
@Override
79+
public StackTraceElement[] getStackTrace() {
80+
return null;
81+
}
82+
},
83+
classNameFiltering));
84+
}
85+
7286
static class EmptyException extends Exception {
7387
public EmptyException(String message) {
7488
super(message, null, false, false);

dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs/domain/DDLLMObsSpan.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package datadog.trace.llmobs.domain;
22

33
import datadog.context.ContextScope;
4+
import datadog.trace.api.Config;
45
import datadog.trace.api.DDSpanTypes;
56
import datadog.trace.api.DDTraceApiInfo;
67
import datadog.trace.api.DDTraceId;
@@ -74,6 +75,11 @@ public DDLLMObsSpan(
7475

7576
span = spanBuilder.start();
7677

78+
// set global dd_tags as base layer so UST and span-level tags can override them
79+
for (Map.Entry<String, String> entry : Config.get().getGlobalTags().entrySet()) {
80+
span.setTag(LLMOBS_TAG_PREFIX + entry.getKey(), entry.getValue());
81+
}
82+
7783
// set UST (unified service tags, env, service, version)
7884
span.setTag(ENV, wellKnownTags.getEnv());
7985
span.setTag(SERVICE, wellKnownTags.getService());

dd-java-agent/agent-llmobs/src/test/groovy/datadog/trace/llmobs/domain/DDLLMObsSpanTest.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,17 @@ class DDLLMObsSpanTest extends DDSpecification{
411411
null | "has_session_id:0"
412412
}
413413

414+
def "global dd_tags are included in LLMObs span tags"() {
415+
setup:
416+
injectSysConfig("trace.global.tags", "team:backend,owner:ml-platform")
417+
def test = llmObsSpan(Tags.LLMOBS_WORKFLOW_SPAN_KIND, "test-span")
418+
419+
expect:
420+
def innerSpan = (AgentSpan) test.span
421+
innerSpan.getTag(LLMOBS_TAG_PREFIX + "team") == "backend"
422+
innerSpan.getTag(LLMOBS_TAG_PREFIX + "owner") == "ml-platform"
423+
}
424+
414425
private LLMObsSpan llmObsSpan(String kind, name) {
415426
llmObsSpan(kind, name, null)
416427
}

dd-java-agent/agent-otel/otel-bootstrap/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ dependencies {
7474

7575
implementation project(':dd-java-agent:agent-bootstrap')
7676
implementation project(':utils:logging-utils')
77-
implementation project(':communication')
78-
79-
testImplementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.14.0'
8077
}
8178

8279
tasks.named("shadowJar", ShadowJar) {
@@ -109,6 +106,7 @@ tasks.named("shadowJar", ShadowJar) {
109106
exclude 'io/opentelemetry/javaagent/bootstrap/internal/InClassLoaderMatcher*'
110107
exclude 'io/opentelemetry/javaagent/bootstrap/internal/InstrumentationConfig*'
111108
include 'datadog/trace/bootstrap/otel/**'
109+
include 'datadog/trace/bootstrap/otlp/**'
112110

113111
relocate 'io.opentelemetry.api', 'datadog.trace.bootstrap.otel.api'
114112
relocate 'io.opentelemetry.context', 'datadog.trace.bootstrap.otel.context'

dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/OtelInstrumentDescriptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public final class OtelInstrumentDescriptor {
1313
@Nullable private final UTF8BytesString description;
1414
@Nullable private final UTF8BytesString unit;
1515

16-
OtelInstrumentDescriptor(
16+
public OtelInstrumentDescriptor(
1717
String instrumentName,
1818
OtelInstrumentType instrumentType,
1919
boolean longValues,

dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelAggregator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package datadog.trace.bootstrap.otel.metrics.data;
22

3+
import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint;
4+
35
/** Common behaviour shared across all aggregators. */
46
abstract class OtelAggregator {
57
private volatile boolean empty = true;

0 commit comments

Comments
 (0)