[BUG] splunk: export parsing, job polling and missing values are not handled robustly
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- data
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 33
- フォーク
- 91
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 37
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
perses/plugins のほかの issue
-
[BUG] clickhouse: getTimeSeriesData drops dimension columns, collapsing long-format results into one series対応中かも @aminadojava が 30 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
[BUG] clickhouse: FORMAT substring check, envelope fallback and swallowed errors対応中かも @Yash121l が 18 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
perses/plugins#842 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
perses/plugins#501 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Module federation warnings "No required version specified"再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area:web p3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Lets-Parley/Parley#912 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wealthfolio/wealthfolio#2376 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
be-BOP-io-SA/be-BOP#2817 ·
メンテナーはふだん 5 日以内に返信
-
documentation good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
sno-ai/sno-station#149 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信