Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
khanayan123 committed Feb 5, 2025
1 parent 76136b0 commit 1cc6a0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/dd-trace/src/opentracing/propagation/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ class LogPropagator {
carrier.dd = {}

if (spanContext) {
if (!this._config.traceId128BitLoggingEnabled || !spanContext._trace.tags['_dd.p.tid']) {
if (this._config.traceId128BitLoggingEnabled && spanContext._trace.tags['_dd.p.tid']) {
carrier.dd.trace_id = spanContext.toTraceId()
}

Check failure on line 19 in packages/dd-trace/src/opentracing/propagation/log.js

View workflow job for this annotation

GitHub Actions / lint

Closing curly brace does not appear on the same line as the subsequent block
else if (this._config.traceId128BitLoggingEnabled == false || this._config.traceId128BitGenerationEnabled == false) {

Check failure on line 20 in packages/dd-trace/src/opentracing/propagation/log.js

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 123. Maximum allowed is 120

Check failure on line 20 in packages/dd-trace/src/opentracing/propagation/log.js

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='

Check failure on line 20 in packages/dd-trace/src/opentracing/propagation/log.js

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='
carrier.dd.trace_id = spanContext.toTraceId(false)
} else {
carrier.dd.trace_id = spanContext.toTraceId()
Expand Down
3 changes: 1 addition & 2 deletions packages/dd-trace/src/opentracing/span.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,10 @@ class DatadogSpan {
spanContext = new SpanContext({
traceId: spanId,
spanId,

Check failure on line 333 in packages/dd-trace/src/opentracing/span.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected trailing comma
traceId128BitGenerationEnabled: fields.traceId128BitGenerationEnabled
})
spanContext._trace.startTime = startTime

if (fields.traceId128BitGenerationEnabled) {
if (fields.traceId128BitGenerationEnabled !== false) {
spanContext._trace.tags['_dd.p.tid'] = Math.floor(startTime / 1000).toString(16)
.padStart(8, '0')
.padEnd(16, '0')
Expand Down
3 changes: 1 addition & 2 deletions packages/dd-trace/src/opentracing/span_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class DatadogSpanContext {
tags: {}
}
this._otelSpanContext = undefined
this._traceId128BitGenerationEnabled = this._trace.tags['_dd.p.tid'] ? true : (props.traceId128BitGenerationEnabled || false)
}

[util.inspect.custom] () {
Expand All @@ -45,7 +44,7 @@ class DatadogSpanContext {
}

toTraceId (get128bitId = true) {
if (get128bitId == false || this._traceId128BitGenerationEnabled == false) {
if (get128bitId == false) {

Check failure on line 47 in packages/dd-trace/src/opentracing/span_context.js

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='
return this._traceId.toString(10)
}
return this._traceId.toBuffer().length <= 8 && this._trace.tags[TRACE_ID_128]
Expand Down

0 comments on commit 1cc6a0c

Please sign in to comment.