Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-23.1: pkg/metrics: use experimental native histograms. #109837

Closed
wants to merge 1 commit into from

Conversation

jmcarp
Copy link
Collaborator

@jmcarp jmcarp commented Aug 31, 2023

Backport 1/1 commits from #104302.

/cc @cockroachdb/release


Optionally enable prometheus native histograms. This feature is still
marked as experimental in prometheus, so flag using an environment
variable, and use additional environment variables to tune precision and
max bucket count. Prometheus native histograms currently only support
exponentially spaced buckets, so we also limit their use to metrics with
an exponential distribution. Note that native histograms currently use
the protobuf exposition format, so we add content negotiation to the
prometheus exporter.

Epic: https://cockroachlabs.atlassian.net/browse/CC-9716

Release note: None


Release justification: low-risk, adds a new histogram format behind an environment flag.

Optionally enable prometheus native histograms. Native histograms are
sparse histograms with exponentially spaced buckets that require minimal
configuration. They are also represented as a single series, rather than
a series per bucket as for conventional histograms. As a result, native
histograms typically require less memory and storage and offer higher
precision relative to conventional histograms.

This patch enables support for native histograms behind the
COCKROACH_ENABLE_PROMETHEUS_NATIVE_HISTOGRAMS environment variable flag.
We use a flag because native histograms are currently considered
experimental in prometheus. To use this feature, set the
COCKROACH_ENABLE_PROMETHEUS_NATIVE_HISTOGRAMS environment variable to
"true", and enable native histogram support in prometheus by setting
--enable-feature=native-histograms in the server arguments. Note that
crdb exports both conventional and native histograms when native
histogram support is enabled; prometheus can be configured to scrape
either or both.

Prometheus native histograms currently only support exponentially spaced
buckets, so we also limit their use to metrics with an exponential
distribution. Note that native histograms currently use the protobuf
exposition format, so we add content negotiation to the prometheus
exporter.

Epic: https://cockroachlabs.atlassian.net/browse/CC-9716

Release note (ops change): Added support for prometheus native
histograms behind an environment variable flag.
@jmcarp jmcarp requested review from a team as code owners August 31, 2023 18:15
@jmcarp jmcarp requested review from herkolategan and renatolabs and removed request for a team August 31, 2023 18:15
@blathers-crl
Copy link

blathers-crl bot commented Aug 31, 2023

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues or test-only changes.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Aug 31, 2023
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dhartunian
Copy link
Collaborator

We've reverted the change this depends on so it seems less likely this will make it into 23.1 since we're trying really hard to derisk point releases. I'm closing this for now.

@dhartunian dhartunian closed this Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Label PR's that are backports to older release branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants