Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limit
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 76/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- backend, observability
Rechercherichtung
Beginne mit packages/api/src/tasks/checkAlerts/transports/slack.ts und prüfe, wie der Abschnittsblock Link, Titel und Text kombiniert; lies anschließend packages/api/src/tasks/checkAlerts/template.ts, um nachzuvollziehen, wie Inline-Alert-Links erstellt werden. Reproduziere den Fehler mit einem langen Inline-Alert-Link und prüfe die bestehenden Tests für den Slack-Transport. Fertig ist die Arbeit, wenn übergroße Inline-Alert-Benachrichtigungen von Slack akzeptiert werden und kürzere Alert-Links weiterhin funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Slack notifications for inline alerts fail when the alert's chart config is large. The alert does fire, but HyperDX records WEBHOOK_ERROR: Failed to send notification to webhook "<name>" and nothing reaches Slack. The same alert set up as a tile alert posts fine.
Cause
For an inline alert, buildAlertMessageTemplateHdxLink (packages/api/src/tasks/checkAlerts/template.ts) links to the chart explorer with the alert's whole chartConfig URL-encoded in the query string (buildChartExplorerLink). Saved-search and tile alerts link to /search/<id> or the dashboard, which are short.
The Slack transport (packages/api/src/tasks/checkAlerts/transports/slack.ts) puts the link, the title and the body into a single section block:
blocks: [{ type: 'section', text: { type: 'mrkdwn', text: `*<${message.hdxLink} | ${message.title}>*\n${message.body}` } }]
Slack limits a section block's text to 3000 characters, and the URL counts toward that limit even though Slack only shows the title. So once the encoded config, the title and the body pass 3000 characters, Slack rejects the message.
Example (HyperDX 2.39.1)
An inline builder alert on a metrics source with 8 histogram series (quantile p99, one metricName each):
- Each series becomes about 280 characters of the link, because the stored config adds
aggCondition,aggConditionLanguage,isDeltaand similar fields and URL encoding roughly multiplies JSON by 1.4. - With series aliases, a descriptive name and display settings (
numberFormat,fitYAxisToData), the link was about 3100 characters. Every notification failed withWEBHOOK_ERROR. - After removing the aliases, display settings and most of the name, the link was about 2580 characters and the notification posted.
- A raw SQL inline alert with about 1700 characters of SQL produces a link of about 2500 characters and is right at the edge.
So a perfectly ordinary alert silently loses its notifications. The only sign is an executionErrors entry on the alert.
Suggestions
Any of these would fix it:
- Link inline alerts to something short, for example the alert itself (an alerts page or anchor by alert id), or a server-side stored chart that opens by id, instead of encoding the whole config in the URL.
- In the Slack transport, if the section text would pass 3000 characters, fall back to a shorter link (the alerts page) or put the link in a separate block or button. A button
urlallows up to 3000 characters on its own. - At minimum, warn when saving an inline alert whose notification link would exceed the Slack limit, and say in the
WEBHOOK_ERRORthat the message was too long.
Environment
- HyperDX 2.39.1 (ClickStack Helm chart 3.4.0), Slack incoming webhook
- Alert source: inline (created through the MCP
clickstack_save_alerttool / external API)
- Vorherrschende Sprache
- TypeScript
- Sterne
- 10.1k
- Forks
- 527
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 186
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ClickHouse/ClickStack
-
external
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ClickHouse/ClickStack#3761 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several argumentsEvtl. vergeben @CG-5228 hat das vor 26 Tagen übernommen. Offenexternal
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ClickHouse/ClickStack#3477 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still onEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug external Needs Feedback
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ClickHouse/ClickStack#3308 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric ValuesEvtl. vergeben @Harshul1484 hat das vor 54 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ClickHouse/ClickStack#2311 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement Needs Feedback
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
ClickHouse/ClickStack#3687 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ClickHouse/ClickStack
Ähnliche Issues
-
Add: GTrekkerOffencheck:passed streams:add
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
area: ui Bug Payload OSS
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
payloadcms/payload#19839 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
fix(auth): add the email OTP verification step to Pollar loginEvtl. vergeben @akansnoro hat das heute übernommen. OffenStellar Wave
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
safetrustcr/dApp-SafeTrust#584 · 10 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
The manager preset saves launch definitions without the required file and digest pairEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
Maintainer antworten meist innerhalb von 1 Tag