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

Track Cancelled/Aborted Request #5302

Closed
cliedeman opened this issue Feb 1, 2024 · 7 comments
Closed

Track Cancelled/Aborted Request #5302

cliedeman opened this issue Feb 1, 2024 · 7 comments
Labels
enhancement New feature or request Stale Issues and pull requests which have been flagged for closing due to inactivity

Comments

@cliedeman
Copy link
Contributor

Feature Request

I would like to track the percentage of aborted/cancelled http server requests

Describe the solution you'd like:

https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpcontext.requestaborted?view=aspnetcore-8.0

Describe alternatives you've considered.

Custom Enrichment

Additional Context

Add any other context about the feature request here.

@cliedeman cliedeman added the enhancement New feature or request label Feb 1, 2024
@cijothomas
Copy link
Member

Can you clarify the ask some more?

@cliedeman
Copy link
Contributor Author

Sure.

Here is an example of how we could do it with enrich.

                    .AddAspNetCoreInstrumentation(opts =>
                    {
                        opts.Enrich = (string _, HttpContext context, ref TagList tags) =>
                        {
                            tags.Add("cancelled", context.RequestAborted.IsCancellationRequested);
                        };
                    })

@cijothomas
Copy link
Member

I see you are asking if the asp.net core instrumentation should do this by default, without having to write the Enrich? Then the answer is generally no, as the instrumentation follows otel conventions, and there isn't anything about "cancellation requested". It is possible to propose something to the Otel Semantic Conventions group, but its usually accepted for very common things. Your best bet would likely be to do such customizations via Enrich itself.

@cliedeman
Copy link
Contributor Author

cliedeman commented Feb 3, 2024

thanks @cijothomas that makes sense.

I looked around in the semantic conventions at this PR and this open issue

https://opentelemetry.io/docs/specs/semconv/http/http-spans/#common-attributes

According to the docs for error.type we could stipulate timeout or requestAborted in the error.type.

Currently a request would display as successful in the traces/metrics but actually be aborted (aka failed)?

Copy link
Contributor

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Nov 30, 2024
Copy link
Contributor

github-actions bot commented Dec 7, 2024

Closed as inactive. Feel free to reopen if this issue is still a concern.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2024
@cliedeman
Copy link
Contributor Author

@cijothomas is this possible now? The linked pull request isn't very clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants