Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ defmodule Sentry.Mixfile do
"pages/telemetry-integration.md",
"pages/upgrade-8.x.md",
"pages/upgrade-9.x.md",
"pages/upgrade-10.x.md"
"pages/upgrade-10.x.md",
"pages/upgrade-14.x.md"
],
groups_for_extras: [
Integrations: [
Expand All @@ -61,7 +62,8 @@ defmodule Sentry.Mixfile do
logo: "assets/logo.png",
skip_undefined_reference_warnings_on: [
"CHANGELOG.md",
"pages/upgrade-9.x.md"
"pages/upgrade-9.x.md",
"pages/upgrade-14.x.md"
],
authors: ["Mitchell Henke", "Jason Stiebs", "Andrea Leopardi"]
],
Expand Down
66 changes: 66 additions & 0 deletions pages/upgrade-14.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Upgrade to Sentry 14.x

This guide contains information on how to upgrade from Sentry `13.x` to Sentry `14.x`. If you're on a version lower than `13.x`, see the previous upgrade guides to get to `13.x` before going through this one.

## Replace `:enable_logs` with `:logs`

The `:enable_logs` option was removed. Sentry validates its configuration when it starts, so an application that still sets `:enable_logs` fails to boot.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The upgrade documentation incorrectly states that using deprecated keys like :enable_logs will cause a boot failure. These keys are silently ignored, which can lead to silent misconfiguration.
Severity: MEDIUM

Suggested Fix

Update the documentation in pages/upgrade-14.x.md to accurately describe that old configuration keys are silently stripped, and will not cause a boot failure. Warn users to check their configuration to ensure features like logging are still enabled with the new keys.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: pages/upgrade-14.x.md#L7

Potential issue: The upgrade documentation at `pages/upgrade-14.x.md` incorrectly states
that using removed configuration options like `:enable_logs` or `:enable_metrics` will
cause the application to fail on boot. In reality, the configuration validation in
`lib/sentry/config.ex` uses `Keyword.take(@valid_keys)`, which silently strips any
unrecognized keys. Consequently, an application using these old keys will boot
successfully. This can lead to silent misconfigurations, such as a user removing
`enable_logs: true` without adding the new `logs` configuration, resulting in structured
logs no longer being sent without any warning.

Also affects:

  • pages/upgrade-14.x.md:34

Did we get this right? 👍 / 👎 to inform future reviews.


Setting the `:logs` option now attaches the Sentry logger handler, and setting `:level` inside it turns on structured logs. `:level` now defaults to `nil` instead of `:info`.

If you had `enable_logs: true`, move it into `:logs` as a `:level`:

```elixir
# In config/config.exs

# Replace this:
config :sentry,
enable_logs: true,
logs: [metadata: [:request_id]]

# with this:
config :sentry,
logs: [level: :info, metadata: [:request_id]]
```

If you only delete `enable_logs: true` and keep a `:logs` block without `:level`, your application still reports crashes but stops sending structured logs.

If you had `enable_logs: false`, delete it along with any `:logs` block, since a `:logs` block now attaches the handler.

If you attach `Sentry.LoggerHandler` yourself, it sends structured logs when `:logs` has a `:level`, or when you pass `:logs_level` to the handler.

## Remove `:enable_metrics`

The `:enable_metrics` option was removed and metrics are always on. An application that still sets it fails to boot.

If you had `enable_metrics: false`, delete it. To stop metrics from being sent, drop them in a `:before_send_metric` callback:

```elixir
# In config/config.exs
config :sentry,
before_send_metric: {MyApp.Sentry, :drop_metric}
```

```elixir
defmodule MyApp.Sentry do
def drop_metric(_metric), do: nil
end
```

## Decide Whether to Trace 404 Responses

The new `:traces_ignore_http_status_codes` option defaults to `[404]`, so incoming requests answered with *404 Not Found* are no longer reported as transactions. Outgoing requests aren't affected.

```elixir
# In config/config.exs

# Trace every response, as before:
config :sentry,
traces_ignore_http_status_codes: []

# Or ignore more statuses:
config :sentry,
traces_ignore_http_status_codes: [404, 500..599]
```

The transaction is dropped only once the response status is known, so the trace has already been propagated as sampled. Services called while handling the request still report their spans, which appear in Sentry without their root transaction.
Loading