Skip to content

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

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

feat: NHCB: convert classic histograms to nhcb in scrape MVP#14978
krajorama merged 55 commits intomainfrom
nhcb-scrape-impl

Conversation

@krajorama
Copy link
Member

@krajorama krajorama commented Sep 25, 2024

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 <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
…pend classic histogram series)

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
… if they are not actually histograms based on metadata

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
# Conflicts:
#	config/config.go
#	scrape/scrape.go
@bwplotka
Copy link
Member

bwplotka commented Oct 4, 2024

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 <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Update test cases

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Renaming

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Scrape test for NHCB modified.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
On reviewer request.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
#14978 (comment)

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
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.

Thanks! Only #14978 (comment)

bwplotka
bwplotka previously approved these changes Oct 21, 2024
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
@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 <gyorgy.krajcsovits@grafana.com>
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 <gyorgy.krajcsovits@grafana.com>

* Speed up TestConvertClassicHistogramsToNHCB 3x

Reduce the startup time and timeouts

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

* lint fix

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

---------

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
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 <gyorgy.krajcsovits@grafana.com>
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 <gyorgy.krajcsovits@grafana.com>
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 <gyorgy.krajcsovits@grafana.com>
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 <gyorgy.krajcsovits@grafana.com>
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