Comparing version 0.8.0-beta.12 to 0.8.0-beta.13
@@ -10,3 +10,2 @@ 'use strict' | ||
SAMPLING_PRIORITY: 'sampling.priority', | ||
EVENT_SAMPLE_RATE: '_dd1.sr.eausr', | ||
ERROR: 'error', | ||
@@ -13,0 +12,0 @@ |
@@ -1,1 +0,1 @@ | ||
module.exports = '0.8.0-beta.12' | ||
module.exports = '0.8.0-beta.13' |
{ | ||
"name": "dd-trace", | ||
"version": "0.8.0-beta.12", | ||
"version": "0.8.0-beta.13", | ||
"description": "Datadog APM tracing client for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,4 +5,3 @@ 'use strict' | ||
SAMPLE_RATE_METRIC_KEY: '_sample_rate', | ||
SAMPLING_PRIORITY_KEY: '_sampling_priority_v1', | ||
EVENT_SAMPLE_RATE_KEY: '_dd1.sr.eausr' | ||
SAMPLING_PRIORITY_KEY: '_sampling_priority_v1' | ||
} |
@@ -5,7 +5,4 @@ 'use strict' | ||
const constants = require('./constants') | ||
const tags = require('../ext/tags') | ||
const SAMPLING_PRIORITY_KEY = constants.SAMPLING_PRIORITY_KEY | ||
const EVENT_SAMPLE_RATE_KEY = constants.EVENT_SAMPLE_RATE_KEY | ||
const EVENT_SAMPLE_RATE = tags.EVENT_SAMPLE_RATE | ||
@@ -66,4 +63,2 @@ const map = { | ||
break | ||
case EVENT_SAMPLE_RATE: | ||
break | ||
default: | ||
@@ -87,3 +82,2 @@ trace.meta[tag] = String(tags[tag]) | ||
const spanContext = span.context() | ||
const eventSampleRate = parseFloat(spanContext._tags[EVENT_SAMPLE_RATE]) | ||
@@ -99,8 +93,4 @@ Object.keys(spanContext._metrics).forEach(metric => { | ||
} | ||
if (eventSampleRate >= 0 && eventSampleRate <= 1) { | ||
trace.metrics[EVENT_SAMPLE_RATE_KEY] = eventSampleRate | ||
} | ||
} | ||
module.exports = format |
@@ -6,13 +6,14 @@ 'use strict' | ||
const traceKey = 'dd.trace_id' | ||
const spanKey = 'dd.span_id' | ||
class LogPropagator { | ||
inject (spanContext, carrier) { | ||
carrier[traceKey] = spanContext.toTraceId() | ||
carrier[spanKey] = spanContext.toSpanId() | ||
if (!carrier) return | ||
carrier.dd = { | ||
trace_id: spanContext.toTraceId(), | ||
span_id: spanContext.toSpanId() | ||
} | ||
} | ||
extract (carrier) { | ||
if (!carrier[traceKey] || !carrier[spanKey]) { | ||
if (!carrier || !carrier.dd || !carrier.dd.trace_id || !carrier.dd.span_id) { | ||
return null | ||
@@ -22,4 +23,4 @@ } | ||
const spanContext = new DatadogSpanContext({ | ||
traceId: new Uint64BE(carrier[traceKey], 10), | ||
spanId: new Uint64BE(carrier[spanKey], 10) | ||
traceId: new Uint64BE(carrier.dd.trace_id, 10), | ||
spanId: new Uint64BE(carrier.dd.span_id, 10) | ||
}) | ||
@@ -26,0 +27,0 @@ |
'use strict' | ||
const eventSampler = require('../../event_sampler') | ||
const FORMAT_HTTP_HEADERS = require('opentracing').FORMAT_HTTP_HEADERS | ||
@@ -47,4 +46,2 @@ const log = require('../../log') | ||
eventSampler.sample(span, config.eventSampleRate) | ||
callback && callback(span) | ||
@@ -51,0 +48,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148187
90
4283