spandex-project / spandex

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

Decorators might not be respecting `disabled?` #95

Closed novaugust closed 3 years ago

novaugust commented 5 years ago

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
InoMurko commented 4 years ago

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.

GregMefford commented 4 years ago

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.

novaugust commented 3 years ago

this is so very old, probs not relevant eh