spandex-project/spandex

Tracing Broadway Processes

samullen opened this issue · 1 comments

We're slowly adding Spandex into our system, and it's worked great for most things. Thanks for that. We are, however, having difficulty getting it to work in conjunction with Broadway. I'm assuming it's a misunderstanding on my part.

The error we see in HoneyBadger is as follows:

Tried to start a trace over top of another trace: extend_cert.

It doesn't have a dump to go with it.

Our Broadway module looks something like this:

defmodule Background.ExtendCert do
  use Broadway
  use Spandex.Decorators

  alias TFSpandex.Tracer

  def start_link(_opts) do
    ...
  end

  @decorate trace(tracer: TFSpandex.Tracer, service: :some_service)
  def handle_message(:default, %Message{data: payload} = message, _context) do
    ...
  end

  @decorate span(tracer: TFSpandex.Tracer, service: :some_service)
  def some_func() do
    ...
  end
end

I've also tried using Tracer.start_trace, but came up with similar results.

I've also considered that DataDog may just not like tracing anything that doesn't have an HTTP request associated with it.

Thanks

Figured out what the problem. It's unrelated to the library. Sorry for troubling you.