Sentry: an empty SENTRY_DSN means off, not a boot failure

54b8cdb · Gabe Morell · 2026-10-27 15:25

2 files +7 -1
Message
{commit_body(@commit)}

Files changed

modified config/runtime.exs
+7 −1
@@ -73,7 +73,13 @@ if config_env() == :prod do
73 73 # Sentry: only emits when DSN is non-empty, so the secret can be left
74 74 # blank (or absent) in environments where reporting is off.
75 75 config :sentry,
76 − dsn: System.get_env("SENTRY_DSN"),
76 + # "" counts as unset: Sentry rejects dsn: "" at boot rather than
77 + # treating it as off, and the application refuses to start.
78 + dsn:
79 + (case System.get_env("SENTRY_DSN") do
80 + "" -> nil
81 + dsn -> dsn
82 + end),
77 83 environment_name: :prod,
78 84 release: System.get_env("APP_VERSION") || System.get_env("CI_COMMIT_SHA")
79 85

Parents: fe8f7ae