Skip to content

Commit 9ac990b

Browse files
committed
Merge remote-tracking branch 'origin/master' into vandonr/jdbc-ff
2 parents 4a1d0cb + 52a8cc7 commit 9ac990b

File tree

100 files changed

+2073
-653
lines changed

Some content is hidden

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

100 files changed

+2073
-653
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject: repo:DataDog/dd-trace-java:ref:refs/(heads/master|tags/v[0-9]+.[0-9]+.0)
4+
5+
claim_pattern:
6+
event_name: (push|workflow_dispatch)
7+
ref: refs/(heads/master|tags/v[0-9]+\.[0-9]+\.0)
8+
ref_protected: "true"
9+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/create-release-branch\.yaml@refs/heads/master
10+
11+
permissions:
12+
contents: write
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Create Release Branch and Pin System-Tests
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.0' # Trigger on minor release tags (e.g. v1.54.0)
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'The minor release tag (e.g. v1.54.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
create-release-branch:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
id-token: write # Required for OIDC token federation
20+
steps:
21+
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
22+
id: octo-sts
23+
with:
24+
scope: DataDog/dd-trace-java
25+
policy: self.update-system-tests.push
26+
27+
- name: Determine tag
28+
id: determine-tag
29+
run: |
30+
if [ -n "${{ github.event.inputs.tag }}" ]; then
31+
TAG=${{ github.event.inputs.tag }}
32+
else
33+
TAG=${GITHUB_REF#refs/tags/}
34+
fi
35+
if ! [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.0$ ]]; then
36+
echo "Error: Tag $TAG is not in the expected format: vX.Y.0"
37+
exit 1
38+
fi
39+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
40+
41+
- name: Define branch name from tag
42+
id: define-branch
43+
run: |
44+
TAG=${{ steps.determine-tag.outputs.tag }}
45+
BRANCH="release/${TAG%.0}.x"
46+
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
47+
48+
- name: Checkout dd-trace-java
49+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
50+
51+
- name: Check if branch already exists
52+
id: check-branch
53+
run: |
54+
BRANCH=${{ steps.define-branch.outputs.branch }}
55+
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
56+
echo "creating_new_branch=false" >> "$GITHUB_OUTPUT"
57+
echo "Branch $BRANCH already exists - skipping following steps"
58+
else
59+
echo "creating_new_branch=true" >> "$GITHUB_OUTPUT"
60+
echo "Branch $BRANCH does not exist - proceeding with following steps"
61+
fi
62+
63+
- name: Update system-tests references to latest commit SHA on main
64+
if: steps.check-branch.outputs.creating_new_branch == 'true'
65+
run: BRANCH=main ./tooling/update_system_test_reference.sh
66+
67+
- name: Commit changes
68+
if: steps.check-branch.outputs.creating_new_branch == 'true'
69+
id: create-commit
70+
run: |
71+
git config user.name "github-actions[bot]"
72+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
73+
git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml
74+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
75+
76+
- name: Push changes
77+
if: steps.check-branch.outputs.creating_new_branch == 'true'
78+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
79+
with:
80+
token: "${{ steps.octo-sts.outputs.token }}"
81+
branch: "${{ steps.define-branch.outputs.branch }}"
82+
branch-from: "${{ github.sha }}"
83+
command: push
84+
commits: "${{ steps.create-commit.outputs.commit }}"

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ jobs:
6060
main:
6161
needs:
6262
- build
63-
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main
63+
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
64+
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned for releases only
6465
secrets: inherit
6566
permissions:
6667
contents: read
6768
id-token: write
6869
packages: write
6970
with:
7071
library: java
72+
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
73+
ref: main # system tests are pinned for releases only
7174
binaries_artifact: binaries
7275
desired_execution_time: 900 # 15 minutes
7376
scenarios_groups: tracer-release

.gitlab-ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include:
33
- local: ".gitlab/benchmarks.yml"
44
- local: ".gitlab/macrobenchmarks.yml"
55
- local: ".gitlab/exploration-tests.yml"
6-
- local: ".gitlab/ci-visibility-tests.yml"
6+
# - local: ".gitlab/ci-visibility-tests.yml"
77

88
stages:
99
- build
@@ -167,15 +167,14 @@ default:
167167
before_script:
168168
- source .gitlab/gitlab-utils.sh
169169
# Akka token added to SSM from https://account.akka.io/token
170-
- export AKKA_REPO_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.akka_repo_token --with-decryption --query "Parameter.Value" --out text)
170+
- export ORG_GRADLE_PROJECT_akkaRepositoryToken=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.akka_repo_token --with-decryption --query "Parameter.Value" --out text)
171171
- mkdir -p .gradle
172172
- export GRADLE_USER_HOME=$(pwd)/.gradle
173173
- |
174174
# Don't put jvm args here as it will be picked up by child gradle processes used in tests
175175
cat << EOF > $GRADLE_USER_HOME/gradle.properties
176176
mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY
177177
gradlePluginProxy=$GRADLE_PLUGIN_PROXY
178-
akkaRepositoryToken=$AKKA_REPO_TOKEN
179178
EOF
180179
- |
181180
# replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties
@@ -727,7 +726,7 @@ test_smoke_graalvm:
727726
NON_DEFAULT_JVMS: "true"
728727
parallel:
729728
matrix:
730-
- testJvm: ["graalvm17", "graalvm21"]
729+
- testJvm: ["graalvm17", "graalvm21", "graalvm25"]
731730

732731
test_smoke_semeru8_debugger:
733732
extends: .test_job

.gitlab/ci-visibility-tests.yml

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,77 @@
1-
run-ci-visibility-test-environment:
2-
stage: ci-visibility-tests
3-
when: manual
4-
needs: []
5-
trigger:
6-
project: DataDog/apm-reliability/test-environment
7-
branch: main
8-
strategy: depend
9-
variables:
10-
UPSTREAM_PACKAGE_JOB: build
11-
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
12-
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
13-
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
14-
UPSTREAM_BRANCH: $CI_COMMIT_BRANCH
15-
UPSTREAM_TAG: $CI_COMMIT_TAG
16-
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
17-
UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
18-
TRACER_LANG: java
19-
JAVA_TRACER_REF_TO_TEST: $CI_COMMIT_BRANCH
1+
#check-ci-visibility-label:
2+
# stage: publish
3+
# image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
4+
# tags: [ "arch:amd64" ]
5+
# needs: [ publish-artifacts-to-s3 ]
6+
# id_tokens:
7+
# DDOCTOSTS_ID_TOKEN:
8+
# aud: dd-octo-sts
9+
# rules:
10+
# # - if: '$POPULATE_CACHE'
11+
# # when: never
12+
# # - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(master|release\/)/'
13+
# # when: on_success
14+
# - when: never
15+
# before_script:
16+
# - dd-octo-sts version
17+
# - dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.github-access.read
18+
# - dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.github-access.read > github-token.txt
19+
# - gh auth login --with-token < github-token.txt
20+
# script:
21+
# - |
22+
# # Source utility functions
23+
# source .gitlab/ci_visibility_utils.sh
24+
#
25+
# # Get PR number
26+
# if ! PR_NUMBER=$(get_pr_number "${CI_COMMIT_BRANCH}"); then
27+
# echo "No open PR found for branch ${CI_COMMIT_BRANCH}"
28+
# exit 1
29+
# fi
30+
#
31+
# echo "Found PR #${PR_NUMBER}"
32+
#
33+
# # Check if PR has the CI visibility label
34+
# if pr_has_label "$PR_NUMBER" "comp: ci visibility"; then
35+
# echo "PR_NUMBER=${PR_NUMBER}" > pr.env
36+
# echo "PR #${PR_NUMBER} detected as CI Visibility PR"
37+
# exit 0
38+
# else
39+
# echo "PR #${PR_NUMBER} not a CI Visibility PR, ignoring trigger"
40+
# exit 1
41+
# fi
42+
# after_script:
43+
# - dd-octo-sts revoke -t $(cat github-token.txt) || true
44+
# artifacts:
45+
# reports:
46+
# dotenv: pr.env
47+
# allow_failure: true
48+
# retry:
49+
# max: 2
50+
# when: always
51+
#
52+
#run-ci-visibility-test-environment:
53+
# stage: ci-visibility-tests
54+
# needs:
55+
# - job: check-ci-visibility-label
56+
# artifacts: true
57+
# rules:
58+
# - if: '$POPULATE_CACHE'
59+
# when: never
60+
# - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(master|release\/)/'
61+
# when: on_success
62+
# trigger:
63+
# project: DataDog/apm-reliability/test-environment
64+
# branch: main
65+
# strategy: depend
66+
# variables:
67+
# UPSTREAM_PACKAGE_JOB: build
68+
# UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
69+
# UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
70+
# UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
71+
# UPSTREAM_BRANCH: $CI_COMMIT_BRANCH
72+
# UPSTREAM_TAG: $CI_COMMIT_TAG
73+
# UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
74+
# UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
75+
# TRACER_LANG: java
76+
# JAVA_TRACER_REF_TO_TEST: $CI_COMMIT_BRANCH
77+
# JAVA_TRACER_PR_TO_TEST: $PR_NUMBER

.gitlab/ci_visibility_utils.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
3+
function get_pr_number() {
4+
local branch=$1
5+
6+
if [ -z "$branch" ]; then
7+
echo "Error: Branch name is required" >&2
8+
return 1
9+
fi
10+
11+
local pr_number
12+
pr_number=$(gh pr list --repo DataDog/dd-trace-java --head "$branch" --state open --json number --jq '.[0].number')
13+
14+
if [ -z "$pr_number" ]; then
15+
echo "Error: No open PR found for branch $branch" >&2
16+
return 1
17+
fi
18+
19+
echo "$pr_number"
20+
return 0
21+
}
22+
23+
function get_pr_labels() {
24+
local pr_number=$1
25+
26+
if [ -z "$pr_number" ]; then
27+
echo "Error: PR number is required" >&2
28+
return 1
29+
fi
30+
31+
local labels
32+
labels=$(gh pr view "$pr_number" --repo DataDog/dd-trace-java --json labels --jq '.labels[].name')
33+
34+
if [ -z "$labels" ]; then
35+
echo "Warning: No labels found for PR #$pr_number" >&2
36+
return 1
37+
fi
38+
39+
echo "$labels"
40+
return 0
41+
}
42+
43+
function pr_has_label() {
44+
local pr_number=$1
45+
local target_label=$2
46+
47+
if [ -z "$pr_number" ] || [ -z "$target_label" ]; then
48+
echo "Error: PR number and label are required" >&2
49+
return 1
50+
fi
51+
52+
local labels
53+
if ! labels=$(get_pr_labels "$pr_number"); then
54+
return 1
55+
fi
56+
57+
if echo "$labels" | grep -q "$target_label"; then
58+
return 0
59+
else
60+
return 1
61+
fi
62+
}

BUILDING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This documentation provides information for developers to set up their environme
88
* [Install the required JDKs](#install-the-required-jdks)
99
* [Install git](#install-git)
1010
* [Install Docker Desktop](#install-docker-desktop)
11+
* [Configure Akka Token](#configure-akka-token)
1112
* [Clone the repository and set up git](#clone-the-repository-and-set-up-git)
1213
* [Building the project](#building-the-project)
1314

@@ -248,6 +249,18 @@ winget install --id Docker.DockerDesktop
248249
> [!NOTE]
249250
> Both git configurations (hooks and submodule) will only be applied to this project and won't apply globally in your setup.
250251

252+
### Configure Akka Token
253+
> [!NOTE]
254+
> You can skip this step if you don’t need instrumentation for the **akka-http-10.6** module.
255+
> For background on why Akka now requires authentication, see this [article](https://akka.io/blog/why-we-are-changing-the-license-for-akka).
256+
257+
To enable access to Akka artifacts hosted on Lightbend’s private repository, you’ll need to configure an authentication token.
258+
1. Obtain a repository token. Visit the Akka account [page](https://account.akka.io/token) to generate a secure repository token.
259+
2. Set up the environment variable. Create an environment variable named:
260+
```shell
261+
ORG_GRADLE_PROJECT_akkaRepositoryToken=<your_token>
262+
```
263+
251264
## Building the project
252265

253266
After everything is properly set up, you can move on to the next section to start a build or check [the contribution guidelines](CONTRIBUTING.md).

communication/src/main/java/datadog/communication/monitor/DDAgentStatsDConnection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ private void doConnect() {
162162
log.debug("StatsD connected to {}", statsDAddress());
163163
}
164164
} catch (final Exception e) {
165-
log.error("Unable to create StatsD client - {}", statsDAddress(), e);
166165
if (retries.getAndIncrement() < MAX_RETRIES) {
167166
if (log.isDebugEnabled()) {
168167
log.debug(
@@ -173,6 +172,8 @@ private void doConnect() {
173172
} else {
174173
log.debug("Max retries have been reached. Will not attempt again.");
175174
}
175+
} catch (Throwable t) {
176+
log.error("Unable to create StatsD client - {} - Will not retry", statsDAddress(), t);
176177
}
177178
}
178179
}
@@ -186,7 +187,7 @@ private void discoverConnectionSettings() {
186187

187188
if (null == host) {
188189
if (!OperatingSystem.isWindows() && new File(DEFAULT_DOGSTATSD_SOCKET_PATH).exists()) {
189-
log.info("Detected {}. Using it to send StatsD data.", DEFAULT_DOGSTATSD_SOCKET_PATH);
190+
log.info("Detected {}. Using it to send StatsD data.", DEFAULT_DOGSTATSD_SOCKET_PATH);
190191
host = DEFAULT_DOGSTATSD_SOCKET_PATH;
191192
port = 0; // tells dogstatsd client to treat host as a socket path
192193
} else {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ dependencies {
2727
api project(':components:json')
2828
api libs.slf4j
2929
// ^ Generally a bad idea for libraries, but we're shadowing.
30+
api(variantOf(libs.instrumentjava, { classifier("all") })) {
31+
transitive = false
32+
}
3033

3134
testImplementation project(':dd-java-agent:testing')
3235
}

0 commit comments

Comments
 (0)