Skip to content

Add validate_docs parameter to ingest settings#5984

Merged
guilload merged 1 commit intomainfrom
guilload/disable-ingest-schema-validation
Nov 17, 2025
Merged

Add validate_docs parameter to ingest settings#5984
guilload merged 1 commit intomainfrom
guilload/disable-ingest-schema-validation

Conversation

@guilload
Copy link
Member

Description

Add validate_docs parameter to ingest settings. Default to true. We have a use case for this parameter at Datadog. This could also be used for OTEL indexes and by users who know that their documents are always well-formed to shave a few CPU cycles.

How was this PR tested?

Updated index config unit tests

/// Note that when a source has a VRL transform configured, documents are not validated against
/// the doc mapping during ingestion either.
#[schema(default = true, value_type = bool)]
#[serde(default = "true_fn", skip_serializing_if = "is_true")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why skip_serializing_if? In most case it is better to serialize defaults no?
Here this is index config, so the data is deserialized -> serialized and end up in the metastore.

Serializing the default ensure changing default won't affect existing indexes, which is usually a good thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you with one caveat: after adding a new field, if you have to rollback then the cluster is borked because of the deny_unknown_fields that we have. Maybe we should remove them and use serde_ignored instead to log a warning.

@guilload guilload merged commit 423e7ab into main Nov 17, 2025
8 checks passed
@guilload guilload deleted the guilload/disable-ingest-schema-validation branch November 17, 2025 18:09
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