spandex-project/spandex

Decorators might not be respecting `disabled?`

novaugust opened this issue · 3 comments

We recently added decorators to our project. Haven't actually gotten it working yet (overlapping traces from ecto or phx?) but that's not related to this issue so excuse me!
Decorators were causing tests failures until we manually added
Relay.Tracer.configure(disabled?: true) to test_helper.exs.
This is our config:

config :relay, Relay.Tracer,
  service: :relay,
  adapter: SpandexDatadog.Adapter,
  type: :custom,
  disabled?: Mix.env() != :prod,
  env: release_level

config :spandex, :decorators, tracer: Relay.Tracer

config :spandex_phoenix,
  service: :phoenix,
  type: :web,
  tracer: Relay.Tracer

config :spandex_ecto, SpandexEcto.EctoLogger,
  service: :ecto,
  type: :db,
  tracer: Relay.Tracer

I also noticed that even if you set disabled?: true, you still need to set env to a string.
I think if you're disabling the tracer, that should be a full stop.

I was trying to reproduce this and get it fixed, but I wasn't able to get it to fail in the way you're describing from within Spandex's test environment itself, and I wasn't able to think of any obvious reasons that it wouldn't work from within an actual app.

I'll work on getting spandex_example updated so that I can verify there, but wanted to leave a note here in case either @novaugust or @InoMurko are able to confirm that this is a problem they can still replicate vs. something that has since resolved itself or turned out to be something else.

this is so very old, probs not relevant eh