Skip to content

Log data stream config notices once per stream instead of per document#6979

Open
nsa-softpay wants to merge 1 commit into
opensearch-project:mainfrom
nsa-softpay:fix/6972-datastream-config-notice-log-spam
Open

Log data stream config notices once per stream instead of per document#6979
nsa-softpay wants to merge 1 commit into
opensearch-project:mainfrom
nsa-softpay:fix/6972-datastream-config-notice-log-spam

Conversation

@nsa-softpay

Copy link
Copy Markdown

Description

The opensearch sink logs configuration notices for data streams inside DataStreamIndex, which is reached from EventActionResolver.resolveAction once per event. As a result these notices are emitted once per ingested document at WARN:

  • first-write-wins behavior when a document_id is configured
  • routing configuration being ignored
  • coercion of a configured non-create action to create

On a high-volume pipeline this produces one WARN line per document (e.g. ~190M/day), which dominates log output and drowns out genuine warnings and errors, while describing configured, expected behavior rather than a per-record fault.

This change dedupes the notices by (data stream, notice type) using a ConcurrentHashMap-backed set so each notice is logged at most once per data stream while preserving the informational intent. The action returned by determineAction is unchanged.

Issues Resolved

Resolves #6972

Check List

  • New functionality includes testing.
    • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

The opensearch sink logs configuration notices for data streams
(first-write-wins document_id, unsupported routing, and action
coercion to `create`) inside determineAction, which runs once per
event. On high-volume pipelines this emits one WARN per ingested
document, dominating log output.

These notices describe configured, expected behavior rather than a
per-record fault, so dedupe them by (data stream, notice type) and log
each at most once per data stream. The returned action is unchanged.

Resolves opensearch-project#6972

Signed-off-by: nsa-softpay <nsa@softpay.io>
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.

[BUG] OpenSearch sink logs a WARN per document for first-write-wins document_id on data streams — excessive log volume

1 participant