Stackbook Logo
observability

Error Tracking and Monitoring

Intent

Capture, group, and prioritize application errors so teams fix the issues that matter before users report them.

Problem

Errors buried in logs go unnoticed until customers complain. Raw exception volume overwhelms teams, and without grouping and context nobody can tell which defects are new, frequent, or severe.

Forces

    Solution

    Error Tracking and Monitoring

    Error tracking turns exceptions into a managed work queue. Instead of searching logs after an incident, teams see new, regressed, and high-impact errors as they happen, with the context needed to reproduce them.

    How it works

    An SDK hooks into the runtime, catching unhandled exceptions and allowing explicit capture of handled ones. Each event carries a stack trace, release tag, environment, breadcrumbs of preceding actions, and scrubbed user context. The service fingerprints events by stack and message into issues, then counts occurrences and affected users. Release tracking marks an issue as a regression if it reappears after being resolved. Alert rules notify the owning team through chat or paging based on severity, novelty, and rate.

    Implementation steps

    1. Integrate the SDK in backend, web, and mobile with release and environment tags
    2. Upload source maps or debug symbols for readable stack traces
    3. Configure scrubbing to remove secrets and personal data
    4. Define ownership rules mapping code paths to teams
    5. Create alerts for new issues, regressions, and rate spikes
    6. Hold a regular triage session and track issue age and resolution

    Common pitfalls

    • Alerting on every event rather than new or surging issues
    • Missing release tags, which prevents regression detection
    • Sending unscrubbed request bodies or tokens to a third party
    • Ignoring noisy known errors until they mask real ones

    Metrics to watch

    • New issues per release
    • Crash-free users or sessions
    • Mean time to acknowledge and resolve
    • Open issue count and age
    • Event volume and quota usage

    Example configuration

    // Initialize error tracking with scrubbing
    Sentry.init({
      dsn: process.env.ERROR_DSN,
      release: process.env.APP_VERSION,
      environment: process.env.APP_ENV,
      sampleRate: 1.0,
      beforeSend(event) {
        delete event.request?.cookies;
        return event;
      },
    });
    

    Trade-offs and adoption

    Teams adopt this approach when production applications where errors affect users; frequent releases that can introduce regressions. It is a poor fit when prototypes with no real users, or when environments where capturing payloads would violate data policies and cannot be scrubbed. The central tensions are context richness vs privacy; alert sensitivity vs fatigue; full capture vs cost via sampling. The main benefits are that it delivers: detects regressions quickly after releases; groups noise into actionable issues; provides stack traces and context for fast diagnosis; quantifies user impact. The main costs to budget for are: alert fatigue without tuning; risk of capturing personal or sensitive data; event volume can raise costs; grouping heuristics sometimes merge or split issues badly. Governance typically looks like this: each issue is assigned to a code owner with triage service levels. Expect adoption cost to be low: SDK integration and alert routing, and a best fit for any team shipping production software. Critics point out that teams can drown in low-value issues and ignore the dashboard, and that error tools show symptoms and often need tracing and logs to diagnose causes. Treat these concerns as design inputs, and revisit the decision as traffic, team size, and failure history change.

    Key takeaways

    • Tag every event with release and environment
    • Scrub sensitive data at the source
    • Alert on novelty and impact, not raw volume
    • Assign owners and review the backlog regularly

    ✓ When to Use

    • •Production applications where errors affect users
    • •Frequent releases that can introduce regressions
    • •Frontend and mobile clients that fail outside your visibility
    • •Teams that need ownership and triage of defects

    ✗ When Not to Use

    • •Prototypes with no real users
    • •Environments where capturing payloads would violate data policies and cannot be scrubbed
    • •Systems where all failures already surface through reliable structured alerts

    Pros

    • +Detects regressions quickly after releases
    • +Groups noise into actionable issues
    • +Provides stack traces and context for fast diagnosis
    • +Quantifies user impact

    Cons

    • −Alert fatigue without tuning
    • −Risk of capturing personal or sensitive data
    • −Event volume can raise costs
    • −Grouping heuristics sometimes merge or split issues badly

    Cost Profile

    Infrastructure

    Operational

    Cognitive

    Failure Modes

      Alternatives

        Related Patterns

          Competency Domains

          reliability opssecurity complianceeconomics evolution