Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limit
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend, observability
Hướng nghiên cứu
Bắt đầu với packages/api/src/tasks/checkAlerts/transports/slack.ts và kiểm tra cách khối section kết hợp liên kết, tiêu đề và nội dung; sau đó đọc packages/api/src/tasks/checkAlerts/template.ts để theo dõi cách tạo các liên kết cảnh báo nội tuyến. Tái hiện lỗi bằng một liên kết cảnh báo nội tuyến dài và kiểm tra các bài kiểm thử hiện có của transport Slack. Hoàn thành khi Slack chấp nhận các thông báo cảnh báo nội tuyến quá dài và các liên kết cảnh báo ngắn hơn vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- TypeScript
- Star
- 10k
- Fork
- 508
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hyperdxio/hyperdx
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several argumentsCó thể đã có người làm @CG-5228 đã nhận 12 ngày trước. Đang mởexternal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still onCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug external Needs Feedback
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Replace `as any` mock fixtures in three app test files with shoehornCó thể đã có người làm @k4its1t đã nhận 76 ngày trước. Đang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Trace source: document spanLinksValueExpression in the v2 sources external API (OpenAPI parity)Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Tất cả issue của hyperdxio/hyperdx
Issue tương tự
-
twilio.webhook() rejects valid requests when the query string has an encoded `?` and a `+` spaceĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
twilio/twilio-node#1232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Tiling managers are not destroyed in disable(), so window-created handlers keep running (Gio.Settings constructed without schema)Có thể đã có người làm @gnacho đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
domferr/tilingshell#641 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
🐛 bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
LibreChat-AI/LibreChat#17887 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`isCI` is `true` inside a running Google Cloud Run service (also Railway, Render, Deno Deploy)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100