Skip to content

Commit e76e1ad

Browse files
authored
Merge branch 'master' into alejandro.gonzalez/fix-request-body-type-endpint
2 parents 6a44b26 + d6b43cb commit e76e1ad

File tree

15 files changed

+232
-41
lines changed

15 files changed

+232
-41
lines changed

.github/workflows/update-docker-build-image.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,7 @@ jobs:
2626

2727
- name: Checkout the repository
2828
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29-
- name: Download ghcommit CLI
30-
run: |
31-
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
32-
chmod +x /usr/local/bin/ghcommit
33-
- name: Pick a branch name
34-
id: define-branch
35-
run: echo "branch=ci/update-docker-build-image-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
36-
- name: Create branch
37-
run: |
38-
git checkout -b ${{ steps.define-branch.outputs.branch }}
39-
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
40-
- name: Define the Docker build image tage to use
29+
- name: Define the Docker build image tag to use
4130
id: define-tag
4231
run: |
4332
if [ -n "${{ github.event.inputs.tag }}" ]; then
@@ -59,12 +48,38 @@ jobs:
5948
- name: Update the Docker build image in GitLab CI config
6049
run: |
6150
sed -i -E 's|(BUILDER_IMAGE_VERSION_PREFIX:)[^#]*([#].*)|\1 "${{ steps.define-tag.outputs.tag }}-" \2|' .gitlab-ci.yml
51+
- name: Check if changes should be committed
52+
id: check-changes
53+
run: |
54+
if [[ -z "$(git status -s)" ]]; then
55+
echo "No changes to commit, exiting."
56+
echo "commit_changes=false" >> "$GITHUB_OUTPUT"
57+
exit 0
58+
else
59+
echo "commit_changes=true" >> "$GITHUB_OUTPUT"
60+
fi
61+
- name: Download ghcommit CLI
62+
if: steps.check-changes.outputs.commit_changes == 'true'
63+
run: |
64+
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
65+
chmod +x /usr/local/bin/ghcommit
66+
- name: Pick a branch name
67+
if: steps.check-changes.outputs.commit_changes == 'true'
68+
id: define-branch
69+
run: echo "branch=ci/update-docker-build-image-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
70+
- name: Create branch
71+
if: steps.check-changes.outputs.commit_changes == 'true'
72+
run: |
73+
git checkout -b ${{ steps.define-branch.outputs.branch }}
74+
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
6275
- name: Commit and push changes
76+
if: steps.check-changes.outputs.commit_changes == 'true'
6377
env:
6478
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}
6579
run: |
6680
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add .gitlab-ci.yml --message "feat(ci): Update Docker build image"
6781
- name: Create pull request
82+
if: steps.check-changes.outputs.commit_changes == 'true'
6883
env:
6984
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
7085
run: |

.github/workflows/update-jmxfetch-submodule.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,37 @@ jobs:
2424
- name: Update Submodule
2525
run: |
2626
git submodule update --remote -- dd-java-agent/agent-jmxfetch/integrations-core
27+
- name: Check if changes should be committed
28+
id: check-changes
29+
run: |
30+
if [[ -z "$(git status -s)" ]]; then
31+
echo "No changes to commit, exiting."
32+
echo "commit_changes=false" >> "$GITHUB_OUTPUT"
33+
exit 0
34+
else
35+
echo "commit_changes=true" >> "$GITHUB_OUTPUT"
36+
fi
2737
- name: Pick a branch name
38+
if: steps.check-changes.outputs.commit_changes == 'true'
2839
id: define-branch
2940
run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
3041
- name: Create branch
42+
if: steps.check-changes.outputs.commit_changes == 'true'
3143
run: |
3244
git checkout -b ${{ steps.define-branch.outputs.branch }}
3345
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
3446
- name: Commit and push changes
47+
if: steps.check-changes.outputs.commit_changes == 'true'
3548
env:
3649
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}
3750
run: |
3851
git config user.name "github-actions[bot]"
3952
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
40-
if [[ -z "$(git status -s)" ]]; then
41-
echo "No changes to commit, exiting."
42-
exit 0;
43-
fi
44-
git checkout -b ${{ steps.define-branch.outputs.branch }}
4553
git add dd-java-agent/agent-jmxfetch/integrations-core
4654
git commit -m "Update agent-jmxfetch submodule"
4755
git push origin ${{ steps.define-branch.outputs.branch }}
4856
- name: Create pull request
57+
if: steps.check-changes.outputs.commit_changes == 'true'
4958
env:
5059
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
5160
run: |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kotlin version: 2.0.21
2+
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
3+
1. Kotlin compile daemon is ready
4+

buildSrc/src/test/groovy/CallSiteInstrumentationPluginTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CallSiteInstrumentationPluginTest extends Specification {
2828
2929
dependencies {
3030
implementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.17.5'
31-
implementation group: 'com.google.auto.service', name: 'auto-service-annotations', version: '1.0-rc7'
31+
implementation group: 'com.google.auto.service', name: 'auto-service-annotations', version: '1.1.1'
3232
}
3333
'''
3434

dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ class AbstractGradleTest extends CiVisibilitySmokeTest {
9393

9494
private static boolean isSupported(ComparableVersion gradleVersion) {
9595
// https://docs.gradle.org/current/userguide/compatibility.html
96-
// TODO: Fix for Java 25. Add a new condition for Java 25 when it is supported by Gradle.
97-
if (Jvm.current.isJavaVersionCompatible(24)) {
96+
if (Jvm.current.isJavaVersionCompatible(25)) {
97+
return gradleVersion.compareTo(new ComparableVersion("9.1")) >= 0
98+
} else if (Jvm.current.isJavaVersionCompatible(24)) {
9899
return gradleVersion.compareTo(new ComparableVersion("8.14")) >= 0
99100
} else if (Jvm.current.java21Compatible) {
100101
return gradleVersion.compareTo(new ComparableVersion("8.4")) >= 0

dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ import spock.lang.TempDir
2323
import java.nio.file.Files
2424
import java.nio.file.Path
2525

26-
@IgnoreIf(reason = "TODO: Fix for Java 25. Gradle does not support Java 25 yet: https://docs.gradle.org/current/userguide/compatibility.html#java_runtime", value = {
27-
JavaVirtualMachine.isJavaVersionAtLeast(25)
28-
})
2926
class GradleDaemonSmokeTest extends AbstractGradleTest {
3027

3128
private static final String TEST_SERVICE_NAME = "test-gradle-service"

dd-smoke-tests/log-injection/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ plugins {
44
id 'com.gradleup.shadow'
55
}
66

7-
ext {
8-
// TODO: Fix for Java 25. Gradle Test Executor failed. Update givenGradleVersionIsCompatibleWithCurrentJvm() when Gradle releases Java 25 support: https://docs.gradle.org/current/userguide/compatibility.html#java_runtime
9-
maxJavaVersionForTests = JavaVersion.VERSION_24
10-
}
11-
127
apply from: "$rootDir/gradle/java.gradle"
138
description = 'Log injection Smoke Tests.'
149

@@ -357,6 +352,11 @@ generateTestingJar('Flogger', 'Slf4jToLogbackLatest',
357352

358353
tasks.withType(Test).configureEach {
359354
dependsOn tasks.withType(ShadowJar)
355+
356+
// Runtime.getRuntime().availableProcessors() is used to scale the parallelism by default,
357+
// but it returns weird values in Gitlab/kubernetes, so fix to a specific value when available
358+
def override = System.getenv("RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE")
359+
maxParallelForks = override?.toInteger() ?: Math.max(1, (Runtime.runtime.availableProcessors() / 2).toInteger())
360360
}
361361

362362

dd-smoke-tests/log-injection/src/test/resources/SpockConfig.groovy

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

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spock = "2.3-groovy-3.0"
1010
spock24 = "2.4-M6-groovy-3.0"
1111
groovy = "3.0.24"
1212
junit5 = "5.9.2"
13-
logback = "1.2.3"
13+
logback = "1.2.13"
1414
bytebuddy = "1.17.5"
1515
scala = "2.11.12" # Last version to support Java 7 (2.12+ require Java 8+)
1616
scala211 = "2.11.12"
@@ -29,7 +29,7 @@ jctools = '3.3.0'
2929
moshi = '1.11.0'
3030
testcontainers = '1.20.1'
3131
jmc = "8.1.0"
32-
autoservice = "1.0-rc7"
32+
autoservice = "1.1.1"
3333
ddprof = "1.29.0"
3434
asm = "9.8"
3535
cafe_crypto = "0.1.0"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package datadog.trace.api.telemetry;
2+
3+
import java.util.ArrayList;
4+
import java.util.Collection;
5+
import java.util.Collections;
6+
import java.util.List;
7+
import java.util.concurrent.ArrayBlockingQueue;
8+
import java.util.concurrent.BlockingQueue;
9+
import org.slf4j.Logger;
10+
import org.slf4j.LoggerFactory;
11+
12+
public class ConfigInversionMetricCollector
13+
implements MetricCollector<ConfigInversionMetricCollector.ConfigInversionMetric> {
14+
private static final Logger log = LoggerFactory.getLogger(ConfigInversionMetricCollector.class);
15+
private static final String CONFIG_INVERSION_KEY_TAG = "config_name:";
16+
private static final String CONFIG_INVERSION_METRIC_NAME = "untracked.config.detected";
17+
private static final String NAMESPACE = "tracers";
18+
private static final ConfigInversionMetricCollector INSTANCE =
19+
new ConfigInversionMetricCollector();
20+
21+
private final BlockingQueue<ConfigInversionMetricCollector.ConfigInversionMetric> metricsQueue;
22+
23+
private ConfigInversionMetricCollector() {
24+
this.metricsQueue = new ArrayBlockingQueue<>(RAW_QUEUE_SIZE);
25+
}
26+
27+
public static ConfigInversionMetricCollector getInstance() {
28+
return INSTANCE;
29+
}
30+
31+
public void setUndocumentedEnvVarMetric(String configName) {
32+
setMetricConfigInversionMetric(CONFIG_INVERSION_KEY_TAG + configName);
33+
}
34+
35+
private void setMetricConfigInversionMetric(final String... tags) {
36+
if (!metricsQueue.offer(
37+
new ConfigInversionMetricCollector.ConfigInversionMetric(
38+
NAMESPACE, true, CONFIG_INVERSION_METRIC_NAME, "count", 1, tags))) {
39+
log.debug("Unable to add telemetry metric {} for {}", CONFIG_INVERSION_METRIC_NAME, tags[0]);
40+
}
41+
}
42+
43+
@Override
44+
public void prepareMetrics() {
45+
// Nothing to do here
46+
}
47+
48+
@Override
49+
public Collection<ConfigInversionMetricCollector.ConfigInversionMetric> drain() {
50+
if (this.metricsQueue.isEmpty()) {
51+
return Collections.emptyList();
52+
}
53+
List<ConfigInversionMetricCollector.ConfigInversionMetric> drained =
54+
new ArrayList<>(this.metricsQueue.size());
55+
this.metricsQueue.drainTo(drained);
56+
return drained;
57+
}
58+
59+
public static class ConfigInversionMetric extends MetricCollector.Metric {
60+
public ConfigInversionMetric(
61+
String namespace,
62+
boolean common,
63+
String metricName,
64+
String type,
65+
Number value,
66+
final String... tags) {
67+
super(namespace, common, metricName, type, value, tags);
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)