Repository navigation
[prober] Warn when latency is both a number and a distribution - #1520
Merged
Merged
Conversation
Warn at startup, and on AddProbe, if some probes export a latency metric as a distribution (latency_distribution) and others export the same name as a number, and there is a Prometheus or OTel surfacer. One metric name with two types doesn't work well there: in Prometheus the metric type, the bucket series and the NHCB conversion depend on which probe reports first. This will become an error in a future release. The fix is to set latency_metric_name for the distribution probes. To make that fix work for TCP probes, connect_latency and tls_handshake_latency now follow latency_metric_name, like the HTTP probe's latency breakdown metrics. This renames those two metrics for TCP probes that set both tls_handshake and latency_metric_name.
manugarg
marked this pull request as ready for review
October 4, 2026 08:38
Move the check to the config package, working on the probe and surfacer configs, so that --configtest and the prober share it. Configtest logs the same warning and still passes. Also show only the first five probe names on each side in the warning, and fix the TCP probe's proto comment about the names of the connect and TLS handshake latency metrics.
Configtest didn't read --surfacers_config_file, so with the surfacers defined there, the latency type clash check assumed the default surfacers and warned even without a Prometheus or OTel surfacer. Also move the check to probes/options, so that prober doesn't have to import the config package.
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.
Every probe exports
latency, and it's a distribution only for the probes that havelatency_distribution. A config with both kinds of probes exports one metric name with two types. Prometheus stores it, but the result depends on which probe reports first: the metric type, the identity of thelatency_bucketseries (le="1"vsle="1.0"), and whether NHCB conversion happens at all. With native histograms,latencythen selects float and histogram series together. OTel gets one name with two instrument types.What changes
latency_metric_name), and says this will become an error in a future release.AddProbe(only for a clash involving the added probe), and in--configtest, which still passes. The check isoptions.LatencyTypeClashes(inprobes/options), shared by all three.connect_latencyandtls_handshake_latencynow followlatency_metric_name(asconnect_<name>andtls_handshake_<name>), like the HTTP probe's latency breakdown metrics. Without this, the suggested fix left TCP probes still clashing on those two.--configtestlooks at all the probes in the config, while a running cloudprober looks only at the probes that run on that host (run_on). So configtest can warn about two probes that never run together.--configtestnow also reads--surfacers_config_file. It didn't before, so the check would have assumed the default surfacers (which include Prometheus) for configs that define their surfacers there.Compatibility
TCP probes that set both
tls_handshakeand a non-defaultlatency_metric_nameget those two metrics renamed. Nothing else changes besides the new log line.Testing
Unit tests for the check, the warning text and the TCP metric names. Also ran a local cloudprober with a mixed config: one warning for
latencyat startup and one in--configtest, none for the probe usinglatency_dist, and the TCP metrics come out asconnect_latency_distandtls_handshake_latency_dist.