Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
khanayan123 committed Jan 14, 2025
1 parent 69e25f3 commit eeeb2a1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion integration-tests/pino/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const logger = require('pino')()
const server = http
.createServer((req, res) => {
const span = tracer.scope().active()
const contextTraceId = span.context().toTraceId(true)
const contextTraceId = span.context().toTraceId()
const contextSpanId = span.context().toSpanId()
logger.info(
{ custom: { trace_id: contextTraceId, span_id: contextSpanId } },
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-plugin-bunyan/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Plugin', () => {
const record = JSON.parse(stream.write.firstCall.args[0].toString())

expect(record.dd).to.deep.include({
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/datadog-plugin-pino/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('Plugin', () => {
const record = JSON.parse(stream.write.firstCall.args[0].toString())

expect(record.dd).to.deep.include({
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
})

Expand Down Expand Up @@ -184,7 +184,7 @@ describe('Plugin', () => {
const record = JSON.parse(stream.write.firstCall.args[0].toString())

expect(record.dd).to.deep.include({
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
})

Expand All @@ -207,7 +207,7 @@ describe('Plugin', () => {

const record = stream.write.firstCall.args[0].toString()

expect(record).to.match(new RegExp(`trace_id\\W+?${span.context().toTraceId(true)}`))
expect(record).to.match(new RegExp(`trace_id\\W+?${span.context().toTraceId()}`))
expect(record).to.match(new RegExp(`span_id\\W+?${span.context().toSpanId()}`))

expect(record).to.include('message')
Expand Down
10 changes: 5 additions & 5 deletions packages/datadog-plugin-winston/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('Plugin', () => {
it('should add the trace identifiers to the default logger', async () => {
const meta = {
dd: {
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
}
}
Expand All @@ -170,7 +170,7 @@ describe('Plugin', () => {

const meta = {
dd: {
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
}
}
Expand All @@ -190,7 +190,7 @@ describe('Plugin', () => {
it('should support errors', async () => {
const meta = {
dd: {
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
}
}
Expand All @@ -216,7 +216,7 @@ describe('Plugin', () => {
transports: [transport, httpTransport]
})
const dd = {
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
}

Expand Down Expand Up @@ -287,7 +287,7 @@ describe('Plugin', () => {

const meta = {
dd: {
trace_id: span.context().toTraceId(true),
trace_id: span.context().toTraceId(),
span_id: span.context().toSpanId()
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/src/opentracing/span_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DatadogSpanContext {
this._otelSpanContext = undefined
}

toTraceId (get128bitId = false) {
toTraceId (get128bitId = true) {
if (get128bitId) {
return this._traceId.toBuffer().length <= 8 && this._trace.tags[TRACE_ID_128]
? this._trace.tags[TRACE_ID_128] + this._traceId.toString(16).padStart(16, '0')
Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/test/plugins/log_plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('LogPlugin', () => {
expect(message.dd).to.contain(config)

// Should have trace/span data when none is active
expect(message.dd).to.have.property('trace_id', span.context().toTraceId(true))
expect(message.dd).to.have.property('trace_id', span.context().toTraceId())
expect(message.dd).to.have.property('span_id', span.context().toSpanId())
})
})
Expand Down

0 comments on commit eeeb2a1

Please sign in to comment.