[BUG] splunk: export parsing, job polling and missing values are not handled robustly
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- data
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 33
- Forks
- 91
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 37
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de perses/plugins
-
[BUG] clickhouse: getTimeSeriesData drops dimension columns, collapsing long-format results into one seriesPosiblemente ocupada @aminadojava la tomó hace 30 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
[BUG] clickhouse: FORMAT substring check, envelope fallback and swallowed errorsPosiblemente ocupada @Yash121l la tomó hace 18 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
perses/plugins#842 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
perses/plugins#501 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Module federation warnings "No required version specified"Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de perses/plugins
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
better-auth/better-auth#12132 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hurttlocker/o8#5112 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
agent-of-empires/agent-of-empires#5098 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día