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

[processor/spanmetrics] Span metrics produces histograms with incorrect bucket counts #11784

Closed
jack-berg opened this issue Jun 28, 2022 · 2 comments
Labels
bug Something isn't working priority:p2 Medium processor/spanmetrics Span Metrics processor

Comments

@jack-berg
Copy link
Member

Describe the bug
Given a set of N bucket boundaries, the spanmetrics processor produces N bucket counts, where it should produce N+1.

Steps to reproduce
Send some spans through the processor and export the data with the logging exporter. Notice data that looks like:

collector-collector-1  | Metric #5
collector-collector-1  | Descriptor:
collector-collector-1  |      -> Name: latency
collector-collector-1  |      -> Description: 
collector-collector-1  |      -> Unit: 
collector-collector-1  |      -> DataType: Histogram
collector-collector-1  |      -> AggregationTemporality: AGGREGATION_TEMPORALITY_DELTA
collector-collector-1  | HistogramDataPoints #0
collector-collector-1  | Data point attributes:
collector-collector-1  |      -> service.name: STRING(foo)
collector-collector-1  |      -> operation: STRING(ping)
collector-collector-1  |      -> span.kind: STRING(SPAN_KIND_INTERNAL)
collector-collector-1  |      -> status.code: STRING(STATUS_CODE_UNSET)
collector-collector-1  |      -> http.method: STRING(GET)
collector-collector-1  | StartTimestamp: 2022-06-28 17:34:55.393150425 +0000 UTC
collector-collector-1  | Timestamp: 2022-06-28 17:35:00.868986261 +0000 UTC
collector-collector-1  | Count: 4
collector-collector-1  | Sum: 347.312458
collector-collector-1  | ExplicitBounds #0: 0.100000
collector-collector-1  | ExplicitBounds #1: 1.000000
collector-collector-1  | ExplicitBounds #2: 2.000000
collector-collector-1  | ExplicitBounds #3: 6.000000
collector-collector-1  | ExplicitBounds #4: 10.000000
collector-collector-1  | ExplicitBounds #5: 100.000000
collector-collector-1  | ExplicitBounds #6: 250.000000
collector-collector-1  | ExplicitBounds #7: 9223372036854.775391
collector-collector-1  | Buckets #0, Count: 0
collector-collector-1  | Buckets #1, Count: 0
collector-collector-1  | Buckets #2, Count: 0
collector-collector-1  | Buckets #3, Count: 0
collector-collector-1  | Buckets #4, Count: 0
collector-collector-1  | Buckets #5, Count: 2
collector-collector-1  | Buckets #6, Count: 2
collector-collector-1  | Buckets #7, Count: 0

What did you expect to see?
8 buckets counts for the 7 bucket boundaries, as described in the histogram proto.

What did you see instead?
7 bucket counts for 7 bucket boundaries.

What version did you use?
Head

Additional context
Perhaps the root cause of #11782.

@jack-berg jack-berg added the bug Something isn't working label Jun 28, 2022
@TylerHelmuth TylerHelmuth added processor/spanmetrics Span Metrics processor priority:p2 Medium labels Jun 28, 2022
@TylerHelmuth
Copy link
Member

pinging @albertteoh as code owner

@albertteoh
Copy link
Contributor

Thanks for reporting this @jack-berg (and for the ping @TylerHelmuth 😄 ).

I've created the following PR to address this bug. I hope I've understood the bug correctly; please let me know if not: #11884.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Medium processor/spanmetrics Span Metrics processor
Projects
None yet
Development

No branches or pull requests

3 participants