Skip to content

Commit 5a024c4

Browse files
authored
Use ms buckets (#278)
* us ms buckets * address comments
1 parent e59c014 commit 5a024c4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

internal/ct/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func setupMetrics() {
9393
reqDuration = mustCreate(meter.Float64Histogram("tesseract.http.request.duration",
9494
metric.WithDescription("CT HTTP response duration"),
9595
metric.WithUnit("ms"),
96-
metric.WithExplicitBucketBoundaries(otel.LatencyHistogramBuckets...)))
96+
metric.WithExplicitBucketBoundaries(otel.SubSecondLatencyHistogramBuckets...)))
9797
}
9898

9999
// entrypoints is a list of entrypoint names as exposed in statistics/logging.

internal/otel/cast.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ package otel
1717
import "math"
1818

1919
var (
20-
// LatencyHistogramBuckets is a range of millisecond scale bucket boundaries which remain useful at around 1-2 seconds timescale in addition to smaller latencies.
21-
LatencyHistogramBuckets = []float64{0, 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000, 2500, 3000, 4000, 5000, 6000, 8000, 10000}
20+
// SubSecondLatencyHistogramBuckets is a range of millisecond scale bucket boundaries which remain useful at around 1-2 seconds timescale in addition to smaller latencies.
21+
// We use seconds as units, Open Telemetry's default unit for time.
22+
SubSecondLatencyHistogramBuckets = []float64{0, 10e-3, 50e-3, 100e-3, 200e-3, 300e-3, 400e-3, 500e-3, 600e-3, 700e-3, 800e-3, 900e-3, 1000e-3, 1200e-3, 1400e-3, 1600e-3, 1800e-3, 2000e-3, 2500e-3, 3000e-3, 4000e-3, 5000e-3, 6000e-3, 8000e-3, 10000e-3}
2223
)
2324

2425
// Clamp64 casts a uint64 to an int64, clamping it at MaxInt64 if the value is above.

0 commit comments

Comments
 (0)