dotnet / dotnet/yarp

Discuss: Should HttpForwarder emit ForwarderStage.SendAsyncStop on error?

Open
#1,211 1 comment 0 reactions 0 assignees View on GitHub
Type: Idea
Dominant language
C#
Stars
9.6k
Forks
933
Avg merge
12d 18h
Merged PRs (30d)
2

Description

### What should we add or change to make your life better?
This issue is meant more to document current behavior and to create a place to discuss, rather than necessarily to suggest a change.

`HttpForwarder` today emits a `ForwarderStage.SendAsyncStart` event when calling the underly9ing `httpClient.SendAsync`, but it only emits the paired `ForwarderStage.SendAsyncStop` upon success. Failures / cancellations end up without a matching Stop event.

While this is not a blocker (e.g. consumers can leverage the `ForwarderStop` event to know that the entire proxy is done, including the `httpClient.SendAsync` call), not having the `SendAsyncStop` event may be unexpected and might violate the [Principle of Least Astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment).

### Why is this important to you?
We only found out about this after running YARP in production for a while and noticing our telemetry wasn't coming precisely how we had designed it. Other people may similarly be caught by surprise, leading to some rework.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.