Skip to content

Commit 982d17d

Browse files
authored
Merge branch 'master' into nicholas.hulston/lambda-eventbridge-tracing-fix
2 parents 00be0b8 + 043adb2 commit 982d17d

File tree

928 files changed

+11471
-13936
lines changed

Some content is hidden

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

928 files changed

+11471
-13936
lines changed

.circleci/config.continue.yml.j2

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ parameters:
5454
global_pattern:
5555
# Pattern for files that should always trigger a test jobs
5656
type: string
57-
default: "^build.gradle$|^settings.gradle$|^gradle.properties$|^buildSrc/|^gradle/|.circleci"
57+
default: "^build.gradle$|^settings.gradle$|^gradle.properties$|^buildSrc/|^gradle/|.circleci|^gradlew|^mvnw|^.mvn/"
5858

5959
docker_image:
6060
type: string
@@ -660,7 +660,8 @@ jobs:
660660
- DD_POOL_TRACE_CHECK_FAILURES=true
661661
- DD_DISABLE_ERROR_RESPONSES=true
662662
- ENABLED_CHECKS=trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
663-
resource_class: xlarge
663+
# TODO: merge xlarge_tests and tests? or rename this?
664+
resource_class: large
664665

665666

666667
# The only way to do fan-in in CircleCI seems to have a proper job, so let's have one that
@@ -1099,8 +1100,8 @@ build_test_jobs: &build_test_jobs
10991100
triggeredBy: *instrumentation_modules
11001101
stage: instrumentation
11011102
cacheType: inst
1102-
parallelism: 4
1103-
maxWorkers: 4
1103+
parallelism: 12
1104+
maxWorkers: 3
11041105
matrix:
11051106
<<: *test_matrix
11061107
@@ -1113,8 +1114,8 @@ build_test_jobs: &build_test_jobs
11131114
triggeredBy: *instrumentation_modules
11141115
stage: instrumentation
11151116
cacheType: inst
1116-
parallelism: 4
1117-
maxWorkers: 4
1117+
parallelism: 12
1118+
maxWorkers: 3
11181119
testJvm: "8"
11191120
11201121
- xlarge_tests:
@@ -1127,8 +1128,8 @@ build_test_jobs: &build_test_jobs
11271128
triggeredBy: *instrumentation_modules
11281129
stage: instrumentation
11291130
cacheType: latestdep
1130-
parallelism: 4
1131-
maxWorkers: 4
1131+
parallelism: 12
1132+
maxWorkers: 3
11321133
testJvm: "8"
11331134
11341135
- xlarge_tests:
@@ -1141,8 +1142,8 @@ build_test_jobs: &build_test_jobs
11411142
triggeredBy: *instrumentation_modules
11421143
stage: instrumentation
11431144
cacheType: latestdep
1144-
parallelism: 4
1145-
maxWorkers: 4
1145+
parallelism: 12
1146+
maxWorkers: 3
11461147
testJvm: "17"
11471148
11481149
- xlarge_tests:
@@ -1155,8 +1156,8 @@ build_test_jobs: &build_test_jobs
11551156
triggeredBy: *instrumentation_modules
11561157
stage: instrumentation
11571158
cacheType: latestdep
1158-
parallelism: 4
1159-
maxWorkers: 4
1159+
parallelism: 12
1160+
maxWorkers: 3
11601161
testJvm: "21"
11611162
11621163
{% if flaky %}
@@ -1184,7 +1185,7 @@ build_test_jobs: &build_test_jobs
11841185
triggeredBy: *instrumentation_modules
11851186
stage: instrumentation
11861187
cacheType: inst
1187-
parallelism: 2
1188+
parallelism: 12
11881189
maxWorkers: 4
11891190
testJvm: "8"
11901191

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ dd-java-agent/instrumentation/*iast* @DataDog/asm-java
4545
dd-java-agent/instrumentation/*appsec* @DataDog/asm-java
4646
dd-java-agent/instrumentation/json/ @DataDog/asm-java
4747
dd-java-agent/instrumentation/snakeyaml/ @DataDog/asm-java
48+
dd-java-agent/instrumentation/velocity/ @DataDog/asm-java
4849
dd-java-agent/instrumentation/freemarker/ @DataDog/asm-java
4950
dd-smoke-tests/iast-util/ @DataDog/asm-java
5051
dd-smoke-tests/spring-security/ @DataDog/asm-java
@@ -54,6 +55,9 @@ dd-java-agent/instrumentation/spring-security-5/ @DataDog/asm-java
5455
**/iast/ @DataDog/asm-java
5556
**/Iast*.java @DataDog/asm-java
5657
**/Iast*.groovy @DataDog/asm-java
58+
**/rasp/ @Datadog/asm-java
59+
**/*Rasp*.java @DataDog/asm-java
60+
**/*Rasp*.groovy @DataDog/asm-java
5761

5862
# @DataDog/data-jobs-monitoring
5963
dd-java-agent/instrumentation/spark/ @DataDog/data-jobs-monitoring

.gitlab-ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ package-oci:
216216
onboarding_tests_installer:
217217
parallel:
218218
matrix:
219-
- ONBOARDING_FILTER_WEBLOG: [test-app-java, test-app-java-container, test-app-java-container-jdk15, test-app-java-alpine-libgcc, test-app-java-buildpack]
219+
- ONBOARDING_FILTER_WEBLOG: [test-app-java, test-app-java-container, test-app-java-container-jdk15, test-app-java-alpine-libgcc]
220+
SCENARIO: [ SIMPLE_INSTALLER_AUTO_INJECTION, SIMPLE_AUTO_INJECTION_PROFILING ]
221+
- ONBOARDING_FILTER_WEBLOG: [test-app-java-buildpack]
222+
SCENARIO: [ SIMPLE_INSTALLER_AUTO_INJECTION ]
220223

221224
onboarding_tests_k8s_injection:
222225
variables:
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import java.io.*;
17+
import java.net.*;
18+
import java.nio.channels.*;
19+
import java.util.Properties;
20+
21+
public class MavenWrapperDownloader {
22+
23+
private static final String WRAPPER_VERSION = "0.5.6";
24+
/** Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. */
25+
private static final String DEFAULT_DOWNLOAD_URL =
26+
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
27+
+ WRAPPER_VERSION
28+
+ "/maven-wrapper-"
29+
+ WRAPPER_VERSION
30+
+ ".jar";
31+
32+
/**
33+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use
34+
* instead of the default one.
35+
*/
36+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
37+
".mvn/wrapper/maven-wrapper.properties";
38+
39+
/** Path where the maven-wrapper.jar will be saved to. */
40+
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";
41+
42+
/**
43+
* Name of the property which should be used to override the default download url for the wrapper.
44+
*/
45+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
46+
47+
public static void main(String args[]) {
48+
System.out.println("- Downloader started");
49+
File baseDirectory = new File(args[0]);
50+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
51+
52+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
53+
// wrapperUrl parameter.
54+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
55+
String url = DEFAULT_DOWNLOAD_URL;
56+
if (mavenWrapperPropertyFile.exists()) {
57+
FileInputStream mavenWrapperPropertyFileInputStream = null;
58+
try {
59+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
60+
Properties mavenWrapperProperties = new Properties();
61+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
62+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
63+
} catch (IOException e) {
64+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
65+
} finally {
66+
try {
67+
if (mavenWrapperPropertyFileInputStream != null) {
68+
mavenWrapperPropertyFileInputStream.close();
69+
}
70+
} catch (IOException e) {
71+
// Ignore ...
72+
}
73+
}
74+
}
75+
System.out.println("- Downloading from: " + url);
76+
77+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
78+
if (!outputFile.getParentFile().exists()) {
79+
if (!outputFile.getParentFile().mkdirs()) {
80+
System.out.println(
81+
"- ERROR creating output directory '"
82+
+ outputFile.getParentFile().getAbsolutePath()
83+
+ "'");
84+
}
85+
}
86+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
87+
try {
88+
downloadFileFromURL(url, outputFile);
89+
System.out.println("Done");
90+
System.exit(0);
91+
} catch (Throwable e) {
92+
System.out.println("- Error downloading");
93+
e.printStackTrace();
94+
System.exit(1);
95+
}
96+
}
97+
98+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
99+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
100+
String username = System.getenv("MVNW_USERNAME");
101+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
102+
Authenticator.setDefault(
103+
new Authenticator() {
104+
@Override
105+
protected PasswordAuthentication getPasswordAuthentication() {
106+
return new PasswordAuthentication(username, password);
107+
}
108+
});
109+
}
110+
URL website = new URL(urlString);
111+
ReadableByteChannel rbc;
112+
rbc = Channels.newChannel(website.openStream());
113+
FileOutputStream fos = new FileOutputStream(destination);
114+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
115+
fos.close();
116+
rbc.close();
117+
}
118+
}

.mvn/wrapper/maven-wrapper.jar

49.5 KB
Binary file not shown.
Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,2 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.
17-
wrapperVersion=3.3.2
18-
distributionType=only-script
19-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ commons-fileupload:commons-fileupload:1.5=jmhRuntimeClasspath,testCompileClasspa
3939
commons-io:commons-io:2.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
4040
de.thetaphi:forbiddenapis:3.1=compileClasspath,jmhCompileClasspath
4141
info.picocli:picocli:4.6.3=jmhRuntimeClasspath,testRuntimeClasspath
42-
io.sqreen:libsqreen:11.0.0=jmhRuntimeClasspath,testRuntimeClasspath
42+
io.sqreen:libsqreen:11.0.1=jmhRuntimeClasspath,testRuntimeClasspath
4343
javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
4444
jaxen:jaxen:1.2.0=spotbugs
4545
jline:jline:2.14.6=jmhRuntimeClasspath,testRuntimeClasspath

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ private enum AgentFeature {
103103
USM(propertyNameToSystemPropertyName(UsmConfig.USM_ENABLED), false),
104104
TELEMETRY(propertyNameToSystemPropertyName(GeneralConfig.TELEMETRY_ENABLED), true),
105105
DEBUGGER(propertyNameToSystemPropertyName(DebuggerConfig.DEBUGGER_ENABLED), false),
106+
EXCEPTION_DEBUGGING(
107+
propertyNameToSystemPropertyName(DebuggerConfig.EXCEPTION_REPLAY_ENABLED), false),
106108
DATA_JOBS(propertyNameToSystemPropertyName(GeneralConfig.DATA_JOBS_ENABLED), false),
107109
AGENTLESS_LOG_SUBMISSION(
108110
propertyNameToSystemPropertyName(GeneralConfig.AGENTLESS_LOG_SUBMISSION_ENABLED), false);
@@ -149,6 +151,7 @@ public boolean isEnabledByDefault() {
149151
private static boolean usmEnabled = false;
150152
private static boolean telemetryEnabled = true;
151153
private static boolean debuggerEnabled = false;
154+
private static boolean exceptionDebuggingEnabled = false;
152155
private static boolean agentlessLogSubmissionEnabled = false;
153156

154157
/**
@@ -259,6 +262,7 @@ public static void start(
259262
cwsEnabled = isFeatureEnabled(AgentFeature.CWS);
260263
telemetryEnabled = isFeatureEnabled(AgentFeature.TELEMETRY);
261264
debuggerEnabled = isFeatureEnabled(AgentFeature.DEBUGGER);
265+
exceptionDebuggingEnabled = isFeatureEnabled(AgentFeature.EXCEPTION_DEBUGGING);
262266
agentlessLogSubmissionEnabled = isFeatureEnabled(AgentFeature.AGENTLESS_LOG_SUBMISSION);
263267

264268
if (profilingEnabled) {
@@ -1069,7 +1073,7 @@ private static void shutdownProfilingAgent(final boolean sync) {
10691073
}
10701074

10711075
private static void maybeStartDebugger(Instrumentation inst, Class<?> scoClass, Object sco) {
1072-
if (!debuggerEnabled) {
1076+
if (!debuggerEnabled && !exceptionDebuggingEnabled) {
10731077
return;
10741078
}
10751079
if (!remoteConfigEnabled) {

0 commit comments

Comments
 (0)