Repository navigation
[config] Catch more init errors in configtest - #1525
Merged
Merged
Conversation
Configtest now also catches the following errors, which so far showed up only at the init time: - Probes: missing targets, bad run_on regex, invalid schedule, and validator errors (missing or duplicate name, bad regex, etc). - Duplicate probe names, among the probes that don't set run_on. - Surfacer options: bad latency_metric_pattern, bad metric name regexes, label filter without a key.
Configtest now also catches: - Targets: bad regex, bad static endpoints (e.g. duplicates), and bad DNS options (dns_server along with dns_options.server, bad server address, max_cache_age_sec smaller than ttl_sec). - Reference to shared targets that are not defined. - Invalid source_ip, or source_ip that doesn't match the ip_version.
Surfacers usually don't have a name, in which case the error said 'surfacer ""'. Fall back to the surfacer type, like we do for the surfacer's logger at the init time.
manugarg
added a commit
that referenced
this pull request
Nov 15, 2026
Follow-up to #1525. That PR covered checks common to all probes; this one covers the config-only checks that live in each probe type's Init, so they now fail -configtest instead of showing up only at startup. Each of HTTP, DNS, PING, TCP, EXTERNAL, SQL, GRPC, EXTERNAL_GRPC and BROWSER gets a ValidateConfig(c, opts) function. The probe's Init calls it first, and configtest calls it through the new probes.ValidateConfig().
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.
-configtestchecks only config parsing and a handful of probe fields, so many config mistakes pass it and then fail at startup. This moves a first batch of pure config checks to where configtest can reach them.Configtest now also catches:
targets, badrun_onregex, invalid schedule, validator errors (missing or duplicate name, bad regex, bad HTTP status range, bad jq filter), and invalidsource_ipor one that doesn't matchip_version.run_on.regex, bad static endpoints (e.g. duplicates), and bad DNS options (dns_serveralong withdns_options.server, bad server address,max_cache_age_secsmaller thanttl_sec). Same checks apply to theshared_targetsdefinitions.shared_targetsthat are not defined.latency_metric_pattern, bad metric name regexes, label filter without akey.Notes
run_onare skipped in the duplicate name check. Two probes can share a name as long as they don't end up on the same host, and configtest can't tell which host the config is meant for.ValidateProbeConfignow requires targets (for the probe types that need them), initializes validators and parsessource_ip;BuildProbeOptionsno longer does these itself.source_interfaceis still resolved inBuildProbeOptions, as it depends on the host.targets.Validate()is called only from configtest. Init still goes throughtargets.New, so nothing is validated or logged twice at startup.Schedule: ...info log moved fromparsePeriodtoNewSchedule, so it's still logged once.dns_options.servernow logs an INFO line (Overriding default resolver with: ...) during configtest, as the resolver options parser logs it.Not covered yet
Errors that come from probe-type specific
Init, type-specific targets (RDS, k8s), servers, tracing, and alert notifiers still show up only at init. Those need validation to be split out from resource creation first.