Skip to content

Replace Key — Update an Event in Place ​

Some events report a state that changes: an import at 10 %, 50 %, 100 %, or the health of a queue every minute. Without a key each report is a new entry, and the feed fills up. With a replace key the new report replaces the old one: the feed keeps one entry with the latest state.

Since server 2.17.0.

bash
# Monolog over TCP: three records with one key → one event that shows "import 100%"
for p in 10 50 100; do
  echo "{\"message\":\"import $p%\",\"context\":{\"replace_key\":\"import\"},\"level\":200,\"level_name\":\"INFO\",\"channel\":\"app\",\"datetime\":\"2026-11-30T10:00:00+00:00\",\"extra\":{}}" \
    | nc 127.0.0.1 9913
done

How it works ​

An event with a key replaces the stored event with the same project, type and key. Example: a Monolog event with the key import never replaces a Sentry event with the key import, and project shop never touches project default.

  • The event keeps its ID (uuid). Links to it keep working.
  • A pinned event stays pinned. Pin a status event once, and it stays in place while it updates.
  • The payload and the time are the new ones.
  • No event with that key yet: the event is stored as a new one, as usual.
  • Events without a key work as before.

In the feed, an event with a key shows a green live marker in its card header. Hover it to see the key. The card keeps its place and is updated when a new report arrives. An open event page loads the new version by itself.

Where the key comes from ​

SenderWhere to put the key
Any HTTP event (Sentry, Ray, Inspector, HTTP dumps, SMS, Xdebug traces, …)header X-Buggregator-Replace-Key
Any JSON payloadtop-level string field replace_key
Monologcontext.replace_key or extra.replace_key
Sentrytag replace_key (also the header; the tag wins over it)
SMTPmail header X-Buggregator-Replace-Key

When the header and the payload both have a key, the header wins.

For Sentry, set the tag only around the reports that should replace each other. A tag set on the global scope goes on every later error, and they would all replace one event:

php
\Sentry\withScope(function (\Sentry\State\Scope $scope): void {
    $scope->setTag('replace_key', 'nightly-sync');
    \Sentry\captureMessage('nightly sync: 120 of 500 done');
});
bash
# HTTP dump: two requests with one key → one event with the last request
curl 'http://127.0.0.1:8000/sync?step=1' -H 'X-Buggregator-Event: http-dump' -H 'X-Buggregator-Replace-Key: sync'
curl 'http://127.0.0.1:8000/sync?step=2' -H 'X-Buggregator-Event: http-dump' -H 'X-Buggregator-Replace-Key: sync'

The key is trimmed and cut to 200 bytes.

What else changes ​

  • Files that belong to the event are replaced with it: mail attachments, HTTP dump uploads, Xdebug trace files. The old ones are deleted.
  • For Sentry, the Errors page follows the replaced event: one row, the same ID.
  • Webhooks fire on every replace.
  • WebSocket clients get event.received with the same uuid again.

Limits ​

  • VarDumper events cannot be replaced: the dump has no place for a key.
  • To keep a status line in sight as well, make it sticky.