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

Update weaver version and buckets #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
var stringLength = metrics.NewHistogram(
"echo_string_length",
"The length of strings passed to the Echo method",
metrics.NonNegativeBuckets,
[]float64{1, 10, 100, 1000, 10000, 100000, 1000000},
)

type echoOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/echo/weaver_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
cloud.google.com/go/monitoring v1.15.1
cloud.google.com/go/security v1.15.1
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.11.0
github.com/ServiceWeaver/weaver v0.24.2
github.com/ServiceWeaver/weaver v0.24.3
github.com/golang/protobuf v1.5.3
github.com/google/cel-go v0.17.1
github.com/google/go-cmp v0.5.9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.35.0/go.mod h1:/u5+zrOXintMHE97lVsaKZpwDIfGOBClYrCD/borbi8=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.35.0 h1:vjtrvX7B3S+uqTIOvOUfqsMCa3eEtEOOQWm7ERI1pxg=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.35.0/go.mod h1:H785fvlgotVZqht+1rHhXSs8EJ8uPVmpBYkTYO3ccpc=
github.com/ServiceWeaver/weaver v0.24.2 h1:GXapIUCLlN8YYLjH2fvbw0lR77wM5uZOrvCBNG8YZYE=
github.com/ServiceWeaver/weaver v0.24.2/go.mod h1:twEFAFbylAXe9l1Zc5qrLOBfQvw2dKAGVFOyPzS0tFE=
github.com/ServiceWeaver/weaver v0.24.3 h1:pLF0k9TtAJDwJLr2653HU0LM+91AlklxK+Rzlu7bEoA=
github.com/ServiceWeaver/weaver v0.24.3/go.mod h1:twEFAFbylAXe9l1Zc5qrLOBfQvw2dKAGVFOyPzS0tFE=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down
20 changes: 18 additions & 2 deletions internal/store/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,33 @@ var (
requestLatencies = metrics.NewHistogramMap[storeLabels](
"serviceweaver_store_request_latency_micros",
"Latency of store requests, in microseconds, by operation",
metrics.NonNegativeBuckets,
generatedBuckets,
)
valueSizes = metrics.NewHistogramMap[storeLabels](
"serviceweaver_store_value_size_bytes",
"Size of values, in bytes, by operation",
metrics.NonNegativeBuckets,
generatedBuckets,
)
staleCounts = metrics.NewCounterMap[storeLabels](
"serviceweaver_store_stale_count",
"Number of stale puts",
)

// generatedBuckets provides rounded bucket boundaries for histograms
// that will only store non-negative values.
generatedBuckets = []float64{
// Adjacent buckets differ from each other by 2x or 2.5x.
1, 2, 5,
10, 20, 50,
100, 200, 500,
1000, 2000, 5000,
10000, 20000, 50000,
100000, 200000, 500000,
1000000, 2000000, 5000000,
10000000, 20000000, 50000000,
100000000, 200000000, 500000000,
1000000000, 2000000000, 5000000000, // i.e., 5e9
}
)

// WithMetrics returns the provided store, but with methods augmented to update
Expand Down
2 changes: 1 addition & 1 deletion internal/tool/testprogram/weaver_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading