Skip to content

feat: NHCB: convert classic histograms to nhcb in scrape MVP - #14978

Merged
krajorama merged 55 commits into
mainfrom
nhcb-scrape-impl
Oct 22, 2024
Merged

krajorama merged 55 commits into
mainfrom
nhcb-scrape-impl

Conversation

@krajorama

@krajorama krajorama commented Sep 25, 2024 •

Copy link
Copy Markdown
Member

Originally started in #14008 by @zenador

Partially addresses #13529 and #13532

MVP:
Supports any scrape protocol - I've tried with Protobuf and OpenMetrics1.0.0.
Supports multiple exemplars per histogram.
Assumes that metadata is present as it depends on that to detect classic histogram series for conversion. Thus naked histograms without # TYPE histogram are not converted.
Does not support created timestamp (--enable-feature=created-timestamp-zero-ingestion).
Does not support # TYPE gaugehistogram yet.

Before #14730 is implemented, reload from WAL does not work. Test with:

rm -rf ./data ; mkdir data; ~/go/github.com/prometheus/prometheus/prometheus --enable-feature=exemplar-storage,native-histograms

My sample config:

global:
  scrape_interval: 1s
  external_labels:
    scraped_by: prometheus
  scrape_protocols: [ OpenMetricsText1.0.0 ]

scrape_configs:
  - job_name: mimir-1
    convert_classic_histograms_to_nhcb: true
    static_configs:
      - targets: ['10.10.10.10:5001']
        labels:
          container: 'promtestsource-1'

zenador and others added 19 commits September 25, 2024 13:36
Signed-off-by: Jeanette Tan <[email protected]>
…pend classic histogram series)

Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
… if they are not actually histograms based on metadata

Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
# Conflicts:
#	config/config.go
#	scrape/scrape.go
@bwplotka

bwplotka commented Oct 4, 2024

Copy link
Copy Markdown
Member

Nice, let's review benchmark code #15083 and will check this PR out for review/efficiency assessment 👍🏽

@bwplotka bwplotka self-assigned this Oct 4, 2024
@bwplotka
bwplotka requested review from bwplotka and roidelapluie and removed request for roidelapluie October 4, 2024 07:17
# Conflicts:
#	scrape/scrape.go
…e name

See Parser.Type() function.

Signed-off-by: György Krajcsovits <[email protected]>
Update test cases

Signed-off-by: György Krajcsovits <[email protected]>
Renaming

Signed-off-by: György Krajcsovits <[email protected]>
Scrape test for NHCB modified.

Signed-off-by: György Krajcsovits <[email protected]>
On reviewer request.

Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>

@bwplotka bwplotka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Only #14978 (comment)

bwplotka
bwplotka previously approved these changes Oct 21, 2024
Comment thread scrape/scrape.go Resolved
Signed-off-by: George Krajcsovits <[email protected]>
@krajorama
krajorama merged commit ad4857d into main Oct 22, 2024
@krajorama
krajorama deleted the nhcb-scrape-impl branch October 22, 2024 05:56
krajorama added a commit that referenced this pull request Oct 22, 2024
From comment #14978 (comment)

Also make compareLabels read only and move storeLabels to the first
processed classic histogram series.

Signed-off-by: György Krajcsovits <[email protected]>
bwplotka pushed a commit that referenced this pull request Oct 22, 2024
* NHCB: scrape use state field and not booleans

From comment #14978 (comment)

Also make compareLabels read only and move storeLabels to the first
processed classic histogram series.

Signed-off-by: György Krajcsovits <[email protected]>

* Speed up TestConvertClassicHistogramsToNHCB 3x

Reduce the startup time and timeouts

Signed-off-by: György Krajcsovits <[email protected]>

* lint fix

Signed-off-by: György Krajcsovits <[email protected]>

---------

Signed-off-by: György Krajcsovits <[email protected]>
krajorama added a commit that referenced this pull request Oct 24, 2024
From: #14978 (comment)
Also encode the requirement table set in #13532

Signed-off-by: György Krajcsovits <[email protected]>
krajorama added a commit that referenced this pull request Oct 24, 2024
From: #14978 (comment)
Also encode the requirement table set in #13532

Signed-off-by: György Krajcsovits <[email protected]>
krajorama added a commit that referenced this pull request Oct 24, 2024
From: #14978 (comment)
Also encode the requirement table set in #13532

Signed-off-by: György Krajcsovits <[email protected]>
krajorama added a commit that referenced this pull request Oct 24, 2024
…15209)

From: #14978 (comment)
Also encode the requirement table set in #13532

Signed-off-by: György Krajcsovits <[email protected]>
julienduchesne pushed a commit to julienduchesne/prometheus that referenced this pull request Dec 13, 2024
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.

5 participants