Skip to content

fix(telemetry): warn on unsupported LogPipeline processor types instead of silently skipping#2571

Open
suvvvv wants to merge 1 commit into
OneUptime:masterfrom
suvvvv:fix/logpipeline-unsupported-processor-warning
Open

fix(telemetry): warn on unsupported LogPipeline processor types instead of silently skipping#2571
suvvvv wants to merge 1 commit into
OneUptime:masterfrom
suvvvv:fix/logpipeline-unsupported-processor-warning

Conversation

@suvvvv

@suvvvv suvvvv commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What

LogPipelineProcessorType defines GrokParser, and processors of that type can be created via the UI/API — but LogPipelineService.applyProcessor() has no case for it, so it falls through to:

default:
  return logRow;   // silently does nothing

The log passes through unchanged with no signal, so an operator who creates a GrokParser processor has no way to tell why it never transforms anything.

This change logs a clear warning (naming the processor and its type) in the default branch, while still returning the log unchanged:

default:
  logger.warn(
    `LogPipeline processor "${processor.name}" has unsupported processorType "${processor.processorType}" and was skipped. This processor type is not yet implemented and will not transform logs.`,
  );
  return logRow;

This matches the issue's suggested option (surface a warning) without taking on a full grok implementation.

Why

Addresses the "silently does nothing" half of #2515 — unimplemented processor types are now observable in the logs instead of failing quietly on the ingest path.

Tests

LogPipelineService.processLog previously had no unit coverage. This adds it:

  • AttributeRemapper — remaps source→target and drops the source; honours preserveSource.
  • SeverityRemapper — maps a matching value to severityText/severityNumber; leaves the log unchanged on no match.
  • CategoryProcessor — tags the log with the first matching category.
  • Unsupported type (GrokParser) — returns the log unchanged and logs a warning (this assertion fails without the source change, confirming it's a real regression guard).
  • Filter gating — processors don't run when the pipeline filter doesn't match.
  • No mutationprocessLog doesn't mutate the input log row.
node node_modules/.bin/jest --config jest.config.json --runInBand ./Tests/Telemetry/LogPipelineService.test.ts
# 8 passed

Prettier-clean; source lints clean.

Refs #2515

…ad of silently skipping

LogPipelineProcessorType defines GrokParser, and processors of that type can
be created via the UI/API, but applyProcessor has no case for it — it falls
through to `default: return logRow`. The log passes through unchanged with no
signal, so operators cannot tell why a GrokParser processor never transforms
anything.

Log a warning (naming the processor and its type) in the default branch so
the unimplemented-processor situation is observable, while still returning the
log unchanged.

Also adds the first unit tests for LogPipelineService.processLog, which had no
coverage: AttributeRemapper (remap + preserveSource), SeverityRemapper (match
and no-match), CategoryProcessor, the unsupported-type warning, pipeline filter
gating, and the no-mutation guarantee.

Refs OneUptime#2515

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simlarsen

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants