-
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
250 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,16 @@ def go_deps(): | |
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/akavel/rsrc/com_github_akavel_rsrc-v0.8.0.zip", | ||
], | ||
) | ||
go_repository( | ||
name = "com_github_alecthomas_kingpin_v2", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/alecthomas/kingpin/v2", | ||
sha256 = "2a322681d79461dd793c1e8a98adf062f6ef554abcd3ab06981eef94d79c136b", | ||
strip_prefix = "github.com/alecthomas/kingpin/[email protected]", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/alecthomas/kingpin/v2/com_github_alecthomas_kingpin_v2-v2.3.1.zip", | ||
], | ||
) | ||
go_repository( | ||
name = "com_github_alecthomas_template", | ||
build_file_proto_mode = "disable_global", | ||
|
@@ -148,10 +158,10 @@ def go_deps(): | |
name = "com_github_alecthomas_units", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/alecthomas/units", | ||
sha256 = "461b05eb19b6023664d6502cb4fbf093a99a9ee2a36c43b4da5ca1287c495ff7", | ||
strip_prefix = "github.com/alecthomas/[email protected]20210208195552-ff826a37aa15", | ||
sha256 = "b62437d74a523089af46ba0115ece1ce11bca5e321fe1e1d4c976ecca6ee78aa", | ||
strip_prefix = "github.com/alecthomas/[email protected]20211218093645-b94a6e3cc137", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/alecthomas/units/com_github_alecthomas_units-v0.0.0-20210208195552-ff826a37aa15.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/alecthomas/units/com_github_alecthomas_units-v0.0.0-20211218093645-b94a6e3cc137.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -3076,10 +3086,10 @@ def go_deps(): | |
name = "com_github_go_kit_log", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/go-kit/log", | ||
sha256 = "e0676df7357654a000008dfad3b6b211cba3595f32d3e220edd63a4c9d0d9254", | ||
strip_prefix = "github.com/go-kit/log@v0.1.0", | ||
sha256 = "52634b502b9d0aa945833d93582cffc1bdd9bfa39810e7c70d0688e330b75198", | ||
strip_prefix = "github.com/go-kit/log@v0.2.1", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-kit/log/com_github_go_kit_log-v0.1.0.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/go-kit/log/com_github_go_kit_log-v0.2.1.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -3744,10 +3754,10 @@ def go_deps(): | |
patches = [ | ||
"@com_github_cockroachdb_cockroach//build/patches:com_github_golang_protobuf.patch", | ||
], | ||
sha256 = "5d1c817bebc1202ab3b42a418e584e0008e8027baf212ce69c2ae3e9e7b8c64b", | ||
strip_prefix = "github.com/golang/[email protected].2", | ||
sha256 = "93bda6e88d4a0a493a98b481de67a10000a755d15f16a800b49a6b96d1bd6f81", | ||
strip_prefix = "github.com/golang/[email protected].3", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/golang/protobuf/com_github_golang_protobuf-v1.5.2.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/golang/protobuf/com_github_golang_protobuf-v1.5.3.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -7433,10 +7443,10 @@ def go_deps(): | |
name = "com_github_prometheus_client_golang", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/prometheus/client_golang", | ||
sha256 = "d9bbfcdcb5f63812b6766884a0f5ad5b1f9a675375d28e307573f49e2ef96b7b", | ||
strip_prefix = "github.com/prometheus/client_golang@v1.12.1", | ||
sha256 = "0167cee686b836da39815e4a7ea64ecc245f6a3fb9b3c3f729941ed55da7dd4f", | ||
strip_prefix = "github.com/prometheus/client_golang@v1.16.0", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.12.1.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.16.0.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -7446,20 +7456,20 @@ def go_deps(): | |
], | ||
build_file_proto_mode = "default", | ||
importpath = "github.com/prometheus/client_model", | ||
sha256 = "44fc58fe25ed9b122b6755e8d356d5f199592f959af3b87a3b636c6eb82b43c5", | ||
strip_prefix = "github.com/prometheus/client_model@v0.2.1-0.20210607210712-147c58e9608a", | ||
sha256 = "2a1d147754959287fc34a7bb7c333b3d6fe0ca0d7db1606c49e8f48fd0311547", | ||
strip_prefix = "github.com/prometheus/client_model@v0.3.0", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/client_model/com_github_prometheus_client_model-v0.2.1-0.20210607210712-147c58e9608a.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/client_model/com_github_prometheus_client_model-v0.3.0.zip", | ||
], | ||
) | ||
go_repository( | ||
name = "com_github_prometheus_common", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/prometheus/common", | ||
sha256 = "9630b9bbfcf1746a01c8aff0262271c60cf891fa1cd48a8ed9149de557dc98d6", | ||
strip_prefix = "github.com/prometheus/common@v0.32.1", | ||
sha256 = "7a4ef12402a8a153c47c085cadf362bdc2ffe4761e50d6ab2c49e4d64044bc85", | ||
strip_prefix = "github.com/prometheus/common@v0.42.0", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.32.1.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.42.0.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -7486,10 +7496,10 @@ def go_deps(): | |
name = "com_github_prometheus_procfs", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/prometheus/procfs", | ||
sha256 = "3e37c9f62738a493dd28283179d802749050353df0bca161df7cec4ed43e6f1a", | ||
strip_prefix = "github.com/prometheus/procfs@v0.7.3", | ||
sha256 = "3f7a5c30bbcd2adcc7ec62896b69a3792ca1603cf0998fa06d2b872a74ed13b0", | ||
strip_prefix = "github.com/prometheus/procfs@v0.10.1", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/procfs/com_github_prometheus_procfs-v0.7.3.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/prometheus/procfs/com_github_prometheus_procfs-v0.10.1.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -8776,6 +8786,16 @@ def go_deps(): | |
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/xeipuuv/gojsonschema/com_github_xeipuuv_gojsonschema-v1.2.0.zip", | ||
], | ||
) | ||
go_repository( | ||
name = "com_github_xhit_go_str2duration", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/xhit/go-str2duration", | ||
sha256 = "87df7da9ed9a48a2da6b3df14d33a567a9e6ed2454e4cbd694baa7ec82ca7ec1", | ||
strip_prefix = "github.com/xhit/[email protected]", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/xhit/go-str2duration/com_github_xhit_go_str2duration-v1.2.0.zip", | ||
], | ||
) | ||
go_repository( | ||
name = "com_github_xiang90_probing", | ||
build_file_proto_mode = "disable_global", | ||
|
@@ -11260,10 +11280,10 @@ def go_deps(): | |
name = "org_golang_x_sync", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "golang.org/x/sync", | ||
sha256 = "f510bec6009e19882d19953e7273137d34df86c65949345d72f123a255c2ecd2", | ||
strip_prefix = "golang.org/x/sync@v0.1.0", | ||
sha256 = "ee0df4572dd73665767964ff809b12f0d41e3a0740220d44d418a19989a0363b", | ||
strip_prefix = "golang.org/x/sync@v0.2.0", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sync/org_golang_x_sync-v0.1.0.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sync/org_golang_x_sync-v0.2.0.zip", | ||
], | ||
) | ||
go_repository( | ||
|
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.