Skip to content

fix(website): reduce example config validation failures from 48 to 10#25936

Merged
pront merged 13 commits into
masterfrom
pront-fix-example-configs-2
Jul 23, 2026
Merged

fix(website): reduce example config validation failures from 48 to 10#25936
pront merged 13 commits into
masterfrom
pront-fix-example-configs-2

Conversation

@pront

@pront pront commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Example configs shown on vector.dev should be valid — users copy them and expect them to work. This reduces the known-failing example config validation allowlist from 48 to 10 entries.

Fixes span CUE schema overrides (missing examples for required fields), the example generator, and the validator topology wiring.

The remaining 10 failures require Rust annotation changes to resolve (CUE docs disagree with runtime enforcement, or mutually exclusive fields can't be disambiguated by the generator).

How did you test this PR?

cd website && make cue-build
node scripts/create-config-examples.js
node scripts/validate-config-examples.js
# Validated 250 examples (4 skipped, 10 known failures).
# No new validation failures.

Change Type

  • Non-functional (chore, refactoring, docs)

Is this a breaking change?

  • No

Does this PR include user facing changes?

  • No. A maintainer will apply the no-changelog label to this PR.

pront added 11 commits July 23, 2026 14:38
- Skip numeric defaults that exceed Number.MAX_SAFE_INTEGER — these are
  i64::MAX sentinel values that serde_yaml rejects as too-large integers
- Strip null values from CUE-generated object examples before use, so
  keepalive fields with null defaults don't produce YAML null keys
- Filter null values from p.items subObj and array-wrap correctly when
  topType is "array", fixing metrics/timers fields that were generated
  as plain objects instead of arrays
- Handle sources with named outputs (e.g. opentelemetry .logs/.metrics/.traces)
  by wiring a blackhole sink per output instead of the default single sink
kafka(advanced), demo_logs(advanced), file(advanced), kubernetes_logs(advanced),
and opentelemetry(minimal/advanced) all pass validation after the generator
and validator fixes in the previous commit.
The handwritten pulsar.cue defined topics as type: string, but the Rust
struct uses Vec<String>. The generated/pulsar.cue already had the
correct type: array definition, but it was shadowed by the handwritten
override. Fixed by matching the actual implementation.
The route transform produces named outputs keyed by route name, not a
default output. Wire a blackhole sink per route key so vector validate
can resolve all outputs.
pulsar(minimal/advanced) pass after the CUE type fix; route(advanced)
passes after the per-route sink wiring fix.
…rator

- Handle condition-typed fields in the generator by using the VRL syntax
  example; restrict to required fields to avoid including mutually
  exclusive optional condition pairs (e.g. reduce ends_when/starts_when)
- Add examples for throttle.threshold, throttle.window_secs, and
  delay.delay_ms via CUE overrides so the generator can produce valid
  minimal configs for these transforms
delay(min/adv), filter(min/adv), window(min/adv), throttle(min/adv) all
pass validation after adding condition type handling and CUE example fixes.
throttle(min/adv) now pass after adding threshold and window_secs examples.
- Add CUE example overrides for required fields that had no examples:
  sinks/amqp (exchange), aws_sns (topic_arn via correct generated config),
  gcp_stackdriver_logs (resource.type, project_id, log_id),
  gcp_stackdriver_metrics (project_id), mqtt (topic),
  postgres (endpoint, table), splunk_hec_logs (default_token),
  sources/vector (address), sources/static_metrics (metrics name/value),
  transforms/log_to_metric (metrics.field)
- Fix aws_sns.cue to use generated.components.sinks.aws_sns.configuration
  instead of aws_sqs (which lacked topic_arn)
- Generator: return false as fallback for required bool fields with no examples
- Generator: fix if(value) guard to if(value != null) to allow false through
- Generator: fall back to items.type.object.examples when options yield nothing
  (fixes exclusive_route routes generation)
- Validator: handle exclusive_route's routes array for named output wiring
…list

Allowlist drops from 31 to 10 entries. Remaining 10 failures are due to
docs/runtime mismatches (labels, tags, route required but CUE says optional),
untagged enum deserialization (fluent, lua), and mutual exclusion of config
fields (remap source/file, sample rate/ratio) that need upstream Rust fixes.
@pront
pront requested review from a team as code owners July 23, 2026 19:38
@github-actions github-actions Bot added docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: external docs Anything related to Vector's external, public documentation labels Jul 23, 2026
@datadog-vectordotdev

This comment has been minimized.

@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jul 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7d4199181

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread website/cue/reference/components/sinks/gcp_stackdriver_logs.cue
Comment thread website/cue/reference/components/sinks/splunk_hec_logs.cue Outdated
@github-actions github-actions Bot removed the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Jul 23, 2026
@pront
pront enabled auto-merge July 23, 2026 20:19
@pront
pront added this pull request to the merge queue Jul 23, 2026
Merged via the queue into master with commit c31ec07 Jul 23, 2026
106 checks passed
@pront
pront deleted the pront-fix-example-configs-2 branch July 23, 2026 20:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: external docs Anything related to Vector's external, public documentation no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants