Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limit
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 76/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- typescript
- Domaine
- backend, observability
Piste de recherche
Commencez par packages/api/src/tasks/checkAlerts/transports/slack.ts et examinez comment le bloc de section combine le lien, le titre et le corps ; lisez ensuite packages/api/src/tasks/checkAlerts/template.ts pour suivre la construction des liens d’alerte intégrés. Reproduisez l’échec avec un long lien d’alerte intégré et vérifiez les tests existants du transport Slack. Le travail est terminé lorsque Slack accepte les notifications d’alerte intégrées trop longues et que les liens d’alerte plus courts fonctionnent toujours.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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)
- Langage dominant
- TypeScript
- Étoiles
- 10.1k
- Forks
- 527
- Merge moyen
- 1 j 20 h
- PR mergées (30 j)
- 186
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ClickHouse/ClickStack
-
external
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ClickHouse/ClickStack#3761 ·
Les mainteneurs répondent en général sous 1 jour
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several argumentsPeut-être pris @CG-5228 l’a pris il y a 26 jours. Ouverteexternal
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ClickHouse/ClickStack#3477 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still onPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug external Needs Feedback
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ClickHouse/ClickStack#3308 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric ValuesPeut-être pris @Harshul1484 l’a pris il y a 54 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ClickHouse/ClickStack#2311 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement Needs Feedback
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
ClickHouse/ClickStack#3687 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de ClickHouse/ClickStack
Issues similaires
-
Add: GTrekkerOuvertecheck:passed streams:add
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
area: ui Bug Payload OSS
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
payloadcms/payload#19839 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
fix(auth): add the email OTP verification step to Pollar loginPeut-être pris @akansnoro l’a pris aujourd’hui. OuverteStellar Wave
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
safetrustcr/dApp-SafeTrust#584 · 10 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
The manager preset saves launch definitions without the required file and digest pairPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
Les mainteneurs répondent en général sous 1 jour