-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/metrics: use native histograms 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. Release note (ops change): Added support for prometheus native histograms behind an environment variable flag.
- Loading branch information
Showing
27 changed files
with
243 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.