Skip to content

Commit 54de40f

Browse files
authored
Merge branch 'master' into mcculls/move-inferred-proxy-code-out-of-components
2 parents 2557c43 + e5785f7 commit 54de40f

File tree

33 files changed

+356
-1035
lines changed

33 files changed

+356
-1035
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ updates:
88
- package-ecosystem: "github-actions"
99
directory: "/"
1010
schedule:
11-
interval: "monthly"
11+
interval: "weekly"
12+
labels:
13+
- "comp: tooling"
14+
- "tag: dependencies"
15+
- "tag: no release notes"
16+
commit-message:
17+
prefix: "chore(ci): "
1218
groups:
1319
gh-actions-packages:
1420
patterns:

.github/workflows/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ _Action:_
115115

116116
_Notes:_ Results are sent on both production and staging environments.
117117

118+
### check-ci-pipelines [🔗](check-ci-pipelines.yaml)
119+
120+
_Trigger:_ When opening or updating a PR.
121+
122+
_Action:_ This action will check all other continuous integration jobs (Github action, Gitlab, CircleCi), and will fail if any of them fails.
123+
The purpose of this job is to be required for PR merges, achieving Green CI Policy.
124+
It got an `ignored` parameters to exclude some jobs if they are temprorary failing.
125+
126+
_Recovery:_ Manually trigger the action on the desired branch.
127+
118128
### comment-on-submodule-update [🔗](comment-on-submodule-update.yaml)
119129

120130
_Trigger:_ When creating a PR commits to `master` or a `release/*` branch with a Git Submodule update.
@@ -137,14 +147,6 @@ _Action:_ Build the Java Client Library and runs [the system tests](https://gith
137147

138148
_Recovery:_ Manually trigger the action on the desired branch.
139149

140-
### all-green [🔗](all-green.yaml)
141-
142-
_Trigger:_ Any pull request.
143-
144-
_Action:_ This action will check all other jobs (Github action, Gitlab, CircleCi), and will fail if any of them fails. This action got an `ignored` paraemters to exclude some jobs if they are temprorary failing. The purpose of this job is to be required for merges, achieving Green CI Policy.
145-
146-
_Recovery:_ Manually trigger the action on the desired branch.
147-
148150
## Maintenance
149151

150152
GitHub actions should be part of the [repository allowed actions to run](https://github.com/DataDog/dd-trace-java/settings/actions).

.github/workflows/all-green.yml renamed to .github/workflows/check-ci-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ permissions:
1616
statuses: read
1717

1818
jobs:
19-
all-jobs-are-green:
19+
check-ci-pipelines:
20+
name: Check CI Pipelines
2021
runs-on: ubuntu-latest
2122
steps:
2223
- name: Run Ensure CI Success

dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/context/OtelContext.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ public String toString() {
8989
return "OtelContext{" + "delegate=" + delegate + '}';
9090
}
9191

92+
/**
93+
* Returns the underlying context.
94+
*
95+
* @return The underlying context.
96+
*/
97+
public datadog.context.Context asContext() {
98+
return this.delegate;
99+
}
100+
92101
private static datadog.context.ContextKey delegateKey(ContextKey key) {
93102
return DELEGATE_KEYS.computeIfAbsent(key, OtelContext::mapByKeyName);
94103
}

dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/context/propagation/AgentTextMapPropagator.java

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package datadog.opentelemetry.shim.context.propagation;
22

33
import static datadog.context.propagation.Propagators.defaultPropagator;
4-
import static datadog.opentelemetry.shim.trace.OtelSpanContext.fromRemote;
54
import static datadog.trace.api.TracePropagationStyle.TRACECONTEXT;
6-
import static datadog.trace.bootstrap.instrumentation.api.AgentPropagation.extractContextAndGetSpanContext;
75

86
import datadog.opentelemetry.shim.context.OtelContext;
97
import datadog.opentelemetry.shim.trace.OtelExtractedContext;
@@ -13,8 +11,6 @@
1311
import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext.Extracted;
1412
import datadog.trace.bootstrap.instrumentation.api.TagContext;
1513
import datadog.trace.util.PropagationUtils;
16-
import io.opentelemetry.api.trace.Span;
17-
import io.opentelemetry.api.trace.SpanContext;
1814
import io.opentelemetry.api.trace.TraceState;
1915
import io.opentelemetry.context.Context;
2016
import io.opentelemetry.context.propagation.TextMapGetter;
@@ -45,27 +41,25 @@ public <C> Context extract(Context context, @Nullable C carrier, TextMapGetter<C
4541
if (carrier == null) {
4642
return context;
4743
}
48-
Extracted extracted =
49-
extractContextAndGetSpanContext(
50-
carrier,
51-
(carrier1, classifier) -> {
52-
for (String key : getter.keys(carrier1)) {
53-
classifier.accept(key, getter.get(carrier1, key));
54-
}
55-
});
56-
if (extracted == null) {
57-
return context;
58-
} else {
59-
TraceState traceState = extractTraceState(extracted, carrier, getter);
60-
SpanContext spanContext = fromRemote(extracted, traceState);
61-
return Span.wrap(spanContext).storeInContext(OtelContext.ROOT);
62-
}
44+
datadog.context.Context extracted =
45+
defaultPropagator()
46+
.extract(
47+
convertContext(context),
48+
carrier,
49+
(carrier1, classifier) -> {
50+
for (String key : getter.keys(carrier1)) {
51+
classifier.accept(key, getter.get(carrier1, key));
52+
}
53+
});
54+
return new OtelContext(extracted);
6355
}
6456

6557
private static datadog.context.Context convertContext(Context context) {
66-
// TODO Extract baggage too
67-
// TODO Create fast path from OtelSpan --> AgentSpan delegate --> with() to inflate as full
68-
// context if baggage
58+
// Try to get the underlying context when injecting a Datadog context
59+
if (context instanceof OtelContext) {
60+
return ((OtelContext) context).asContext();
61+
}
62+
// Otherwise, fallback to extracting limited tracing context and recreating an OTel context from
6963
AgentSpanContext extract = OtelExtractedContext.extract(context);
7064
return AgentSpan.fromSpanContext(extract);
7165
}

dd-java-agent/instrumentation/java-security/src/test/groovy/test/WeakCipherTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class WeakCipherTest extends AgentTestRunner {
6363
}
6464

6565
// Key Generator
66-
def "test weak cipher instrumentation"() {
66+
def "test weak keygen instrumentation"() {
6767
setup:
6868
WeakCipherModule module = Mock(WeakCipherModule)
6969
InstrumentationBridge.registerIastModule(module)
@@ -75,7 +75,7 @@ class WeakCipherTest extends AgentTestRunner {
7575
1 * module.onCipherAlgorithm(_)
7676
}
7777

78-
def "test weak cipher instrumentation with provider"() {
78+
def "test weak keygen instrumentation with provider"() {
7979
setup:
8080
WeakCipherModule module = Mock(WeakCipherModule)
8181
InstrumentationBridge.registerIastModule(module)
@@ -88,7 +88,7 @@ class WeakCipherTest extends AgentTestRunner {
8888
1 * module.onCipherAlgorithm(_)
8989
}
9090

91-
def "test weak cipher instrumentation with provider string"() {
91+
def "test weak keygen instrumentation with provider string"() {
9292
setup:
9393
WeakCipherModule module = Mock(WeakCipherModule)
9494
InstrumentationBridge.registerIastModule(module)

dd-java-agent/instrumentation/kotlin-coroutines/build.gradle

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,42 @@ plugins {
22
id 'java-test-fixtures'
33
}
44

5+
muzzle {
6+
pass {
7+
group = 'org.jetbrains.kotlin'
8+
module = 'kotlin-stdlib'
9+
versions = "[1.3.0,)"
10+
extraDependency "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
11+
}
12+
pass {
13+
group = 'org.jetbrains.kotlinx'
14+
module = 'kotlinx-coroutines-core'
15+
versions = "[1.3.0,)"
16+
}
17+
pass {
18+
group = 'org.jetbrains.kotlinx'
19+
module = 'kotlinx-coroutines-core-jvm'
20+
versions = "[1.5.0,)"
21+
}
22+
}
23+
524
apply from: "$rootDir/gradle/java.gradle"
625
apply from: "$rootDir/gradle/test-with-kotlin.gradle"
726

27+
addTestSuite('latestDepTest')
28+
829
tasks.named("compileTestFixturesGroovy").configure {
930
classpath += files(compileTestFixturesKotlin.destinationDirectory)
1031
}
1132

33+
tasks.named("compileTestGroovy").configure {
34+
classpath += files(compileTestKotlin.destinationDirectory)
35+
}
36+
37+
tasks.named("compileLatestDepTestGroovy").configure {
38+
classpath += files(compileLatestDepTestKotlin.destinationDirectory)
39+
}
40+
1241
dependencies {
1342
api project(':dd-java-agent:instrumentation:java-concurrent')
1443
compileOnly libs.kotlin
@@ -20,4 +49,12 @@ dependencies {
2049
testFixturesApi project(':dd-java-agent:instrumentation:trace-annotation')
2150
testFixturesApi project(':dd-java-agent:testing')
2251
testFixturesApi 'com.github.spotbugs:spotbugs-annotations:4.2.0'
52+
53+
testImplementation libs.kotlin
54+
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
55+
testImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines'))
56+
57+
latestDepTestImplementation libs.kotlin
58+
latestDepTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.+"
59+
latestDepTestImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines'))
2360
}

dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/build.gradle

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

0 commit comments

Comments
 (0)