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

MetricPoint.UpdateWithExemplar method honors isSampled parameter only for DoubleSumIncomingDelta case #4851

Closed
ImoutoChan opened this issue Sep 13, 2023 · 4 comments · Fixed by #5004
Assignees
Labels
bug Something isn't working

Comments

@ImoutoChan
Copy link
Contributor

Bug Report

Latest master:

internal void UpdateWithExemplar(long number, ReadOnlySpan<KeyValuePair<string, object?>> tags, bool isSampled)

net7.0

Symptom

isSampled parameter is only checked in AggregationType.DoubleSumIncomingDelta case. That's why some exemplars are reported even when exemplar filter returns false.

What is the expected behavior?

isSampled should be checked before each this.mpComponents.ExemplarReservoir!.Offer call.

What is the actual behavior?

isSampled is only checked once in the first case.

Additional Context

It would be great to have the ability to overwrite ExemplarReservoir. In this case, I could easily fix this bug in my codebase without waiting for bug fixes. Unfortunately, everything is internal in this library. Please consider providing an extension point to change ExemplarReservoir.

Another bug (maybe not in this library) is that SimpleExemplarReservoir can report exemplars with null trace id and trace span:
SimpleExemplarReservoir.cs#L89)

This breaks open-collector's open metric output and Prometheus with empty exemplars. Again, because there is no extension point I can't fix it myself, so providing it would be a great help for the dotnet community.

@ImoutoChan ImoutoChan added the bug Something isn't working label Sep 13, 2023
@cijothomas cijothomas self-assigned this Sep 14, 2023
@cijothomas
Copy link
Member

It would be great to have the ability to overwrite ExemplarReservoir. In this case, I could easily fix this bug in my codebase without waiting for bug fixes. Unfortunately, everything is internal in this library. Please consider providing an extension point to change ExemplarReservoir.

Yes, this will eventually be offered. Reservoir and Filter are the 2 extensibility points that'll be available in the future.

@cijothomas
Copy link
Member

Another bug (maybe not in this library) is that SimpleExemplarReservoir can report exemplars with null trace id and trace span:

TraceId and SpanId in exemplar are optional. So why is this a bug?

@cijothomas
Copy link
Member

@ImoutoChan Would you be willing to send a PR to fix this?

@ImoutoChan
Copy link
Contributor Author

Yes, I'll try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants