Skip to content

Commit 4b6dc92

Browse files
authored
Merge branch 'master' into kr-igor/kafka-lag-spark-streaming
2 parents 4a06b50 + 115998f commit 4b6dc92

File tree

466 files changed

+5220
-1827
lines changed

Some content is hidden

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

466 files changed

+5220
-1827
lines changed

.circleci/config.continue.yml.j2

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ jobs:
500500
- image: << pipeline.parameters.docker_image >>:{{ docker_image_prefix }}<< parameters.testJvm >>
501501

502502
parameters:
503+
environment:
504+
type: string
505+
default: ""
503506
testJvm:
504507
type: string
505508
default: ""
@@ -562,6 +565,7 @@ jobs:
562565
PROFILER_COMMAND="-XX:StartFlightRecording=settings=profile,filename=/tmp/<< parameters.stage >>-<< parameters.testJvm >>.jfr,dumponexit=true"
563566
fi
564567

568+
<< parameters.environment >>
565569
MAVEN_OPTS="-Xms64M -Xmx512M"
566570
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms<< parameters.maxDaemonHeapSize >> -Xmx<< parameters.maxDaemonHeapSize >> $PROFILER_COMMAND -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp' -Ddatadog.forkedMaxHeapSize=768M -Ddatadog.forkedMinHeapSize=128M"
567571
./gradlew
@@ -1244,6 +1248,20 @@ build_test_jobs: &build_test_jobs
12441248
matrix:
12451249
<<: *test_matrix
12461250
1251+
- tests:
1252+
requires:
1253+
- ok_to_test
1254+
name: z_test_<< matrix.testJvm >>_ssi_smoke
1255+
environment: "DD_INJECT_FORCE=true DD_INJECTION_ENABLED=tracer"
1256+
gradleTarget: "stageMainDist :smokeTest"
1257+
gradleParameters: "-PskipFlakyTests"
1258+
stage: smoke
1259+
cacheType: smoke
1260+
parallelism: 4
1261+
maxWorkers: 3
1262+
matrix:
1263+
<<: *test_matrix
1264+
12471265
- tests:
12481266
requires:
12491267
- ok_to_test
@@ -1286,11 +1304,23 @@ build_test_jobs: &build_test_jobs
12861304
maxWorkers: 3
12871305
testJvm: "8"
12881306
1307+
- tests:
1308+
requires:
1309+
- ok_to_test
1310+
name: z_test_8_ssi_smoke
1311+
environment: "DD_INJECT_FORCE=true DD_INJECTION_ENABLED=tracer"
1312+
gradleTarget: "stageMainDist :smokeTest"
1313+
gradleParameters: "-PskipFlakyTests"
1314+
stage: smoke
1315+
cacheType: smoke
1316+
testJvm: "8"
1317+
12891318
- fan_in:
12901319
requires:
12911320
- z_test_<< matrix.testJvm >>_base
12921321
- z_test_<< matrix.testJvm >>_inst
12931322
- z_test_<< matrix.testJvm >>_smoke
1323+
- z_test_<< matrix.testJvm >>_ssi_smoke
12941324
name: test_<< matrix.testJvm >>
12951325
stage: tracing
12961326
matrix:
@@ -1301,6 +1331,7 @@ build_test_jobs: &build_test_jobs
13011331
- z_test_8_base
13021332
- z_test_8_inst
13031333
- z_test_8_smoke
1334+
- z_test_8_ssi_smoke
13041335
name: test_8
13051336
stage: tracing
13061337
testJvm: "8"

.github/workflows/add-assets-to-release.yaml.disabled

Lines changed: 0 additions & 105 deletions
This file was deleted.

.github/workflows/update-download-releases.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
steps:
1111
- name: Update download releases
1212
if: ${{ github.event_name == 'workflow_dispatch' || ( !github.event.release.draft && !github.event.release.prerelease && !startsWith(github.event.release.name, 'download-latest') ) }}
13-
uses: DataDog/download-release-action@ea1f13c0cad08eafeebec8b7d9b2d6ee74efb92a # 0.0.2
13+
uses: DataDog/download-release-action@eeefd56e9d1f0102ad1e6f6c8a170c7bfbc5b613 # 0.0.3

communication/gradle.lockfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ jaxen:jaxen:1.2.0=spotbugs
5555
jline:jline:2.14.6=testRuntimeClasspath
5656
junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath
5757
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
58-
net.bytebuddy:byte-buddy-agent:1.14.16=testCompileClasspath,testRuntimeClasspath
59-
net.bytebuddy:byte-buddy:1.14.16=testCompileClasspath,testRuntimeClasspath
58+
net.bytebuddy:byte-buddy-agent:1.14.18=testCompileClasspath,testRuntimeClasspath
59+
net.bytebuddy:byte-buddy:1.14.18=testCompileClasspath,testRuntimeClasspath
6060
net.jcip:jcip-annotations:1.0=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
6161
net.sf.saxon:Saxon-HE:11.4=spotbugs
6262
org.apache.ant:ant-antlr:1.10.12=testRuntimeClasspath

dd-java-agent/agent-bootstrap/gradle.lockfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jaxen:jaxen:1.2.0=spotbugs
4545
jline:jline:2.14.6=jmhRuntimeClasspath,testRuntimeClasspath
4646
junit:junit-dep:4.11=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
4747
junit:junit:4.13.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
48-
net.bytebuddy:byte-buddy-agent:1.14.16=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
49-
net.bytebuddy:byte-buddy:1.14.16=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
48+
net.bytebuddy:byte-buddy-agent:1.14.18=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
49+
net.bytebuddy:byte-buddy:1.14.18=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
5050
net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath
5151
net.java.dev.jna:jna:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath
5252
net.jcip:jcip-annotations:1.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath

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

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,19 @@ public boolean isEnabledByDefault() {
151151
private static boolean debuggerEnabled = false;
152152
private static boolean agentlessLogSubmissionEnabled = false;
153153

154-
public static void start(final Instrumentation inst, final URL agentJarURL, String agentArgs) {
154+
/**
155+
* Starts the agent; returns a boolean indicating if Agent started successfully
156+
*
157+
* <p>The Agent is considered to start successfully if Instrumentation can be activated. All other
158+
* pieces are considered optional.
159+
*/
160+
public static void start(
161+
final Object bootstrapInitTelemetry,
162+
final Instrumentation inst,
163+
final URL agentJarURL,
164+
final String agentArgs) {
165+
InitializationTelemetry initTelemetry = InitializationTelemetry.proxy(bootstrapInitTelemetry);
166+
155167
StaticEventLogger.begin("Agent");
156168
StaticEventLogger.begin("Agent.start");
157169

@@ -163,8 +175,9 @@ public static void start(final Instrumentation inst, final URL agentJarURL, Stri
163175
remoteConfigEnabled = false;
164176
telemetryEnabled = false;
165177
// apply trace instrumentation, but skip starting other services
166-
startDatadogAgent(inst);
178+
startDatadogAgent(initTelemetry, inst);
167179
StaticEventLogger.end("Agent.start");
180+
168181
return;
169182
}
170183

@@ -279,7 +292,7 @@ public void run() {
279292
* when it will happen after the class transformers were added.
280293
*/
281294
AgentTaskScheduler.initialize();
282-
startDatadogAgent(inst);
295+
startDatadogAgent(initTelemetry, inst);
283296

284297
final EnumSet<Library> libraries = detectLibraries(log);
285298

@@ -326,7 +339,7 @@ public void run() {
326339
* logging facility. Likewise on IBM JDKs OkHttp may indirectly load 'IBMSASL' which in turn loads LogManager.
327340
*/
328341
InstallDatadogTracerCallback installDatadogTracerCallback =
329-
new InstallDatadogTracerCallback(inst);
342+
new InstallDatadogTracerCallback(initTelemetry, inst);
330343
if (delayOkHttp) {
331344
log.debug("Custom logger detected. Delaying Datadog Tracer initialization.");
332345
registerLogManagerCallback(installDatadogTracerCallback);
@@ -397,10 +410,10 @@ public static synchronized Class<?> installAgentCLI() throws Exception {
397410
}
398411

399412
/** Used by AgentCLI to send sample traces from the command-line. */
400-
public static void startDatadogTracer() throws Exception {
413+
public static void startDatadogTracer(InitializationTelemetry initTelemetry) throws Exception {
401414
Class<?> scoClass =
402415
AGENT_CLASSLOADER.loadClass("datadog.communication.ddagent.SharedCommunicationObjects");
403-
installDatadogTracer(scoClass, scoClass.getConstructor().newInstance());
416+
installDatadogTracer(initTelemetry, scoClass, scoClass.getConstructor().newInstance());
404417
startJmx(); // send runtime metrics along with the traces
405418
}
406419

@@ -475,9 +488,12 @@ public void execute() {
475488
}
476489

477490
protected static class InstallDatadogTracerCallback extends ClassLoadCallBack {
491+
private final InitializationTelemetry initTelemetry;
478492
private final Instrumentation instrumentation;
479493

480-
public InstallDatadogTracerCallback(Instrumentation instrumentation) {
494+
public InstallDatadogTracerCallback(
495+
InitializationTelemetry initTelemetry, Instrumentation instrumentation) {
496+
this.initTelemetry = initTelemetry;
481497
this.instrumentation = instrumentation;
482498
}
483499

@@ -502,7 +518,7 @@ public void execute() {
502518
throw new UndeclaredThrowableException(e);
503519
}
504520

505-
installDatadogTracer(scoClass, sco);
521+
installDatadogTracer(initTelemetry, scoClass, sco);
506522
maybeStartAppSec(scoClass, sco);
507523
maybeStartIast(scoClass, sco);
508524
maybeStartCiVisibility(instrumentation, scoClass, sco);
@@ -582,9 +598,9 @@ private static void maybeStartRemoteConfig(Class<?> scoClass, Object sco) {
582598
StaticEventLogger.end("Remote Config");
583599
}
584600

585-
private static synchronized void startDatadogAgent(final Instrumentation inst) {
601+
private static synchronized void startDatadogAgent(
602+
final InitializationTelemetry initTelemetry, final Instrumentation inst) {
586603
if (null != inst) {
587-
588604
StaticEventLogger.begin("BytebuddyAgent");
589605

590606
try {
@@ -595,13 +611,15 @@ private static synchronized void startDatadogAgent(final Instrumentation inst) {
595611
agentInstallerMethod.invoke(null, inst);
596612
} catch (final Throwable ex) {
597613
log.error("Throwable thrown while installing the Datadog Agent", ex);
614+
initTelemetry.onFatalError(ex);
615+
} finally {
616+
StaticEventLogger.end("BytebuddyAgent");
598617
}
599-
600-
StaticEventLogger.end("BytebuddyAgent");
601618
}
602619
}
603620

604-
private static synchronized void installDatadogTracer(Class<?> scoClass, Object sco) {
621+
private static synchronized void installDatadogTracer(
622+
InitializationTelemetry initTelemetry, Class<?> scoClass, Object sco) {
605623
if (AGENT_CLASSLOADER == null) {
606624
throw new IllegalStateException("Datadog agent should have been started already");
607625
}
@@ -622,6 +640,8 @@ private static synchronized void installDatadogTracer(Class<?> scoClass, Object
622640
throw ex;
623641
} catch (final Throwable ex) {
624642
log.error("Throwable thrown while installing the Datadog Tracer", ex);
643+
644+
initTelemetry.onFatalError(ex);
625645
}
626646

627647
StaticEventLogger.end("GlobalTracer");

0 commit comments

Comments
 (0)