You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 23, 2023. It is now read-only.
I am working on an implementation of a tracer that handles our organizations specific needs but ideally would use the interfaces defined by opentracing. Maybe I am missing something but I don't see how that would work the way the types are defined now, with classes instead of interfaces.
E.g. if I define my own Tracer class that expects certain properties on the SpanContext, TypeScript will tell me that these properties don't exist.
import { Tracer as OpenTracer, SpanContext } from 'opentracing';
class Tracer extends OpenTracer {
startSpan(operationName: string, options: ISpanOptions = {}) {
// ...
let parent: SpanContext;
// ...
span.context.parentId = parent.spanId;
// -> Property 'parentId' does not exist on type '() => SpanContext'
}
}
If the opentracing types were interfaces, custom implementations could implement them and this wouldn't be a problem.
A consumer using my tracing implementation could not expect a span returned by my tracer's startSpan() to be of type opentracing Span.
Could you provide a few pointers on how you propose to create a custom tracer implementation that still uses the opentracing types?