Should I throw an error, write a log line or record a trace?

Report an error when something failed that you mean to fix. It becomes an issue, and the first one emails you. Write a log line for a fact you may need later, searchable for 7 days. Record a trace to see how long page loads and requests take. Errors and log lines count as Monitoring events, and traces do not.

Last updated 26 November 2026. By Paul Badarau.

Ana, a fictional developer, builds a store finder for a bike shop chain. Three things go wrong in one week, and each one needs a different signal.

  • The map script throws TypeError: map is undefined and the page shows nothing. That is an error. The SDK reports it on its own, Monitoring groups it into an issue, and Owners and Administrators get an email the first time it appears.
  • A search for one postcode returns no shops, and nothing breaks. That is a log line: Sentry.logger.info('No shops for postcode ' + postcode, { radiusKm: 10 }). Ana reads it the next day by searching the Logs page.
  • Results take four seconds to appear on phones. That is a trace. With Sentry.browserTracingIntegration() and a tracesSampleRate in Sentry.init, the SDK records each page load and navigation, and Performance shows how long they took.

The criteria behind those choices:

  1. Do you need to be told? Only a new issue sends an email. A slow trace or a log line at error level never does, and Performance has no alerting.
  2. Will you fix it, or read it for context? An issue collects repeats with their stack, breadcrumbs and tags. A log line keeps a level, a message and up to 40 attributes, found by searching the message.
  3. Is the question about time? Performance shows the number of segments received, the error rate, and the p50 and p95 duration, marked as approximate, for each operation and over up to 30 days. Individual traces and their waterfalls are kept for 7 days.
  4. What does it cost? Errors and log lines count toward the Workspace's 10,000 Monitoring events a month. Spans do not, but their volume follows your sample rate.

The three are linked by trace ID. When a page load is traced, its trace view lists the errors and log lines that carry the same trace ID, so Ana can open the slow trace and see the warning she logged inside it. If you send errors only, you get the alert without that timing, so add tracing where speed is part of the question.

The product page for this is Monitoring.

Start your 14-day free trial