Repository navigation
MAL: Inf histogram bounds; percentile overflow uses highest finite bound - #14275
Conversation
|
We don't have Prometheus or OpenMetrics reader anymore. We are mainly on OTLP metrics. Is there any case around that? |
|
The Prometheus scrape reader is not the motivation, |
| * Bump Armeria `1.34.2` → `1.43.1`, and the managed versions of the libraries it is built against to its versions: gRPC `1.80.0` → `1.85.1`, Jackson `2.18.12` → `2.22.4` (jackson-annotations `2.22`, which has no patch versions since `2.20`) and Micrometer `1.16.8` → `1.17.2`. graphql-java stays at `25.2`, though armeria-graphql `1.43.1` is built against `26.1`: graphql-java `26` removed `graphql.schema.idl.DirectiveInfo`, which graphql-java-tools `14.0.1`, its latest release, still uses to build the schema, so the OAP failed to boot on it. Armeria `1.43.1` builds a gRPC stub on the client factory named in the stub's options instead of the one `newClient` is called on, so the Cilium fetcher's stubs fell back to Armeria's default factory and connected without the fetcher's TLS settings, and the fetcher read nothing from a TLS Hubble endpoint; it now names its factory in the options. Armeria `1.43.1` also applies a `tlsCustomizer` after `tlsNoVerify()`, so the Cilium fetcher's CA replaced the trust-all setting and Hubble's certificates failed the host name check. The fetcher now verifies Hubble's certificates against `SW_CILIUM_FETCHER_CA_FILE_PATH`, without checking host names; before, `tlsNoVerify()` won and the CA file was ignored, so a CA file that does not sign Hubble's server certificates no longer connects. jackson-datatype-jsr310, which Armeria pulls, is pinned to the managed Jackson version; it was `2.20.1` beside Jackson `2.18.12`. Transitively, brotli4j moves `1.20.0` → `1.24.0`, micrometer context-propagation `1.2.0` → `1.2.1`, proto-google-common-protos `2.63.2` → `2.64.1` and animal-sniffer-annotations `1.26` → `1.27`, and LatencyUtils is no longer shipped. | ||
|
|
||
| #### OAP Server | ||
| * Fix MAL `histogram()` / percentile rules failing on Prometheus histogram buckets labeled `le="+Inf"` (or `-Inf`): `Double.parseDouble` rejected those spellings, so the whole expression failed. Accept Prometheus and Java Inf forms and map them to `Long.MAX_VALUE` / `Long.MIN_VALUE`; reject `NaN` bounds. Histogram percentile calculation now sorts the `-Inf` dataset key without throwing, and when a rank lands in the overflow (`+Inf`) bucket it reports the highest finite upper bound instead of `Long.MAX_VALUE`. |
There was a problem hiding this comment.
The latter change should be in the last part of this change log section. Not first row.
41d50bd to
4ed692d
Compare
|
This kind of statement keeps showing, which this PR title doesn't declare. I feel this means that the last bucket is infinite, you will report different as before. The PR title and description doesn't say this explictly. Only Not returning Long.MAX_VALUE as a latency when a finite upper bound exists., this is a global change, not just a bug fix, we could say it makes some sense, but we need to evaluate carefully, including doc. |
4ed692d to
27e4086
Compare
|
Thanks for the review.
|
|
Please resolve conflicts for the latest changes. |
d623527 to
4792ac3
Compare
4792ac3 to
b6c0520
Compare
|
@songzhendong I pushed a fix-up and squashed the branch into one commit, with you kept as the author, rebased on the latest master. Please save any local work before you What changed:
|
Behavior change: a MAL histogram_percentile or TAL percentile rank that
falls in a histogram's overflow (+Inf, Long.MAX_VALUE) bucket now reads
the highest finite bucket bound instead of Long.MAX_VALUE, as Prometheus
histogram_quantile does. A percentile that reads that bound may be above
it, and none reads above it, so an alarm condition that needs a value
above it no longer fires. The MAL, TAL and trace-analyzer docs and the
changelog say so.
histogram() also accepts the +Inf / -Inf / Inf bucket bound spellings
and rejects NaN; the shipped receivers send numbers (OTLP labels the
overflow bucket "Infinity", which already parsed). The percentile
functions sort the negative-infinity bucket key ("infinite-") instead of
failing Long.parseLong on it.
b6c0520 to
d5f1a82
Compare
|
Thanks for the fix-up and the squash — and for keeping me as the author. I'll save any local work and |
Behavior change
When a histogram percentile rank lands in the overflow (
+Inf/Long.MAX_VALUE) bucket and a finite upper bound exists, AVG/SUMhistogram_percentilenow returns that highest finite bound instead ofLong.MAX_VALUE.Dashboards or alarms that previously showed ~
Long.MAX_VALUEfor those ranks will show the last finiteleinstead. Documented indocs/en/concepts-and-designs/mal.md.Also in this PR
histogram()accepts Prometheus/Java Inf spellings (+Inf/-Inf/Infinity) and maps them toLong.MAX_VALUE/Long.MIN_VALUE.NaNbucket bounds.-Infdataset key (infinite-) without throwing.Scope / non-goals
In scope: the behavior change above; Inf parse hardening; unit coverage.
Out of scope: cumulative→interval histogram conversion; merging duplicate Inf aliases in one group; a product sentinel when the histogram has only an overflow bucket (still
Long.MAX_VALUE).Verification
Test plan
ParseBucketBoundTestFunctionTestInf formsAnalyzerHistogramInfTest-InftestsTALExecutionTestoverflow expects highest finite bound