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 7 times, most recently from 10e9bef to 181db08 Compare December 10, 2025 16:13
@dashpole
Copy link
Contributor

dashpole commented Jan 6, 2026

This looks good to me overall. I think we can save float histograms for a follow-up.

foo{entity="replica",foo="a"} 1.0
foo{entity="replica",foo="bb"} 0.0
foo{entity="replica",foo="ccc"} 1.0
foo{entity="controller",foo="a"} 1.0
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you meant

Suggested change
foo{entity="controller",foo="a"} 1.0
foo{entity="controller",foo="ddd"} 1.0

Otherwise it's a duplicate?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've change it in a different way, by including another label.

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 181db08 to 578ba94 Compare January 28, 2026 13:37
@krajorama krajorama marked this pull request as ready for review January 28, 2026 13:38
foo_bucket{le="+Inf"} 17 st@1520430000.123
foo_count 17 st@1520430000.123
foo_sum 324789.3 st@1520430000.123
foo {count:17,sum:324789.3,bucket:[0.0:0,1e-05:0,0.0001:5,0.1:8,1.0:10,10.0:11,100000.0:11,1e+06:15,1e+23:16,1.1e+23:17,+Inf:17]} st@1520430000.123
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but one last thing to check is the readability/mode or accepting whitespaces (or at least [ \n\t].*) inside { }. We might want to compare pros and cons, but eating all those chars when in { is not too difficult (it might be prone to errors though).

This format asks for it (:

Copy link
Member

Choose a reason for hiding this comment

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

foo {
  count: 17,
  sum: 324789.3,
  bucket: [ 
     0.0: 0,
     1e05: 0,
     0.0001: 5,
     ....
   ],
} st@1520430000.123

Pros:

  • Looks nicer
    Cons:
  • Not very practical (grep)

Header or tool (CLI)

I like the CLI idea

Copy link
Member

Choose a reason for hiding this comment

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

Idea from @krajorama allow whitespaces, but SHOULD without?

Consensus among me and @krajorama : Keep it simple and deterministic and do not allow whitespaces for now, have a CLI tool for it.

Copy link
Member

Choose a reason for hiding this comment

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

From WG: Machine readability = human readability is a nice aspect (reliability, confusion).

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.

Ok for me, thanks!

foo_bucket{le="+Inf"} 17 st@1520430000.123
foo_count 17 st@1520430000.123
foo_sum 324789.3 st@1520430000.123
foo {count:17,sum:324789.3,bucket:[0.0:0,1e-05:0,0.0001:5,0.1:8,1.0:10,10.0:11,100000.0:11,1e+06:15,1e+23:16,1.1e+23:17,+Inf:17]} st@1520430000.123
Copy link
Member

Choose a reason for hiding this comment

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

Idea from @krajorama allow whitespaces, but SHOULD without?

Consensus among me and @krajorama : Keep it simple and deterministic and do not allow whitespaces for now, have a CLI tool for it.

Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
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