vectordotdev / timber-elixir

🌲 Great Elixir logging made easy
https://timber.io
Other
214 stars 29 forks source link

Verify & test that controller / action blacklisting works as expected #323

Closed binarylogic closed 5 years ago

binarylogic commented 5 years ago

We've had a couple of customers complain that blacklisting is not working as expected. I'd like to verify that this did not break in the transition to 3.0, and possibly get some tests in place to prevent regression going forward


From our customer:

We are happily on timber for elixir 3.0 and are using timber_phoenix. we have this configuration:

config :timber, Timber.Phoenix,
  controller_actions_blacklist: [
    {ClientAPI.HealthController, :index},
    {ClientAPI.HealthController, :index},
    {WebhooksAPI.HealthController, :index},
    {WebhooksAPI.DeploymentStatusController, :create}
  ]

but we are still seeing these in our logs:

Jan 04 02:58:25pm info finstance... GET /_healthcheck
Jan 04 02:58:25pm debug instance... Setting request_id to "abcd123ref53234gfgd2"
Jan 04 02:58:25pm debug instance... Processing with ClientAPI.HealthController.index/2 Pipelines: [:api]
Jan 04 02:58:25pm info instance... Sent 200 in 251µs
Jan 04 02:58:25pm info instance... GET /_healthcheck
Jan 04 02:58:25pm debug instance... Processing with ClientAPI.HealthController.index/2 Pipelines: [:api]
Jan 04 02:58:25pm info instance... Sent 200 in 119µs

is there some extra special thing we need to do to get rid of these?

mitchellhenke commented 5 years ago

Fix released in Timber Phoenix 1.0.1

zacksiri commented 5 years ago

I just upgraded to 1.0.1

using this config

config :timber_phoenix, Timber.Phoenix,
  controller_actions_blacklist: [
    {StudioWeb.HealthController, :show}
  ]

Doesn't seem to work for some reason. It's still logging my health check.

mitchellhenke commented 5 years ago

@zacksiri the configuration documentation had an error previously, but was recently fixed.

The config should look something like:

config :timber_phoenix,
  parsed_controller_actions_blacklist: [
    {StudioWeb.HealthController, :show}
  ]

More documentation is available here: https://hexdocs.pm/timber_phoenix/Timber.Phoenix.html#module-ignoring-controller-actions-for-instrumentation