opentelemetry-js
opentelemetry-js copied to clipboard
TracerProvider should return no-op tracer when shutdown
Description
According to the spec a TracerProvider should return no-op tracer when shutdown.
Steps to Reproduce
Test for BasicTracerProvider.test.ts
describe('.getTracer()', () => {
it('should return no-op tracer when already shutdown', () => {
const tracerProvider = new BasicTracerProvider();
tracerProvider.shutdown();
// returned tracer should be no-op, not instance of Tracer (from SDK)
assert.ok(!(tracerProvider.getTracer('foo') instanceof Tracer));
});
});
Additional Details
Spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#shutdown
Link to getTracer()
code: https://github.com/open-telemetry/opentelemetry-js/blob/3db10568be4387ef024aa431ca1addef18c2441e/packages/opentelemetry-sdk-trace-base/src/BasicTracerProvider.ts#L93-L101
would like to take this up!
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.