sbunce
Repos
17
Followers
4
Following
1

Events

remove float32 variant, relocate into separate file

This change removes the float32 variant of the AlmostEqual funcs, that we will likely never use. This change also relocates the function into a separate file to avoid modifying a file that's a fork of another vendored package.

Signed-off-by: Seth Bunce seth.bunce@gmail.com

Created at 1 month ago

remove float32 variant, relocate into separate file

This change removes the float32 variant of the AlmostEqual funcs, that we will likely never use. This change also relocates the function into a separate file to avoid modifying a file that's a fork of another vendored package.

Created at 1 month ago
issue comment
Fix float64 comparison test failure on archs using FMA

You're welcome. I appreciate your feedback.

  • I removed the float32 variants. I bet you're right that this will never be used.
  • I moved the function to a new "almost_equal.go" file. I didn't realize the difflib file was a fork of a vendored dependency. Makes sense to not mix those.
Created at 1 month ago

remove float32 variant, relocate into separate file

This change removes the float32 variant of the AlmostEqual funcs, that we will likely never use. This change also relocates the function into a separate file to avoid modifying a file that's a fork of another vendored package.

Created at 1 month ago
issue comment
Fix float64 comparison test failure on archs using FMA

Sounds like there's consensus on avoiding the extra dependency. Reminds me of that go proverb, "a little copying is better than a little dependency".

I copied the contents of https://github.com/beorn7/floats to the prometheus/internal package. I made a few small changes.

  • I renamed "ε" to "epsilon". I feel like this improves readability for non-math people slightly. I can switch back to the original variable name if people want.
  • I modified the comment to reference the original repo.
  • I added variants which operate on slices of floats.

Couple points I anticipate there may be disagreement about. Calling these out.

  • I haven't copied over the tests. Seems like vendoring doesn't usually grab the tests, but this is a slightly different situation.
  • I copied over the float32 variant of things, even though we don't use it. Let me know if I should remove those.
Created at 2 months ago

copy float compare dependency

Per discussion in the pull request, we'd like to avoid having an extra dependency on a float comparison package. Instead, we copy the float compare functions from the float comparison package.

The float comparison package we're choosing is this. The author of this package has commented in the pull request and it looks like we have consensus that this is the best option. github.com/beorn7/floats

Signed-off-by: Seth Bunce seth.bunce@gmail.com

Created at 2 months ago

copy float compare dependency

Per discussion in the pull request, we'd like to avoid having an extra dependency on a float comparison package. Instead, we copy the float compare functions from the float comparison package.

The float comparison package we're choosing is this. The author of this package has commented in the pull request and it looks like we have consensus that this is the best option. github.com/beorn7/floats

Created at 2 months ago

copy float compare dependency

Per discussion in the pull request, we'd like to avoid having an extra dependency on a float comparison package. Instead, we copy the float compare functions from the float comparison package.

The float comparison package we're choosing is this. The author of this package has commented in the pull request and it looks like we have consensus that this is the best option. github.com/beorn7/floats

Created at 2 months ago

Apply suggestions from code review

Co-authored-by: Daniel Swarbrick daniel.swarbrick@gmail.com Signed-off-by: Seth Bunce seth.bunce@getcruise.com

Created at 2 months ago
issue comment
add ExponentialBucketsRange function

@dswarbrick I did not know that! Thank you for educating me. I created a change which switches to a comparison with a tolerance "abs(a-b)<tolerance". The tolerance I picked "0.001" looks higher than the differences in your test failure output.

The PR is here. https://github.com/prometheus/client_golang/pull/1133

Created at 2 months ago

Fix float64 comparison test failure on archs using FMA

Architectures using FMA optimization yield slightly different results so we cannot assume floating point values will be precisely the same across different architectures.

The solution in this change is to check "abs(a-b) < tolerance" instead of comparing the exact values. This will give us confidence that the histogram buckets are near identical.

Signed-off-by: Seth Bunce seth.bunce@getcruise.com

Created at 2 months ago

Fix float64 comparison test failure on archs using FMA

Architectures using FMA optimization yield slightly different results so we cannot assume floating point values will be precisely the same across different architectures.

The solution in this change is to check "abs(a-b) < tolerance" instead of comparing the exact values. This will give us confidence that the histogram buckets are near identical.

Signed-off-by: Seth Bunce seth.bunce@getcruise.com

Created at 2 months ago

Fix float64 comparison test failure on archs using FMA

Architectures using FMA optimization yield slightly different results so we cannot assume floating point values will be precisely the same across different architectures.

The solution in this change is to check "abs(a-b) < tolerance" instead of comparing the exact values. This will give us confidence that the histogram buckets are near identical.

Signed-off-by: Seth Bunce seth.bunce@getcruise.com

Created at 2 months ago

Fix float64 comparison test failure on archs using FMA

Architectures using FMA optimization yield slightly different results so we cannot assume floating point values will be precisely the same across different architectures.

The solution in this change is to check "abs(a-b) < tolerance" instead of comparing the exact values. This will give us confidence that the histogram buckets are near identical.

Created at 2 months ago
pull request opened
Fix float64 comparison test failure on archs using FMA

Architectures using FMA optimization yield slightly different results so we cannot assume floating point values will be precisely the same across different architectures.

The solution in this change is to check "abs(a-b) < tolerance" instead of comparing the exact values. This will give us confidence that the histogram buckets are near identical.

Created at 2 months ago
create branch
sbunce create branch sbunce/fix-fp-test
Created at 2 months ago

add ExponentialBucketsRange function (#899)

This function calculates exponential buckets with different arguments than the existing ExponentialBuckets function. Instead of specifying the start and factor, the user can specify the min and max bucket value. We have been doing it this way internally at my company for some time.

Signed-off-by: Seth Bunce seth.bunce@getcruise.com

Update common Prometheus files

Signed-off-by: prombot prometheus-team@googlegroups.com

Merge pull request #909 from prometheus/repo_sync

Synchronize common files from prometheus/prometheus

Update cespare/xxhash dependency (#913)

Brings in a fix for asm errors when dynamic linking with Go 1.17.

Fixes #912

Signed-off-by: David Trudgian david.trudgian@sylabs.io

Update common Prometheus files

Signed-off-by: prombot prometheus-team@googlegroups.com

Move flags and metrics into main()

Fixes #933.

Signed-off-by: beorn7 beorn@grafana.com

Merge pull request #935 from prometheus/beorn7/examples

example/random: Move flags and metrics into main()

Fix typo

Signed-off-by: Gökhan Özeloğlu gozeloglu@gmail.com

Merge pull request #939 from gozeloglu/fix-typo

Fix typo

support wal replay status api

Signed-off-by: Ben Ye ben.ye@bytedance.com

chore: adds support for go 1.17 on CI.

Signed-off-by: José Carlos Chávez jcchavezs@gmail.com

Add new go:build lines for go 1.17

Signed-off-by: Manuel Rüger manuel@rueg.eu

Merge pull request #950 from mrueg/go-1.17

Add support for go 1.17

Merge pull request #928 from prometheus/repo_sync

Synchronize common files from prometheus/prometheus

Update common Prometheus files

Signed-off-by: prombot prometheus-team@googlegroups.com

Merge pull request #952 from prometheus/repo_sync

Synchronize common files from prometheus/prometheus

Merge pull request #944 from yeya24/add-wal-replay-status

API: support wal replay status api

Update /api/v1/status/tsdb to include headStats (#925)

Current structs for v1 HTTP API assume that there is chunkCount and timeSeriesCount on /api/v1/status/runtimeinfo, which seems to be gone for at least a few releases. /api/v1/status/tsdb now holds an extra headStats block with chunkCount, numSeries and a few other fields. Update API models and tests to reflect this change.

Signed-off-by: Łukasz Mierzwa l.mierzwa@gmail.com

Use the runtime/metrics package for the Go collector for 1.17+ (#955)

This change introduces use of the runtime/metrics package in place of runtime.MemStats for Go 1.17 or later. The runtime/metrics package was introduced in Go 1.16, but not all the old metrics were accounted for until 1.17.

The runtime/metrics package offers several advantages over using runtime.MemStats:

  • The list of metrics and their descriptions are machine-readable, allowing new metrics to get added without any additional work.
  • Detailed histogram-based metrics are now available, offering much deeper insights into the Go runtime.
  • The runtime/metrics API is significantly more efficient than runtime.MemStats, even with the additional metrics added, because it does not require any stop-the-world events.

That being said, integrating the package comes with some caveats, some of which were discussed in #842. Namely:

  • The old MemStats-based metrics need to continue working, so they're exported under their old names backed by equivalent runtime/metrics metrics.
  • Earlier versions of Go need to continue working, so the old code remains, but behind a build tag.

Finally, a few notes about the implementation:

  • This change includes a whole bunch of refactoring to avoid significant code duplication.
  • This change adds a new histogram metric type specifically optimized for runtime/metrics histograms. This type's methods also include additional logic to deal with differences in bounds conventions.
  • This change makes a whole bunch of decisions about how runtime/metrics names are translated.
  • This change adds a go generate script to generate a list of expected runtime/metrics names for a given Go version for auditing. Users of new versions of Go will transparently be allowed to use new metrics, however.

Signed-off-by: Michael Anthony Knyszek mknyszek@google.com

promhttp: Check validity of method and code label values (#962)

  • Check validity of method and code label values

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

  • Use more flexibly functional option pattern for configuration

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

  • Update documentation

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

  • Simplify

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

  • Fix inconsistent method naming

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

Created at 2 months ago