A failed request is returned under the refId `__queryDataError`, so Grafana alerting reads "no data"
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/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ệ
- go, grafana
- Lĩnh vực
- backend, observability-sre
Hướng nghiên cứu
The error keys are set in pkg/quickwit/elasticsearch.go (__queryDataError) and pkg/quickwit/quickwit.go (__qwQueryDataError). Start by reading how req.Queries and the RefID of each query are passed into those response builders, then reproduce the outage by checking the response map returned for a request. Done when every query in the request gets its own error response under its refId, and a test shows the error is keyed by refId in both code paths.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When Quickwit does not answer, the plugin returns the error under a fixed refId. It does not use the refId of the query. Grafana alerting finds no response for the query and reads the result as "no data". An alert rule then leaves the state Alerting, and it fires again when Quickwit is back.
Versions
- Grafana 13.0.1
quickwit-quickwit-datasource0.6.3- Quickwit 0.9.3
Reproduction
- Start Quickwit 0.9.3 and Grafana 13.0.1 with the plugin 0.6.3, for example with docker compose (
GF_INSTALL_PLUGINS: "quickwit-quickwit-datasource 0.6.3"). - Create an index, add some documents, and add the datasource.
- Create an alert rule with one Quickwit query (refId
A, metric Count, a date histogram). Add a Reduce expression and a Threshold expression. SetnoDataState: OKandexecErrState: KeepLast. - Add documents that make the rule fire. The state is
Alerting, and the contact point gets one message. - Stop the Quickwit container.
- Wait for the next evaluation.
Observed
- The state of the rule changes to
Normal (NoData). The contact point gets a "resolved" message. - After Quickwit starts again, the rule fires again. The contact point gets the same alert a second time.
execErrStatehas no effect, because Grafana sees no error for the query.- The response of
/api/ds/queryin the outage: HTTP 400, withresults.__queryDataError.errorset,errorSource: plugin,status: 500, andframes: []. The response has no entry for the refIdA. - The Grafana log has this line:
Can't find response by refID. Return nodata responseRefIds=[__queryDataError].
A second case has the same cause. When Grafana restarts while Quickwit is down, the datasource cannot start. The plugin then returns the error under the refId __qwQueryDataError.
Cause
Two places in the code use a fixed key for the error response:
pkg/quickwit/elasticsearch.go:result.Responses["__queryDataError"] = backend.ErrDataResponse(...)pkg/quickwit/quickwit.go:response.Responses["__qwQueryDataError"] = backend.ErrDataResponse(backend.StatusInternal, "Datasource initialization failed")
Proposed fix
Return the error under the refId of each query of the request. For each query in req.Queries, set Responses[query.RefID] to the error response. Grafana then sees an error for the query, and execErrState applies.
Workaround
Give the query of the alert rule the refId __queryDataError. Grafana then finds the error under the refId of the query, and execErrState: KeepLast keeps the state. This workaround does not cover the second case (__qwQueryDataError).
- Ngôn ngữ chính
- TypeScript
- Star
- 76
- Fork
- 45
- 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
- Không 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 quickwit-oss/quickwit-datasource
-
Độ 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 74/100
-
Missing or malformed log fields for entries fetched by Grafana's "Scroll to load more" functionalityĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Tất cả issue của quickwit-oss/quickwit-datasource
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ardia-browser/ardia#4778 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[M09] Silence parser misreads ffmpeg times in scientific notation (6.25e-05 → 6.25 s)Có thể đã có người làm @G-darshan-32 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
clipy-recorder/clipy#164 · 1 bình luận ·
-
bug from-app needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightly-labs/openbot#18462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fast and light shell approval "Always allow" button shows raw English backticks and scrambles commands in ArabicCó thể đã có người làm @tylerbea đã nhận hôm nay. Đang mởagent-ui bug p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Windows: Ctrl+C / Ctrl+V not working in chat input boxCó thể đã có người làm @PranavTJ-05 đã nhận hôm nay. Đang mởcomp/desktop desktop/chat desktop/shell os/windows P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
NousResearch/hermes-agent#161023 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày