feat!: multi-source VictoriaLogs (v2.0.0 part 1, #34)#36
Merged
fxthiry merged 1 commit intorelease/2.0.0from Apr 16, 2026
Merged
feat!: multi-source VictoriaLogs (v2.0.0 part 1, #34)#36fxthiry merged 1 commit intorelease/2.0.0from
fxthiry merged 1 commit intorelease/2.0.0from
Conversation
`victorialogs:` becomes a `BTreeMap<String, VlSourceConfig>` indexed by
source name. Rules gain an optional `vl_sources: [name, ...]` field;
absent means fan out to every configured source. The engine spawns one
task per (rule, source) pair with per-source cancellation and reconnect
isolation, so a single unhealthy source does not stop alerts on the
others.
Synthetic `vl_source` is injected into every render context where
`rule_name` already flowed: layer 1 templates (title, body,
email_body_html), throttle.key, and notifier-level layer 2 contexts.
The default throttle key becomes `{rule}-{source}:global` so multi-source
deployments get isolated buckets per source out of the box.
Source names are restricted to `^[a-zA-Z0-9_]+$` to keep the default
throttle key separator (`-`) unambiguous. Rules reject duplicate
`vl_sources` entries at load. The legacy single-URL config shape is
rejected with an actionable migration error.
`AlertPayload.vl_source` propagates end-to-end. The Mattermost footer
gains a source segment and the default webhook payload exposes
`vl_source` as a top-level JSON field. See CHANGELOG v2.0.0 Breaking
section for the full migration.
Tests consume the fixtures corpus (PR #35). The new
`tests/multi_source_integration.rs` exercises the full routing matrix
across two wiremock VL backends, including a negative-evidence assertion
that a pinned rule does not leak to the unpinned source.
Observability and guardrails (metrics `vl_source` label,
`valerter_vl_source_up` gauge, `max_streams` cap, reconnect jitter) ship
as a separate spec part 2 before the v2.0.0 tag.
Cargo.toml not bumped here; version bump lives in the release PR.
This was referenced Apr 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #34 — multi-source VictoriaLogs support. Part 1 of 2 for v2.0.0. Part 2 (observability + guardrails: metrics
vl_sourcelabel,valerter_vl_source_upgauge,max_streamscap, reconnect jitter) ships as a follow-up PR before the v2.0.0 tag.What ships
victorialogs:is now aBTreeMap<String, VlSourceConfig>. Each source carries its own URL, basic_auth, TLS, headers.vl_sources: [name, ...]. Absent fans out to all sources. Engine spawns one task per(rule, source)with per-source cancellation and reconnect isolation.{{ vl_source }}injected into every render context whererule_namealready flowed (layer 1 templates, throttle.key, layer 2 notifier templates). Synthetic wins on collision.{rule}-{source}:global(per-source bucket isolation by default).^[a-zA-Z0-9_]+$to keep the default key separator unambiguous.AlertPayload.vl_sourcepropagated end-to-end. Mattermost footer + default webhook payload extended (see Breaking changes in CHANGELOG).Validation
cargo test— 540 tests pass (468 lib + 72 integration, +17 lib +5 integration vs baseline)cargo clippy --all-targets --all-features -- -D warnings— cleancargo fmt --check— cleancargo run --bin valerter -- --validate -c config/config.example.yaml— exit 0, printsVictoriaLogs sources: 1 [default=...]{{ vl_source }}correctly rendered to the originating source name per task. Zero error, per-source isolation confirmed.Out of scope (part 2)
The following ships as a separate follow-up PR before the v2.0.0 tag:
vl_sourcelabel on existing counters (breaking for dashboards)valerter_vl_source_up{source}gaugedefaults.max_streamscap with load-time enforcement/metricssnapshot test