4 ms·
Try implementing an OTEL Tracer. This interface is insane, and should really just be a struct. https://github.com/open-telemetry/opentelemetry-go/blob/trace/v
by caust1c 3y ago
Try implementing an OTEL Tracer. This interface is insane, and should really just be a struct.
https://github.com/open-telemetry/opentelemetry-go/blob/trace/v1.17.0/trace/trace.go#L336-L383 https://github.com/open-telemetry/opentelemetry-go/blob/trac...
- ramenmeal 3y agoWhy were you implementing your own tracer? Don't they publish an implementation?
- phillipcarter 3y agoYes, all SDKs have a tracer you can just use. While you can technically create your own tracer, you're officially in Hard Mode territory - there's no highly extensible system I'm aware of that makes swapping core concepts (that already have a default) easy.
- skrtskrt 3y agohow is this interface insane? It's a list of the behaviors you need to implement if you're rolling your own OTEL Tracer Span implementation, and not using one of the multiple available. In contrast, OpenTracing's interfaces had hardly any required methods, so you had to do a runtime type-cast to the whichever implementation you were using in order to access anything useful on the Span like the OperationName.