Skip to content

Commit 73d0aff

Browse files
committed
fix: not compiling histogram bucket vars
1 parent 9742b4e commit 73d0aff

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

http/client/transport_metrics.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
var (
1313
// TODO: we can tweak the level of detail for the time buckets:
1414
// this will generate 20 time series for the metric
15-
timeBucketsOpt := metric.WithExplicitBucketBoundaries(
15+
timeBucketsOpt = metric.WithExplicitBucketBoundaries(
1616
0.010, 0.020, 0.030, 0.040,
1717
0.050, 0.065, 0.080, 0.100,
1818
0.150, 0.200, 0.250, 0.300,
1919
0.500, 0.750, 1.000, 1.500,
2020
2.000, 5.000, 10.000)
2121

22-
sizeBucketOpt := metric.WithExplicitBucketBoundaries(
22+
sizeBucketsOpt = metric.WithExplicitBucketBoundaries(
2323
0, 256, 512, 1024, // <- reasonable response sizes
2424
4*1024, 8*1024, 16*1024, 32*1024, // <- these starts to be big
2525
64*1024, 4*64*1024, 8*64*1024, 16*64*1024, // <- those are huge for an api response 64k to 1 Meg
@@ -81,14 +81,14 @@ func newTransportMetrics(metricsOpts *TransportMetricsOptions, meter metric.Mete
8181

8282
tm.requestContentLength, _ = meter.Int64Counter("requests-content-length") // the value of the Content-Length header for the request
8383

84-
tm.responseLatency, _ = meter.Float64Histogram("response-latency", timeBucketsOpts)
84+
tm.responseLatency, _ = meter.Float64Histogram("response-latency", timeBucketsOpt)
8585

86-
tm.responseContentLength, _ = meter.Int64Histogram("response-content-length", sizeBucketOpt)
86+
tm.responseContentLength, _ = meter.Int64Histogram("response-content-length", sizeBucketsOpt)
8787

8888
tm.detailsEnabled = metricsOpts.DetailedConnection
8989
tm.getConnLatency, _ = meter.Float64Histogram("request-get-conn-latency", timeBucketsOpt)
90-
tm.dnsLatency, _ = meter.Float64Histogram("request-dns-latency", timeBucketOpt)
91-
tm.tlsLatency, _ = meter.Float64Histogram("request-tls-latency", timeBucketOpt)
90+
tm.dnsLatency, _ = meter.Float64Histogram("request-dns-latency", timeBucketsOpt)
91+
tm.tlsLatency, _ = meter.Float64Histogram("request-tls-latency", timeBucketsOpt)
9292
return &tm
9393
}
9494

io/instruments.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ var (
1717

1818
// TODO: we can tweak the level of detail for the time buckets:
1919
// this will generate 20 time series for the metric
20-
timeBucketsOpt := metric.WithExplicitBucketBoundaries(
20+
timeBucketsOpt = metric.WithExplicitBucketBoundaries(
2121
0.010, 0.020, 0.030, 0.040,
2222
0.050, 0.065, 0.080, 0.100,
2323
0.150, 0.200, 0.250, 0.300,
2424
0.500, 0.750, 1.000, 1.500,
2525
2.000, 5.000, 10.000)
2626

27-
sizeBucketsOpt := metric.WithExplicitBucketBoundaries(
27+
sizeBucketsOpt = metric.WithExplicitBucketBoundaries(
2828
0, 256, 512, 1024, // <- reasonable response sizes
2929
4*1024, 8*1024, 16*1024, 32*1024, // <- these starts to be big
3030
64*1024, 4*64*1024, 8*64*1024, 16*64*1024, // <- those are huge for an api response 64k to 1 Meg
@@ -97,7 +97,7 @@ func newInstruments(prefix string,
9797
if bsc, err := meter.Int64Counter(strSizeCount, metric.WithUnit("b")); err == nil {
9898
sizeCount = bsc
9999
}
100-
if bsh, err := meter.Int64Histogram(strSizeHistogram, sizeBucketOpt, metric.WithUnit("b")); err == nil {
100+
if bsh, err := meter.Int64Histogram(strSizeHistogram, sizeBucketsOpt, metric.WithUnit("b")); err == nil {
101101
sizeHistogram = bsh
102102
}
103103
if brtc, err := meter.Float64Counter(strTimeCount, metric.WithUnit("s")); err == nil {

lura/proxy.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ import (
1919
var (
2020
// TODO: we can tweak the level of detail for the time buckets:
2121
// this will generate 20 time series for the metric
22-
timeBucketsOpt := metric.WithExplicitBucketBoundaries(
22+
timeBucketsOpt = metric.WithExplicitBucketBoundaries(
2323
0.010, 0.020, 0.030, 0.040,
2424
0.050, 0.065, 0.080, 0.100,
2525
0.150, 0.200, 0.250, 0.300,
2626
0.500, 0.750, 1.000, 1.500,
2727
2.000, 5.000, 10.000)
2828

29-
sizeBucketsOpt := metric.WithExplicitBucketBoundaries(
29+
sizeBucketsOpt = metric.WithExplicitBucketBoundaries(
3030
0, 256, 512, 1024, // <- reasonable response sizes
3131
4*1024, 8*1024, 16*1024, 32*1024, // <- these starts to be big
3232
64*1024, 4*64*1024, 8*64*1024, 16*64*1024, // <- those are huge for an api response 64k to 1 Meg

router/gin/endpoint_metrics.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ import (
66
"go.opentelemetry.io/otel/semconv/v1.21.0"
77
)
88

9-
// TODO: we must decide if we want a single shared configuration of the
9+
// TODO: we must decide if we want a single shared configuration of the
1010
// time buckets, and the size buckets, or if we want to be able to tweak
1111
// the buckets for each layer (or give some options, like low / medium / high
1212
// detail that would add more or less buckets).
1313
var (
1414
// TODO: we can tweak the level of detail for the time buckets:
1515
// this will generate 20 time series for the metric
16-
timeBucketsOpt := metric.WithExplicitBucketBoundaries(
16+
timeBucketsOpt = metric.WithExplicitBucketBoundaries(
1717
0.010, 0.020, 0.030, 0.040,
1818
0.050, 0.065, 0.080, 0.100,
1919
0.150, 0.200, 0.250, 0.300,
2020
0.500, 0.750, 1.000, 1.500,
2121
2.000, 5.000, 10.000)
2222

23-
sizeBucketsOpt := metric.WithExplicitBucketBoundaries(
23+
sizeBucketsOpt = metric.WithExplicitBucketBoundaries(
2424
0, 256, 512, 1024, // <- reasonable response sizes
2525
4*1024, 8*1024, 16*1024, 32*1024, // <- these starts to be big
2626
64*1024, 4*64*1024, 8*64*1024, 16*64*1024, // <- those are huge for an api response 64k to 1 Meg

0 commit comments

Comments
 (0)