Skip to content

Commit 797e553

Browse files
committed
Merge branch 'dougqh/interceptor-bypass' of github.com:DataDog/dd-trace-java into dougqh/interceptor-bypass
2 parents 34e3dcc + 48f3539 commit 797e553

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
4545
- name: Commit and push changes
46-
uses: planetscale/ghcommit-action@5b20c92facae8dbf8a3836dc65b8503dda378573 # v0.2.13
46+
uses: planetscale/ghcommit-action@6a383e778f6620afde4bf4b45069d3c6983c1ae2 # v0.2.15
4747
with:
4848
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
4949
repo: ${{ github.repository }}

dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static datadog.trace.api.cache.RadixTreeCache.HTTP_STATUSES;
66
import static datadog.trace.bootstrap.instrumentation.api.ErrorPriorities.UNSET;
77

8+
import datadog.trace.api.DDSpanId;
89
import datadog.trace.api.DDTags;
910
import datadog.trace.api.DDTraceId;
1011
import datadog.trace.api.Functions;
@@ -953,9 +954,9 @@ public String toString() {
953954
.append("DDSpan [ t_id=")
954955
.append(traceId)
955956
.append(", s_id=")
956-
.append(spanId)
957+
.append(DDSpanId.toString(spanId))
957958
.append(", p_id=")
958-
.append(parentId)
959+
.append(DDSpanId.toString(parentId))
959960
.append(" ] trace=")
960961
.append(getServiceName())
961962
.append('/')

dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanContextTest.groovy

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MAX_PER_SECOND_TAG
1919
class DDSpanContextTest extends DDCoreSpecification {
2020

2121
def writer
22-
def tracer
22+
CoreTracer tracer
2323
def profilingContextIntegration
2424

2525
def setup() {
@@ -289,6 +289,29 @@ class DDSpanContextTest extends DDCoreSpecification {
289289
"_dd.${tag}.json"
290290
}
291291

292+
def "Span IDs printed as unsigned long"() {
293+
setup:
294+
def parent = tracer.buildSpan("fakeOperation")
295+
.withServiceName("fakeService")
296+
.withResourceName("fakeResource")
297+
.withSpanId(-987654321)
298+
.start()
299+
300+
def span = tracer.buildSpan("fakeOperation")
301+
.withServiceName("fakeService")
302+
.withResourceName("fakeResource")
303+
.withSpanId(-123456789)
304+
.asChildOf(parent.context())
305+
.start()
306+
307+
def context = span.context() as DDSpanContext
308+
309+
expect:
310+
// even though span ID and parent ID are setup as negative numbers, they should be printed as their unsigned value
311+
// asserting there is no negative sign after ids is the best I can do.
312+
context.toString().contains("id=-") == false
313+
}
314+
292315
static void assertTagmap(Map source, Map comparison, boolean removeThread = false) {
293316
def sourceWithoutCommonTags = new HashMap(source)
294317
sourceWithoutCommonTags.remove("runtime-id")

0 commit comments

Comments
 (0)