Skip to content

[probes] Validate probe type specific config in configtest - #1563

Merged
manugarg merged 4 commits into
mainfrom
configtest-probe-types
Nov 15, 2026
Merged

manugarg merged 4 commits into
mainfrom
configtest-probe-types

Conversation

@manugarg

@manugarg manugarg commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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().

Configtest now also catches:

  • HTTP: relative_url not starting with / (still redacted with redact_url_query_in_logs), bad proxy_url, bad response_metrics_options.
  • HTTP, DNS, BROWSER: requests_per_probe * requests_interval_msec + timeout exceeding the interval. The check is now shared (options.ValidateRequestsDuration()) and compares in milliseconds as int64, so very large values no longer overflow and pass. The error now shows the requests part in milliseconds and the timeout separately.
  • DNS: invalid query_type.
  • PING: payload_size out of bounds.
  • TCP: tls_config with tls_handshake explicitly set to false.
  • EXTERNAL: empty or unparseable command, bad output_metrics_options.
  • SQL: missing flavor, both query and query_file, validators or response_metrics_options without a query, bad response_metrics_options.
  • GRPC: both body and body_file.
  • EXTERNAL_GRPC: missing server or probe_type, bad output_metrics_options.

Notes

  • Payload parsers and the HTTP proxy settings are now built twice at init: once to validate and once for real. Both are cheap and don't log, so this seemed better than restructuring each Init.
  • The DNS query type error no longer starts with dns_probe(<name>):. Configtest and startup init prefix the probe name; probes added through the AddProbe gRPC call get the error without it, like the other probe types' errors already do.
  • The gRPC check for an xds scheme in a build without xds support stays in Init only. It depends on the build tags, and configtest may run on a different build than the one that runs the probe.
  • SQL still checks for an empty query_file at init, as that's only known after reading the file.

Not covered yet

Starlark (compile errors, empty tls_configs key), and checks outside probe types: RDS and k8s targets, alert notifiers, probestatus surfacer defined twice, prometheus and bigquery surfacer checks, servers, and tracing.

Add ValidateConfig() to the probe types that have config-only checks in
their Init: HTTP, DNS, PING, TCP, EXTERNAL, SQL, GRPC, EXTERNAL_GRPC and
BROWSER. Init calls it first, and configtest calls it through the new
probes.ValidateConfig(), so these errors now fail configtest instead of
showing up only at startup:

- HTTP: relative_url not starting with '/', bad proxy_url, bad
  response_metrics_options.
- HTTP, DNS, BROWSER: requests_per_probe * requests_interval_msec +
  timeout exceeding the interval.
- DNS: invalid query_type.
- PING: payload_size out of bounds.
- TCP: tls_config with tls_handshake explicitly set to false.
- EXTERNAL: empty or unparseable command, bad output_metrics_options.
- SQL: missing flavor, both query and query_file, validators or
  response_metrics_options without a query, bad response_metrics_options.
- GRPC: both body and body_file, xds scheme without xds support.
- EXTERNAL_GRPC: missing server or probe_type, bad output_metrics_options.
- Move the requests_per_probe * requests_interval_msec check into a
  shared options.ValidateRequestsDuration(), used by HTTP, DNS and
  BROWSER. It multiplies as int64, so large values no longer overflow
  int32 and pass the check.
- Keep the gRPC xds check in Init only: it depends on the build tags,
  and configtest may run on a different build.
- SQL: run ValidateConfig before the flavor switch, so the flavor error
  is in one place.
- EXTERNAL_GRPC: don't build a payload parser in ValidateConfig if
  output_metrics_options is not set.
Converting requests_per_probe * requests_interval_msec to time.Duration
can still overflow int64 for very large values. Compare in milliseconds
instead.
@manugarg
manugarg enabled auto-merge (squash) November 15, 2026 11:06
@manugarg
manugarg merged commit f421105 into main Nov 15, 2026
7 checks passed
@manugarg
manugarg deleted the configtest-probe-types branch November 15, 2026 11:08
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.

1 participant