spandex-project / spandex

A platform agnostic tracing library
MIT License
335 stars 53 forks source link

Adapter Question #133

Closed ckoch-cars closed 2 years ago

ckoch-cars commented 3 years ago

I would like to use a spandex adapter to send events to datadog as well as another sink. I see in the documentation that additional adapters are possible but I don't see anything about how one would need to configure more than one adapter to support the goal of sending spandex traces to multiple datastores.

Can you offer any guidance/insight into how this might be accomplished?

Thanks.

GregMefford commented 2 years ago

Hey there! It should be possible to write a custom adapter that follows this behaviour. Documentation for this is very small or non-existent because in practice, I don't know of anyone ever actually doing it, other than for testing purposes or something like that. Basically, just implement the callbacks, using SpandexDatadog.Adapter as an example.

If you're really trying to send APM data to a vendor other than Datadog, I would recommend taking a look at OpenTelemetry, which is the long-term replacement for tools like Spandex and OpenCensus, as the entire industry is working toward OpenTelemetry as a vendor-neutral solution.

Spandex only operates with a single adapter at a time, but if you do have a reason that you need to use Spandex to send to multiple destinations, you'd just need to write a custom adapter that does what you want to do, but also calls the regular SpandexDatadog.Adapter as well - effectively composing them together.

I'll go ahead and close the issue for now, just so that it doesn't sit here open forever, but please feel free to reply with further questions / clarifications.