Error grouping
How Maple decides which errors are the same bug: fingerprints, the grouping key, maple.fingerprint, your organization's grouping rules, the Grouping tab and similar issues.
Maple groups errors into issues in two steps:
- Every error span gets a fingerprint: one throw site and message in one service.
- A grouping key decides which fingerprints are the same bug. Fingerprints that share a key belong to one issue.
The fingerprint is deliberately fine-grained. The grouping key only ever merges fingerprints into one issue. It never splits a fingerprint apart.
Fingerprints
The fingerprint combines five things:
- The organization.
- The service (
service.name). - The exception type.
- The top 3 stack frames (only the first for a namespaced type such as
@acme/http/errors/Unauthorizedthat has a message), with line numbers, URL origins, bundle hashes, memory addresses, and minified function names removed. When the stack has frames from your own code, frames from dependencies (node_modules,site-packages, Go modules, Cargo crates and similar) and the runtime are skipped, so an error thrown inside a library groups by the code of yours that called it. - A message signature: the first 120 characters of the message after emails, URLs, quoted values, IDs, and numbers are replaced with placeholders. IDs inside a URL path are replaced too, so one failing endpoint is one issue however many customers hit it. JSON messages are normalized by key.
The message is the span’s status message, or the exception’s own message when the span has none. An error span with no exception or message, and no type beyond an HTTP status code, is fingerprinted by the span that failed, and its issue is titled with the span name.
The environment is not part of the fingerprint, so the same bug in staging and production is one issue.
A maple.fingerprint value replaces the type, frames and message. With {{default}}, the rest of the value is added to them instead, so two errors that differ only in that value get two fingerprints.
The grouping key
One bug can still produce many fingerprints: one per bundle chunk, install path or caller. The first time Maple sees a fingerprint, it reads one sample of it and computes a grouping key. A new fingerprint whose key matches an existing issue joins that issue without opening a new incident. New fingerprints that share a key and arrive together open one issue. When a key unites issues that already exist, they are folded into the one being worked on.
Maple tries these rules in order and uses the first that applies. The key is always scoped to the service.
| Rule | When | What is one issue |
|---|---|---|
| Custom key | The error carries maple.fingerprint. |
Every error with that value. |
| Span with no exception | No exception, message or type beyond an HTTP status code. | Errors from the same span. |
| Org rule | One of your grouping rules merges it. | Every error the rule matches. |
| Chunk load failures | The browser failed to load a code chunk (ChunkLoadError, failed dynamic imports). |
Every chunk load failure in the service, across deploys. |
| Same type and message | A specific error type (not a generic one such as Error or TypeError) with a message. |
Errors with that type and message signature, wherever they are thrown. |
| Same type, first function | A specific error type with no message. | Errors with that type and the same first named function in the stack. |
| Generic type, keyed on frames | A generic type such as Error, TypeError, RuntimeError or ValueError. |
Errors with the same type, frames (install paths trimmed) and message. |
A generic type names a runtime’s class of failure, so the stack has to tell two of them apart. A specific type, such as a tagged error or @acme/http/errors/Unauthorized, already names one failure, so the throw site adds nothing.
When you upload source maps, the rules that read frames use your original files and function names instead of the minified bundle, so a deploy that renames the bundle keeps the same key. The rules above them keep their priority.
A grouping key never folds an issue that is Done, Won’t fix or Cancelled. A new fingerprint joins the busiest open issue with the same key instead.
Set the grouping yourself
When the automatic grouping splits one bug into several issues, or merges two, set a maple.fingerprint attribute on the error span or on its exception event. Every error in a service that carries the same value becomes one issue, whatever its stack or message. The type, message and stack still show on the issue as usual.
import { trace } from "@opentelemetry/api"
const span = trace.getActiveSpan()
span?.setAttribute("maple.fingerprint", "checkout-payment-declined")
span?.recordException(error)
With Effect, annotate the span the error fails:
import { Effect } from "effect"
const charge = Effect.gen(function* () {
yield* Effect.annotateCurrentSpan("maple.fingerprint", "checkout-payment-declined")
// ...
})
- The value is scoped to the organization and the service: the same value in two services is two issues.
- A value on the exception event wins over one on the span.
- Surrounding whitespace is ignored, and only the first 200 characters count.
- An empty or whitespace-only value counts as unset. When the exception event’s value is unset, the span’s value applies. With neither set, Maple groups the error automatically.
- Use a fixed name for the failure, never an ID or other per-request value, or every occurrence becomes its own issue.
- Adding the attribute starts a new issue for those errors. The issue they had before stops receiving occurrences.
Split the default grouping
To keep the automatic grouping and split it further, put {{default}} in the value. {{default}} acme-corp gives one issue per default issue per value, for example one per tenant:
span?.setAttribute("maple.fingerprint", `{{default}} ${tenantId}`)
{{default}} on its own is the same as no attribute. Keep the extra value to a small, fixed set (tenants, regions, plans), never a per-request ID.
Grouping rules
Grouping rules change the grouping for your whole organization without a code change. Manage them in Settings → Automation under Error grouping rules:
- Click Add rule.
- Pick a kind and fill in the patterns.
- Click Save rules.
| Kind | What it does | Fields |
|---|---|---|
| Merge into one issue | Every error that matches is one issue per service. | Service, Exception type, Message, Frame, Title |
| Treat frames as library code | Frames that match count as a dependency’s, so they are skipped when the error has frames of your own. | Service, Exception type, Message, Frame (required) |
| Treat frames as app code | Frames that match count as your application’s, for example a vendored package or an internal library. | Service, Exception type, Message, Frame (required) |
How rules match:
- Every field is a glob:
*matches any run of characters, and the rest is literal. Matching is case-insensitive and covers the whole value, socheckout-*,*timeout*and*node_modules/@acme/*are all valid. - A rule matches only when every field you filled in matches. An empty Service matches every service.
- A merge rule needs at least an exception type, message or frame pattern. A frame rule needs a frame pattern.
- Frame is matched against a normalized stack frame line. On a merge rule it matches when any frame of the error matches.
- When several rules match, the one lower in the list wins, so put narrow rules below broad ones.
- Title names the merged issue in the Grouping tab.
- Rules only merge errors. They never split one fingerprint apart. To split, use
{{default}}. - You can have up to 100 rules, and each pattern is at most 300 characters.
A saved change applies to new fingerprints right away, and to existing fingerprints the next time each one occurs. Issues that rules already merged stay merged when you remove the rule.
Changing grouping rules needs the Manage error notifications permission (error_policy:manage), which engineers and admins have. See Roles.
The Grouping tab
The Grouping tab on an issue page explains why its errors are one issue. Issues opened by alert rules or integrations have no exceptions, so they have no Grouping tab.
Fingerprints lists every fingerprint the issue owns (up to 50 are explained). Each row shows:
- The rule that grouped it, such as Same type and message, Generic type, keyed on frames, or Org rule: followed by the rule’s title.
- A badge for how it came to the issue (see below).
- The message signature, the custom key when one was set, and the Frames read. Frames passed over as library or runtime code are listed under a collapsed “skipped as library or runtime frames” line.
- Pinned when the fingerprint was split out or unmerged by hand. A pinned fingerprint is never grouped again.
| Badge | Meaning |
|---|---|
| Own | The fingerprint the issue opened with. |
| Merged | Moved here when another issue was merged into this one. |
| Re-keyed | A new fingerprint for the same error after Maple changed how it fingerprints. |
| Grouped | Joined because its grouping key matches this issue’s. |
A Grouped fingerprint has Split out. It leaves the issue, is pinned, and its next occurrence opens an issue of its own. Use it when the grouping key joined two different bugs. A Merged fingerprint comes back by unmerging instead.
Similar issues suggests up to 5 open issues in the same service with the same exception type whose messages share at least half their words. Each shows how similar it is. Merge into this issue folds it into the one you are looking at. Maple never merges suggestions on its own.
Split out and merge need the Triage error issues permission (error_issues:triage), which members, engineers and admins have.
Merge and unmerge
Merge issues by hand when they are the same bug and no rule catches it:
- On the Errors page, select the issues and choose Merge, then pick the one to keep.
- On an issue’s Grouping tab, click Merge into this issue on a similar issue.
The kept issue takes the other issues’ fingerprints, so their future occurrences land on it. The merged issues are archived. Their timeline, pull requests and investigations stay on them, and an open incident on them is closed without a notification.
A merged issue’s page links to the issue it went into and has Unmerge. Unmerging hands its fingerprints back and pins them, so the grouping key does not join them again. Occurrences that landed on the kept issue in the meantime stay there.
Work with grouping from an assistant
The MCP server has the same tools:
| Tool | What it does |
|---|---|
explain_error_grouping |
For each fingerprint of an issue: how it got there, the rule that keyed it, the message and frames. |
list_similar_error_issues |
Open issues that may be the same bug, most similar first. Suggestions only. |
merge_error_issues |
Fold up to 50 duplicate issues into one. |
detach_error_fingerprint |
Split a Grouped fingerprint off an issue and pin it. Needs error_issues:triage. |
Grouping rules and unmerging have no MCP tool. Use the dashboard for them.
Troubleshooting
- One bug is split across many issues. Open the Grouping tab of one of them and check which rule keyed it. If the message varies in a way the normalizer does not catch, put the variable data in attributes instead of the message. Otherwise merge the issues, add a Merge into one issue rule, or set
maple.fingerprint. - Unrelated bugs share an issue. Use Split out on the fingerprint that does not belong. If a merge rule caught it, narrow the rule or add a narrower one below it.
- Browser errors open a new issue every deploy. Upload source maps so frames read your original code.
- A dependency’s frames decide the grouping. Add a Treat frames as library code rule that matches them.
- A rule change did nothing yet. Existing fingerprints are regrouped the next time each one occurs.