Linking Sentry errors to your logging tools #62618
Replies: 8 comments 5 replies
-
I would recommend taking a look through notion to see how teams currently handle log queries in our own systems. :) Here's a quite extensive set of queries from 3S for various systems that they care about. Here's how one of those translates to a URL:
|
Beta Was this translation helpful? Give feedback.
-
I would aim to recommend attaching the trace/span ID to link logs to errors/spans/crons. With the tracing without performance initiative, every event generated from an sdk should have a trace and span ID attached to them. This way we have a couple of benefits:
|
Beta Was this translation helpful? Give feedback.
-
+1 on making it easier to jump from a Sentry issue to logging services (the "Linking to Logs from Sentry" section); it should reduce manual work required to search for the related logs file, and hence bring down the mean-time-to-repair. Following up on the idea, a few notes/ideas:
Generally speaking, if we add support for user-defined links, it'll allow to link Sentry issues not only to logging services, but pretty much any other. I drafted a more generic proposal some time ago here (internal for now). |
Beta Was this translation helpful? Give feedback.
-
+1 on this feature. We would use this to link from Sentry to Kibana to view ElasticSearch logs. Using the Sentry event_id is not useful, however being able to construct a link using timestamps, tags, and context would be perfect. Being able to build the timestamp in arbitrary formats will be crucial. It would also be useful to display multiple links. For example, links to multiple logging systems, or different views within the same logging system. |
Beta Was this translation helpful? Give feedback.
-
The link would change for each event (not just issue). The idea is, upon seeing an error event in Sentry, click the "view logs" link for that event, to be taken to our logging system, and see logs related to that event. In our case, we'd likely have one link that views all logs related to that event across all systems. Another link that showed the user's activity immediately before/after the error event (so we could see what might have led up to the error, and attempt to reproduce it ourselves).
epoch (seconds), epoch (milliseconds), ISO 8601. |
Beta Was this translation helpful? Give feedback.
-
This sounds like a feature I'd use fairly frequently when triaging sentry reports if it was available.
We use Datadog.
Yes.
Yes.
adamgsg's suggestions match what I'd like. Being able to pull in tags like environment, request_id, trace_id, etc would mean better scoping of log searches.
|
Beta Was this translation helpful? Give feedback.
-
Really cool feature idea! A question/concern I had regarding the URL link experience: I wonder if Sentry would get pinged a lot if the link/url is "broken," but the client just doesn't have the data retention policy for the logs. If the user clicks on the url, it takes them to, for example, gcp, but their log retention policy is only 24 hours, would the user think something is broken on Sentry side? Would each log vendor have a different experience? Maybe GCP just loads the default view, but Datadog it 404s? Would it be a misleading experience for the user? |
Beta Was this translation helpful? Give feedback.
-
We would love this feature. We have a uniquely generated event ID for all our requests, and we generate a link to our self hosted version of Kibana which contains that value. We then use Sentry to add a tag with that Kibana link. Unfortunately, we're limited by only being able to add 200 characters, and the link is significantly longer. e.g. here's a link which is for a search of It gets even more obnoxious if you add specific dates in as well. The time component becomes: I hope this helps - we'd be delighted to test and help. |
Beta Was this translation helpful? Give feedback.
-
Error details, Replays, and Breadcrumbs in Sentry Issues are beneficial for debugging and fixing app problems. However, we know there are cases when you’d want to review your logs as well to get a more exhaustive picture of what transpired when the error occurred.
We’re brainstorming an idea that lets you navigate directly from an error event in Sentry to the corresponding logs in your logging tool.
How might this work?
Sharing Context between Logs and Sentry
When an error occurs, the Sentry SDK captures it along with a unique
event_id
. Thisevent_id
can be programmatically accessed and then included in your logging statements. For example, in a Python application:Linking to Logs from Sentry
On the Sentry side, we’d ask you to add configuration details of your logging integrations:
With these details, Sentry could construct a URL for each error event you view in our app
This would allow you to jump to your logs as you view various errors in Sentry.
We need your feedback 🙏
We’d love your input on the questions above and please let us know if there’s anything we’re missing or should do differently.
Beta Was this translation helpful? Give feedback.
All reactions