Surgex.Sentry (Surgex v6.0.1)

View Source

Extensions to the official Sentry package.

NOTE: Deprecated in favor of Elixir 1.9 runtime configuration.

This module will be removed in a future version. Use Elixir 1.9+ runtime configuration with config/runtime.exs instead.

Summary

Functions

init() deprecated

Patches Sentry environment name and release version from env vars.

scrub_params(conn) deprecated

Deeply scrubs params, obfuscating those with blacklisted names.

Functions

init()

This function is deprecated. Use Elixir 1.9+ runtime configuration (config/runtime.exs) instead.

Patches Sentry environment name and release version from env vars.

By default, Sentry package only allows to fetch DSN from env var. This function extends that with environment name and release version set on runtime, thus enabling deployments on Heroku where application slug is compiled without final env vars.

Examples

In order to execute this extension on application start, set an appropriate config key:

config :surgex,
  sentry_patch_enabled: true

scrub_params(conn)

This function is deprecated. Use Sentry's built-in scrubbing or implement your own scrubber.

Deeply scrubs params, obfuscating those with blacklisted names.

By default, Sentry package only offers flat scrubbing of params. This won't work with nested params or JSON objects, so here's deep recursive equivalent of such scrubber.

Examples

In order to use this extension, pass Surgex.Sentry.scrub_params/1 to Sentry.Plug like this:

use Sentry.Plug, body_scrubber: &Surgex.Sentry.scrub_params/1