opentracing / basictracer-go

Basic implementation of the OpenTracing API for Go. 🛑 This library is DEPRECATED!
Apache License 2.0
81 stars 27 forks source link

add MultiRecorder #45

Closed neelance closed 1 year ago

neelance commented 8 years ago

This new function is similar to io.MultiWriter and is useful for writing to multiple opentracing backends at the same time.

yurishkuro commented 8 years ago

Please add unit tests

neelance commented 8 years ago

@yurishkuro Test added.

jmacd commented 8 years ago

Looks good.

bhs commented 8 years ago

@neelance no real objection to this PR – it's nice and concise.

That said, basictracer is intended to be an implementation detail for OpenTracing callers and, as such, this is going to be hard to use in practice without breaking abstraction boundaries.

I would be excited about something like a TeeTracer that implements the opentracing.Tracer interface and has both a "primary" Tracer to use for Inject/Extract as well as a "secondary" Tracer to multiplex all Span method calls to. If you have interest in taking that on, I suspect it would be more flexible.

neelance commented 8 years ago

@bensigelman Yes, I am aware that this only works if all your tracers are based on basictracer. I was first thinking about a TeeTracer, but that's much more complicated than this MultiRecorder solution. This works for my use case and I am busy enough with my open source projects, so sorry, I simply don't have the spare time to work on a TeeTracer.

yurishkuro commented 1 year ago

library is deprecated