Skip to content

Conversation

@krajorama
Copy link
Member

@krajorama krajorama commented Jun 16, 2025

@krajorama krajorama changed the title Classic histogram and summary as complex types feat(om2): classic histogram and summary as complex types Jun 16, 2025
@krajorama krajorama force-pushed the krajo/om2.0-complex-hist-summ branch from aca6583 to 4c7a987 Compare June 16, 2025 11:13
dashpole
dashpole previously approved these changes Jun 17, 2025
@bwplotka bwplotka moved this to In Progress in Open Metrics 2.0 Sep 3, 2025
bwplotka
bwplotka previously approved these changes Sep 4, 2025
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love that, but as we discussed on our sync - we need a bigger decision if we want to follow this path.

If we do, we likely need some rough uncomplex inlined format explained that is not meant to be used for scraping and can be surfaced with promtool etc.

@krajorama krajorama dismissed stale reviews from bwplotka and dashpole October 3, 2025 09:36

this is a draft, changes incoming, also I made a mistake with the quantile values

dashpole
dashpole previously approved these changes Oct 3, 2025
bwplotka added a commit to prometheus/prometheus that referenced this pull request Oct 7, 2025
This change is for demo purposes, exploring the benefits (and downsides)
for the complex type format for OM2 captured in
prometheus/docs#2679.

This assumes Prometheus stores NS and NHCB (and NH) going forward (for
best case efficiency), but is expected to work for classic mode too with
little overhead (benchmarks will tell us).

Part of the PromCon talk we do with @krajorama

Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka added a commit to prometheus/prometheus that referenced this pull request Oct 7, 2025
This change is for demo purposes, exploring the benefits (and downsides)
for the complex type format for OM2 captured in
prometheus/docs#2679.

This assumes Prometheus stores NS and NHCB (and NH) going forward (for
best case efficiency), but is expected to work for classic mode too with
little overhead (benchmarks will tell us).

Part of the PromCon talk we do with @krajorama

Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka added a commit to prometheus/prometheus that referenced this pull request Oct 7, 2025
This change is for demo purposes, exploring the benefits (and downsides)
for the complex type format for OM2 captured in
prometheus/docs#2679.

This assumes Prometheus stores NS and NHCB (and NH) going forward (for
best case efficiency), but is expected to work for classic mode too with
little overhead (benchmarks will tell us).

Part of the PromCon talk we do with @krajorama

Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka
Copy link
Member

bwplotka commented Oct 7, 2025

Results are (expectedly) impressive: prometheus/prometheus#17293

One observation is that buckets are a bit dense (readability). However we don't have spaces in any other place (e.g. labels)

bwplotka added a commit to prometheus/prometheus that referenced this pull request Oct 7, 2025
This change is for demo purposes, exploring the benefits (and downsides)
for the complex type format for OM2 captured in
prometheus/docs#2679.

This assumes Prometheus stores NS and NHCB (and NH) going forward (for
best case efficiency), but is expected to work for classic mode too with
little overhead (benchmarks will tell us).

Part of the PromCon talk we do with @krajorama

Signed-off-by: bwplotka <bwplotka@gmail.com>
@jan--f jan--f added the kind/feature New documentation content label Dec 5, 2025
@krajorama krajorama force-pushed the krajo/om2.0-complex-hist-summ branch from 8696022 to 8c8eeae Compare December 10, 2025 15:41
@krajorama krajorama force-pushed the krajo/om2.0-complex-hist-summ branch 6 times, most recently from 4c45623 to 10e9bef Compare December 10, 2025 16:11
Ref: prometheus/OpenMetrics#283

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama force-pushed the krajo/om2.0-complex-hist-summ branch from 10e9bef to 181db08 Compare December 10, 2025 16:13
foo_count 17 st@1520430000.123
foo_sum 324789.3 st@1520430000.123
foo {count:17,sum:324789.3,schema:0,zero_threshold:1e-4,zero_count:0,positive_spans:[0:2],positive_buckets:[5,12]} st@1520430000.123 # {trace_id="shaZ8oxi"} 0.67 1520879607.789 # {trace_id="ookahn0M"} 1.2 1520879608.589
foo {count:17,sum:324789.3,bucket:[0.01:0,0.1:8,1.0:11,10.0:17,+Inf:17]} st@1520430000.123 # {} 0.054 1520879607.7 # {trace_id="KOO5S4vxi0o"} 0.67 1520879602.890 # {trace_id="oHg5SJYRHA0"} 9.8 1520879607.789
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WG discussions: what to do with float vs int histogram

Likely storage optimization, easy in the format.

For syntax:

A)Should we accept the float
B)If we do how:
*. B1) What if we accept floats e.g. and optimize on storage e.g. count:17/17.0 count:17.5 and buckets.

  • B2) Strict mode - count decides if it's float or not.

Perhaps B1 or B2 if we want more efficient implementation
Perhaps for RC we do relax mode and try to implement?

foo_seconds_count{a="ccc"} 0 456
foo_seconds_sum{a="ccc"} 0 456
# TYPE foo stateset
foo{entity="controller",foo="a"} 1.0
Copy link
Member

@bwplotka bwplotka Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we do stateset too:

# TYPE foo stateset
foo{entity="controller"} {states:["a":1.0, "bb":0.0, "ccc":0.0]}
...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One argument against moving to complex type here is the PromQL. We don't have plans to change PromQL for those so far (while we have plans for histograms). We don't have clear plans for summaries, so maybe that's fine 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New documentation content

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants