Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limit
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend, observability
調査の方向性
まず packages/api/src/tasks/checkAlerts/transports/slack.ts を確認し、セクションブロックがリンク、タイトル、本文をどのように組み合わせるかを調べます。次に packages/api/src/tasks/checkAlerts/template.ts を読み、インラインのアラートリンクがどのように作られるかを追います。長いインラインのアラートリンクで障害を再現し、既存の Slack トランスポートのテストを確認します。長すぎるインラインのアラート通知が Slack に受け入れられ、短いアラートリンクも引き続き機能することを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- TypeScript
- スター
- 10.1k
- フォーク
- 527
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 186
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ClickHouse/ClickStack のほかの issue
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ClickHouse/ClickStack#3761 ·
メンテナーはふだん 1 日以内に返信
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several arguments対応中かも @CG-5228 が 26 日前に担当しました。 オープンexternal
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ClickHouse/ClickStack#3477 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still on再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug external Needs Feedback
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ClickHouse/ClickStack#3308 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric Values対応中かも @Harshul1484 が 54 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ClickHouse/ClickStack#2311 ·
メンテナーはふだん 1 日以内に返信
-
enhancement Needs Feedback
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ClickHouse/ClickStack#3687 ·
メンテナーはふだん 1 日以内に返信
ClickHouse/ClickStack の issue をすべて見る
似ている issue
-
Add: GTrekkerオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area: ui Bug Payload OSS
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
payloadcms/payload#19839 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
fix(auth): add the email OTP verification step to Pollar login対応中かも @akansnoro が今日担当しました。 オープンStellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
safetrustcr/dApp-SafeTrust#584 · コメント 10 件 ·
メンテナーはふだん 1 日以内に返信
-
The manager preset saves launch definitions without the required file and digest pair対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信