Skip to content

Commit b465d1f

Browse files
committed
added telemetry test cases
1 parent b0236ec commit b465d1f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/dd-trace/test/opentelemetry/traces.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,18 @@ describe('OpenTelemetry Traces', () => {
845845
})
846846

847847
describe('Telemetry Metrics', () => {
848+
it('sets protocol:http tag for http:// endpoint', () => {
849+
const exporter = new OtlpHttpTraceExporter('http://collector.example/v1/traces', {}, 1000, {})
850+
851+
assert.ok(exporter.telemetryTags.includes('protocol:http'))
852+
})
853+
854+
it('sets protocol:https tag for https:// endpoint', () => {
855+
const exporter = new OtlpHttpTraceExporter('https://collector.example/v1/traces', {}, 1000, {})
856+
857+
assert.ok(exporter.telemetryTags.includes('protocol:https'))
858+
})
859+
848860
it('tracks telemetry metrics for exported traces', () => {
849861
const telemetryMetrics = {
850862
manager: { namespace: sinon.stub().returns({ count: sinon.stub().returns({ inc: sinon.spy() }) }) },

0 commit comments

Comments
 (0)