Rebuild an incident timeline from Grafana and PagerDuty

Pick a time window and see deploys, alerts, pages and acknowledgements on one merged timeline, then let an agent write the postmortem for you.

App
GrafanaPagerDutyNotionLinearEngineeringOperationsResearch & MonitoringContent Generation
PromptCreate

I want an app for assembling an incident timeline after something breaks. Today, reconstructing what happened means tabbing between Grafana and PagerDuty and copying timestamps into a doc by hand. This is a forensic surface a person opens on demand for a specific time window and scrubs through. It is not a scheduled report and nothing in it should run on a timer or a cron schedule.

The app opens on a window picker where I set a start time and an end time, and optionally narrow to a single service. Populate the service dropdown from the PagerDuty List Services handler so I am picking a real service rather than typing a name. When I confirm the window, the app assembles one merged vertical timeline from both systems.

The Grafana lane comes from Find Annotations, scoped to the selected time range, which gives me the deploy markers and manual annotations my team already records. The PagerDuty lane comes from List Incidents filtered to the same window and, when set, the chosen service. For every incident returned, also call List Alerts for Incident to get the individual alerts that were grouped into it, and List Log Entries for Incident to get the response record: when it was triggered, when someone acknowledged it, every escalation, every reassignment, and when it was resolved. Interleave all of it into a single chronological list. This merge is the entire point of the app, so acknowledgements and escalations must sit inline on the same timeline as the deploy and alert markers, never in a separate tab or a side by side pair of columns.

Normalize timestamps carefully, because the two systems do not agree on format. Grafana annotation times come back as epoch milliseconds and PagerDuty times come back as ISO 8601 strings. Convert both to a single timezone that I can set, and display each entry with its absolute time plus an offset relative to the start of the incident, for example 'plus 4m 12s'. Those relative offsets are what make a timeline readable, so do not omit them. Every entry needs a clear source badge showing whether it came from Grafana or PagerDuty, and entries that land within the same few seconds should be visually grouped rather than stacked as if they were separate moments.

Pull the alert rules covering the affected area with List Alert Rules. Be careful how you render these: an alert rule is configuration, not something that happened at a point in time, so putting rules directly on the timeline as events would be wrong and misleading. Instead show them in a context panel beside the timeline, listing which rules were watching this area during the window. Where a Grafana annotation or a PagerDuty alert can be matched to the rule that produced it, link the two so I can click from a firing on the timeline to the rule definition behind it. Note that this returns provisioned alert rules, so if it comes back empty, say the rule context is unavailable rather than implying no rules were watching.

Clicking any Grafana entry on the timeline should take me back to its source dashboard. Resolve the dashboard from the annotation's dashboard identifier using Search Dashboards and Folders, and show me the dashboard name and folder in the detail panel with a link that opens it in Grafana at the right place. If an annotation is not attached to any dashboard, say so plainly instead of rendering a dead link.

I need to add missing context inline, because the most important detail is usually the one nobody logged. From the timeline I can record a new Grafana annotation with Create Annotation, setting the text and the timestamp it belongs at, so the correction lives in Grafana for the next person and not just inside this app. I can also push a correction back to PagerDuty against a specific incident using Create Incident Note. Both write actions should show me exactly what will be recorded and where before anything is sent, and once written, the new entry appears on the timeline immediately without making me rebuild the window. Posting a PagerDuty note requires identifying the user it is posted as, so handle that in the handler rather than asking me for it every time.

Add a Draft postmortem button that kicks off a background agent against the assembled timeline. The agent reads the merged sequence, including my inline additions, and writes a structured postmortem covering four sections: a summary of what happened and the impact, the sequence of events built from the timeline with real timestamps, contributing factors, and concrete follow up actions. Hold the agent to what the timeline actually supports. It should be specific about detection and acknowledgement timing because the PagerDuty log entries genuinely provide that, and it should be explicit about gaps rather than inventing a cause where the evidence does not show one.

The agent publishes the writeup to Notion in two steps: Create a Page under a parent page or database I choose in settings to create the page with its title and properties, then Update Page Content as Markdown to push the full body in. Writing the body as markdown rather than assembling blocks by hand keeps the formatting of the sequence of events intact.

Every follow up action the agent identified gets filed as its own Linear issue through Create Issue, into a team I pick, one issue per action so they do not get buried as bullet points inside a doc nobody reopens. Each issue description should carry a short piece of the incident context and a link back to the published Notion postmortem, so an engineer picking up the ticket in three weeks knows what it came from.

Store the resulting links back in the app. The app keeps a list of every incident review it has assembled, and each row shows the time window, the service, the headline of what happened, a link to its Notion writeup, and its follow up issues with their current open or closed state so I can see at a glance which follow ups from past incidents are still outstanding. Because the postmortem agent runs in the background, show its progress on the row while it is working and surface a clear failure state if it could not finish, rather than leaving the row looking as though it never started.

Two things to handle gracefully. Both Grafana and PagerDuty retain history for a limited period, so if I pick a window that returns nothing or only partial data, say the history is unavailable or incomplete for that range instead of rendering an empty timeline that reads like a quiet night. And if only one of the two systems is connected, still render the lane you can reach and tell me the other side is missing, rather than failing the whole view.

What does this prompt do?

  • Pick a time window, and optionally a single service, and get one merged timeline: your Grafana annotations and deploy markers sitting alongside the PagerDuty record of when each page fired, who acknowledged it, and where it escalated.
  • Click any Grafana entry to jump straight to the dashboard it came from, so you can look at the graph behind a marker instead of hunting for which dashboard it lived on.
  • Add the context your tools never captured without leaving the app. Record a missing detail as a new Grafana annotation, or push a correction back onto the PagerDuty incident so the official record is right too.
  • Press Draft postmortem and a background agent reads the assembled timeline, writes up the summary, sequence of events, contributing factors and follow up actions, publishes it to Notion, and files each follow up as its own Linear issue so it does not get buried in the doc.

What do I need to use this?

  • A Grafana instance, cloud or self hosted, where your team already records annotations such as deploy markers.
  • A PagerDuty account covering the services you want to review, so the pages, acknowledgements and escalations are there to pull in.
  • A Notion workspace with the page or database where your team keeps postmortems. Remember to share that page with the connection, or nothing can be written to it.
  • A Linear workspace and a team to file follow up actions into.
  • Incidents recent enough to still be inside what your tools retain. Very old windows may come back thin or empty.

How can I customize it?

  • Change the time window the app opens with, so a review starts pre filled with the last few hours instead of asking you to pick times every session.
  • Point the postmortem at a different Notion parent page or database, and change the sections the writeup covers to match your team's template, such as adding customer impact or an incident commander.
  • Choose which Linear team follow up actions file into, and set a default priority and label so they land in the right queue.

FAQs

Do I need admin access to Grafana and PagerDuty?
No. Reading the timeline only needs read access to both. The two optional inline actions, adding an annotation in Grafana and posting a note to a PagerDuty incident, are the only things that need write access, and you can skip them entirely if you would rather keep the app read only.
Will this change anything in Grafana or PagerDuty on its own?
No. Assembling the timeline is entirely passive. Nothing is written back unless you explicitly click to add an annotation or post a note, and both actions show you exactly what will be recorded before it is sent.
Can I review an incident that happened months ago?
That depends on how long your tools keep the data. Both Grafana and PagerDuty retain history for a limited period, so an older window may return only part of the picture. When that happens the app says the history is incomplete for that range rather than showing you an empty timeline and letting you think nothing happened.
What if we use Grafana but not PagerDuty, or the other way around?
It still works, you just get one lane instead of two. The timeline renders whatever it can reach. The merged view is the point though, so most of the value comes from having both connected, since that is what puts your acknowledgements and escalations next to your deploy and alert markers.
Is the postmortem ready to publish as it is?
Treat it as a solid first draft, not a finished document. The agent can only describe what the timeline actually shows, so it is good at the sequence of events and honest about gaps, but a human still needs to add the judgement about why it happened. It lands in Notion as a normal page you can edit like any other.

Related templates

Share of voice dashboard for your brand and competitors

See how your brand's news coverage and sentiment stack up against four competitors, then let an assistant write the weekly report for you.

GDELT
Notion
Slack Bot
App
Influencer campaign roster board with AI creator briefs

Drag creators through Sourced to Wrapped on a board grouped by campaign, with audience stats on every card and a one-click brief for each creator.

HypeAuditor
Google Sheets
Notion
App
Smart home entity health cockpit for Home Assistant

Open one screen to find every unavailable, stale, or low-battery device in your smart home, see which hub is really at fault, and clear out the dead entries in bulk.

Home Assistant
Notion
App
Voice agent QA review board for your Hume EVI calls

Open one board each morning, see which voice calls went badly, replay the exact moment the caller got frustrated, and file the fix.

Hume
Linear
Slack Bot
App
Close the loop between Front tickets and Linear bug fixes

See every customer waiting on a bug fix, file the ticket without creating a duplicate, and tell them the moment engineering ships it.

Front
Linear
App
Open model approval desk for your production AI stack

See every open model your teams run in production, who approved it, and whether a quiet license change means it needs another look.

Hugging Face
Notion
Slack Bot
App

Stop rebuilding outage timelines by tabbing between two consoles.

Pick a window, read one merged timeline, and walk out with a published postmortem and follow up tickets already filed.