How to debug a client's app when you can't SSH in
Sentry captures the context that a client's "it's broken" message never contains, provided you put the right data in tags and the rest in context.
In brief
- Sentry uses fingerprints to group similar events into one issue, so you can see at once which error happens most often
- Breadcrumbs show what the user just did, tags show which group the error falls in, and the release shows which deploy caused it
- Before bringing Sentry into a client's system, plan for scrubbing sensitive data, enabling tracing and the limits of the self-hosted version
At 10pm, a client sends a message: “The order approval screen is blank again.” In this hypothetical case, you have no access to their server, and you don’t know which users are affected or since when. How fast you fix it depends mainly on how much context you have; the complexity of the code is seldom the deciding factor.
For an FDE, this is familiar territory. The application you built runs in someone else’s environment, errors happen when you are not there, and the person reporting them is usually not an engineer. Sentry is the tool that brings that context back to your desk.
What does Sentry do beyond catching exceptions?
Sentry began as an open-source project. Today the company describes its mission as helping every developer diagnose, fix and optimize the performance of their code. The important word is “diagnose”: catching an error is only the first step, and the real value lies in how Sentry organizes errors.
The basic unit is the event, a single occurrence of an error. Left as they are, 500 events are 500 lines that tell you nothing. Sentry uses fingerprints to group similar events into issues, so you can see how often a problem recurs and which error to prioritize.
Each issue has an Issue Details page. Its Stack Trace section points to the line of code where the event failed. Breadcrumbs record the sequence of events before the error and, because they are structured data, carry more information than traditional logs.
Three kinds of context, three different uses
Newcomers often confuse tags with context. At a client site, that mistake means you cannot filter when you need to. The table below summarizes the difference:
| Data type | What it is | Use it when |
|---|---|---|
| Tag | A key/value pair of strings, indexed and searchable | You need to filter: which browser, device or user does this error affect? |
| Context | A group of related data that helps with debugging, not searchable | You need the details after opening a specific event |
| Breadcrumbs | A timeline of events before the error | You need to know what the user or system did just before the failure |
The rule that follows is simple. Put anything you will want to query as “how many errors belong to group X” in a tag. Keep anything you only need when examining a specific case in context.
With the JavaScript SDK, a minimal configuration for an order approval app might look like this (the release name and values are for illustration only):
Sentry.init({
dsn: "<project DSN>",
release: "order-approval@2.4.1",
sampleRate: 1.0,
});
// Tag: you will need to filter by branch
Sentry.setTag("branch_id", "new-branch-07");
// Context: only read when opening a specific event
Sentry.setContext("order", { orderId: "ORD-1024", status: "pending" });
The branch code is a tag because sooner or later you will ask whether an error happens at only one branch. The order ID and status are context because they help only when you are examining an event. The release line will matter at the end of the case below.
A worked case: the blank order approval screen
Return to that 10pm message, and say the app has had Sentry installed from the start. You open the dashboard and find a new issue with several hundred events: several hundred blank screens that fingerprinting has grouped into one problem. This is a single recurring error rather than hundreds of different ones.
The stack trace points to the line that reads a field in the order data. Breadcrumbs show that just beforehand the user opened the filter and then called the API that lists orders. You filter by the branch_id tag and see that the error appears in only one group of users, say those at a branch recently added to the system.
The last piece is the release. In Sentry, a release is a version of the code deployed to an environment. With releases in place, Sentry can suggest the commit that probably caused the error and the person likely to be responsible.
If the issue was previously resolved and now reappears in a new release, Sentry marks it as a regression. One look tells you that this afternoon’s deploy brought the old error back.
Before the client has sent another screenshot, you can say what the error is, which line it is on, which users it affects and which version it came from. The first thing to do is tell the client the scope of the impact; the fix comes second. Clients usually need to hear “only the new branch is affected” before they need the patch.
Where teams trip up in a client’s system
The biggest risk is data. The more information breadcrumbs and context hold, the more easily they pick up end users’ emails, phone numbers or tokens. Sentry can scrub sensitive information on the server side just before storing it. For an app running in a client’s system, configure this before you turn Sentry on in production, and don’t leave it for later.
The second trap is sampling. By default, the SDK sends every error because the error sample rate is 1. Transactions and traces are not sent unless you configure them. So when the client complains that the app is “slow” rather than “broken,” a default installation gives you no performance data at all.
The third appears when the client requires an on-prem deployment. Sentry has a self-hosted version, but it is a minimal setup with no guarantees or dedicated support team. If you go this way, agree clearly with the client on who will operate and upgrade it, and don’t assume that person is you.
Sentry also offers Seer, an AI debugging agent that scans incoming issues to find root causes and automates triage. Seer is useful when there are many issues, but it can work only with the context you have sent. Without tags and releases, any agent has to guess.
What to learn first, and how to test yourself
A sensible order is to become fluent in reading the Issue Details page, attach a release to every deploy, design a set of tags for your domain, and only then move on to data scrubbing and tracing. Each step can be tried on a side project in an evening.
As a self-test, take the order approval app above and decide whether each of these five fields belongs in a tag or in context: the user’s role (employee or manager), the browser, the list of products in the order, the environment (staging or production), and the response body of the API that lists orders.
Suggested answer: user role, browser and environment are tags, because you will want to ask whether an error affects only managers, only one browser or only production.
The product list and the API response are context, because they help only when you are examining an event. These two fields are also where sensitive data slips in most easily, so they must go through data scrubbing.
Once you have done this exercise on a side project, put it on your CV exactly as you did it. A line such as “designed the tag set, release tracking and PII scrubbing for the app’s error monitoring” carries far more weight than “familiar with Sentry.”
After go-live at a client site, the next time the client thinks of you is usually when something breaks. Whether you can say at once what the error is, where it is and which version it came from, or must wait for another screenshot, depends largely on how you configured Sentry from the day you deployed.
Was this article useful?
Thanks for the feedback!