[BUG] splunk: export parsing, job polling and missing values are not handled robustly
Maintainer thường phản hồi trong vòng 1 ngà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
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- data
Hướng nghiên cứu
Start in splunk/src/model/splunk-client.ts at exportSearch and convertResultsToTimeSeries, then read the polling loops in get-splunk-time-series-data.ts and get-splunk-log-data.ts. Reproduce the export failure with a mocked response containing a line without result, then make parse errors name the Splunk export response. Done means malformed job status throws, missing metric values become null, and tests cover each case; note that linked PR #898 already exists, so check it before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
A few robustness problems in the Splunk plugin make queries fail with an unhelpful error, or draw wrong data, instead of surfacing the real cause.
1. exportSearch assumes every response line carries a result
splunk/src/model/splunk-client.ts (exportSearch):
const lines = text.trim().split('\n');
const results = lines.filter((line: string) => line.trim()).map((line: string) => JSON.parse(line).result);
- A line without a
resultkey (for example amessagesline) putsundefinedintoresults. convertResultsToTimeSeriesthen readsresult._timeon that entry and throws aTypeError, so the panel fails with an error that says nothing about Splunk.- A line that is not valid JSON throws a bare
SyntaxErrorwith no context.
I have not reproduced this against a live Splunk. The failure is reproducible with a mocked export response that contains a line without result.
2. A malformed job status ends polling early
In get-splunk-time-series-data.ts and get-splunk-log-data.ts, if getJobStatus returns a malformed response the loop only logs a warning and breaks, and getJobResults is then called for a job that may not be finished. That returns partial or empty results without any error.
3. Missing values become 0 in time series
convertResultsToTimeSeries uses Number(result[metricKey]) || 0. A missing or non-numeric value is plotted as 0, which draws a false data point. null (a gap) would be more accurate.
Proposed fix
- Skip lines without a
resultinexportSearch, and wrap parse errors in an error that names the Splunk export response. - Throw a descriptive error when the job status is malformed.
- Map missing or non-numeric values to
nullinstead of0. - Add tests for each.
I'm happy to send a PR for this.
- Ngôn ngữ chính
- TypeScript
- Star
- 33
- Fork
- 92
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 perses/plugins
-
[BUG] clickhouse: getTimeSeriesData drops dimension columns, collapsing long-format results into one seriesCó thể đã có người làm @aminadojava đã nhận 37 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
perses/plugins#843 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] clickhouse: FORMAT substring check, envelope fallback and swallowed errorsCó thể đã có người làm @Yash121l đã nhận 25 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
perses/plugins#842 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
perses/plugins#501 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Module federation warnings "No required version specified"Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của perses/plugins
Issue tương tự
-
test-reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/azure-sdk-for-js#40672 · 1 reaction ·
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 74/100
HarperFast/studio#2067 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
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 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
liberation-data/drivine#639 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày