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

Fix off-by-one for histogram bucket seams #515

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobrik
Copy link
Contributor

@bobrik bobrik commented Jan 20, 2025

See #488 for more details.

With exp2zero histogram:

  • Go:
$ go run cmd/derp/main.go
poc_metric_bucket{le="0"} 1
poc_metric_bucket{le="1"} 2
poc_metric_bucket{le="2"} 3
poc_metric_bucket{le="4"} 5
poc_metric_bucket{le="8"} 9
poc_metric_bucket{le="+Inf"} 9
poc_metric_sum 36
poc_metric_count 9
  • ebpf_exporter:
ebpf_exporter_poc_exp2zero_values_bucket{le="0"} 1
ebpf_exporter_poc_exp2zero_values_bucket{le="1"} 2
ebpf_exporter_poc_exp2zero_values_bucket{le="2"} 3
ebpf_exporter_poc_exp2zero_values_bucket{le="4"} 5
ebpf_exporter_poc_exp2zero_values_bucket{le="8"} 9
ebpf_exporter_poc_exp2zero_values_bucket{le="+Inf"} 9
ebpf_exporter_poc_exp2zero_values_sum 36
ebpf_exporter_poc_exp2zero_values_count 9

With exp2 histogram:

  • Go:
$ go run cmd/derp/main.go
poc_metric_bucket{le="1"} 1
poc_metric_bucket{le="2"} 2
poc_metric_bucket{le="4"} 4
poc_metric_bucket{le="8"} 8
poc_metric_bucket{le="+Inf"} 8
poc_metric_sum 36
poc_metric_count 8
  • ebpf_exporter
ebpf_exporter_poc_exp2_values_bucket{le="1"} 1
ebpf_exporter_poc_exp2_values_bucket{le="2"} 2
ebpf_exporter_poc_exp2_values_bucket{le="4"} 4
ebpf_exporter_poc_exp2_values_bucket{le="8"} 8
ebpf_exporter_poc_exp2_values_bucket{le="+Inf"} 8
ebpf_exporter_poc_exp2_values_sum 36
ebpf_exporter_poc_exp2_values_count 8

@bobrik bobrik force-pushed the ivan/off-by-one-histogram branch 2 times, most recently from 4fde27c to 7157947 Compare January 20, 2025 19:48
See cloudflare#488 for more details.

With `exp2zero` histogram:

* Go:

```
$ go run cmd/derp/main.go
poc_metric_bucket{le="0"} 1
poc_metric_bucket{le="1"} 2
poc_metric_bucket{le="2"} 3
poc_metric_bucket{le="4"} 5
poc_metric_bucket{le="8"} 9
poc_metric_bucket{le="+Inf"} 9
poc_metric_sum 36
poc_metric_count 9
```

* `ebpf_exporter`:

```
ebpf_exporter_poc_exp2zero_values_bucket{le="0"} 1
ebpf_exporter_poc_exp2zero_values_bucket{le="1"} 2
ebpf_exporter_poc_exp2zero_values_bucket{le="2"} 3
ebpf_exporter_poc_exp2zero_values_bucket{le="4"} 5
ebpf_exporter_poc_exp2zero_values_bucket{le="8"} 9
ebpf_exporter_poc_exp2zero_values_bucket{le="+Inf"} 9
ebpf_exporter_poc_exp2zero_values_sum 36
ebpf_exporter_poc_exp2zero_values_count 9
```

With `exp2` histogram:

* Go:

```
$ go run cmd/derp/main.go
poc_metric_bucket{le="1"} 1
poc_metric_bucket{le="2"} 2
poc_metric_bucket{le="4"} 4
poc_metric_bucket{le="8"} 8
poc_metric_bucket{le="+Inf"} 8
poc_metric_sum 36
poc_metric_count 8
```

* `ebpf_exporter`

```
ebpf_exporter_poc_exp2_values_bucket{le="1"} 1
ebpf_exporter_poc_exp2_values_bucket{le="2"} 2
ebpf_exporter_poc_exp2_values_bucket{le="4"} 4
ebpf_exporter_poc_exp2_values_bucket{le="8"} 8
ebpf_exporter_poc_exp2_values_bucket{le="+Inf"} 8
ebpf_exporter_poc_exp2_values_sum 36
ebpf_exporter_poc_exp2_values_count 8
```
@bobrik bobrik force-pushed the ivan/off-by-one-histogram branch from 7157947 to 23cc1a6 Compare January 21, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant