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

Merge sparsehistogram branch into main #1150

Merged
merged 46 commits into from Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c98db4e
Demo sparse histograms
beorn7 Mar 5, 2020
abe540f
Encode sparse histograms in protobuf
beorn7 Apr 7, 2020
d1f5366
Fix span offset
beorn7 Apr 13, 2020
a9d0066
Add note about pow-of-10 precision issue
beorn7 Apr 13, 2020
08104a0
Minor doc comment fixes
beorn7 Jan 29, 2021
d698336
Merge branch 'master' into beorn7/histogram
beorn7 Apr 3, 2021
ce36ee3
Merge branch 'master' into beorn7/histogram
beorn7 Apr 30, 2021
a9df0ba
Update prometheus/client_model
beorn7 Apr 30, 2021
b7a540a
Fix test
beorn7 May 3, 2021
553ed73
Fix lint warning
beorn7 May 3, 2021
97eb041
Tidy go.sum
beorn7 May 3, 2021
5aa8534
Merge branch 'master' into sparsehistogram
beorn7 Jun 11, 2021
31318b7
Switch to base-2 buckets
beorn7 Jun 11, 2021
6c4e0ef
Add tests for sparse histogram
beorn7 Jun 23, 2021
5142344
Pin client_model to the most recent sparsehistogram commit
beorn7 Jun 24, 2021
43f31c2
Merge pull request #886 from prometheus/beorn7/histogram
beorn7 Jun 24, 2021
aa6f67a
Add TODO about bucket search optimization
beorn7 Jun 29, 2021
9ef5f90
Allow a zero threshold of zero
beorn7 Jul 20, 2021
84fcaff
Merge branch 'master' into sparsehistogram
beorn7 Aug 18, 2021
2409960
Implement strategy to limit the sparse bucket count
beorn7 Aug 18, 2021
263be8d
Refactoring of sparse histograms
beorn7 Aug 31, 2021
dfbcc28
Merge pull request #901 from prometheus/beorn7/histogram
beorn7 Sep 1, 2021
5b19c55
Merge branch 'master' into sparsehistogram
beorn7 Jan 11, 2022
70253f4
Fix typo in doc comment
beorn7 Jan 11, 2022
294cca4
Merge branch 'main' into sparsehistogram
beorn7 Feb 2, 2022
a27b6d7
Fix conflicts
kakkoyun May 13, 2022
e203144
Merge branch 'release-1.12' of github.com:prometheus/client_golang in…
kakkoyun May 13, 2022
b237230
Merge branch 'main' into sparsehistogram
beorn7 May 15, 2022
eb59a7b
Histogram: Fix bug with negative schemas (#1054)
beorn7 May 15, 2022
6ba7871
Merge branch 'main' into sparsehistogram
codesome Jun 20, 2022
525d042
Merge branch 'main' into sparsehistogram
beorn7 Jul 6, 2022
a516626
Merge branch 'release-1.12' into beorn7/release
beorn7 Jul 6, 2022
e93e384
Merge branch 'beorn7/release' into sparsehistogram
beorn7 Jul 6, 2022
5a321c7
Merge branch 'foo-commit' into sparsehistogram
beorn7 Jul 7, 2022
6141a07
Merge branch 'main' into sparsehistogram
beorn7 Jul 19, 2022
8cbcd40
histograms: Move to new exposition protobuf format
beorn7 Jul 19, 2022
ec86ef1
Merge pull request #1092 from prometheus/beorn7/histogram
beorn7 Jul 20, 2022
95cf173
Merge branch 'main' into sparsehistogram
beorn7 Aug 23, 2022
6942f9e
sparse buckets: Fix handling of +Inf/-Inf/NaN observations
beorn7 Oct 5, 2022
25bc188
Merge pull request #1144 from prometheus/beorn7/histogram2
beorn7 Oct 11, 2022
111fae1
Merge branch 'main' into sparsehistogram
beorn7 Oct 19, 2022
4e71e6f
Update prometheus/client_model dependency
beorn7 Oct 19, 2022
58a8ca4
examples: Adjust doc comment for native histograms
beorn7 Oct 19, 2022
d31f13b
Add SparseBucketsZeroThresholdZero and groom doc comments
beorn7 Oct 19, 2022
e92a8c7
Avoid the term 'sparse' where possible
beorn7 Oct 27, 2022
fffb76c
Merge branch 'main' into sparsehistogram
beorn7 Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 15 additions & 7 deletions examples/random/main.go
Expand Up @@ -48,14 +48,22 @@ func NewMetrics(reg prometheus.Registerer, normMean, normDomain float64) *metric
},
[]string{"service"},
),
// The same as above, but now as a histogram, and only for the normal
// distribution. The buckets are targeted to the parameters of the
// normal distribution, with 20 buckets centered on the mean, each
// half-sigma wide.
// The same as above, but now as a histogram, and only for the
// normal distribution. The histogram features both conventional
// buckets as well as sparse buckets, the latter needed for the
// experimental native histograms (ingested by a Prometheus
// server v2.40 with the corresponding feature flag
// enabled). The conventional buckets are targeted to the
// parameters of the normal distribution, with 20 buckets
// centered on the mean, each half-sigma wide. The sparse
// buckets are always centered on zero, with a growth factor of
// one bucket to the text of (at most) 1.1. (The precise factor
// is 2^2^-3 = 1.0905077...)
rpcDurationsHistogram: prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "rpc_durations_histogram_seconds",
Help: "RPC latency distributions.",
Buckets: prometheus.LinearBuckets(normMean-5*normDomain, .5*normDomain, 20),
Name: "rpc_durations_histogram_seconds",
Help: "RPC latency distributions.",
Buckets: prometheus.LinearBuckets(normMean-5*normDomain, .5*normDomain, 20),
NativeHistogramBucketFactor: 1.1,
}),
}
reg.MustRegister(m.rpcDurations)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -8,7 +8,7 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/golang/protobuf v1.5.2
github.com/json-iterator/go v1.1.12
github.com/prometheus/client_model v0.2.0
github.com/prometheus/client_model v0.3.0
github.com/prometheus/common v0.37.0
github.com/prometheus/procfs v0.8.0
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Expand Up @@ -134,8 +134,9 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
Expand Down