-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
HttpClient Diagnostics: deprecated events issue #21273
Comments
Another solution could be to use different DiagnosticListeners names so it will be cheaper to check if someone listens to one of them with no-arg |
Yes, we know about users of the old events get broken if there is also a client using the new events. The idea was that the tools using the old events should quickly migrate to the new events. In general to the extent possible our philosophy is to try not to compromise on the future for the sake of the past. Thus we should be investing effort in upgrading the tools that use the old events rather than in improving compatibility. |
That is correct that tools could migrate to the new events, however end users need to update tools. |
If there is enough compatibility pain than we should be looking at fixing it. However we should have a clear understanding what the impact is, how likely it is to happen, and how easy is it to work around. |
Multiple listeners/tracers are a challenge for other reasons as well. Imagine both are calling SetParentId() with different IDs. |
I think part of the issue here is that if Glimpse or AI or anyone else wants to support v1 and v2. In this case our consuming code base would be listening to both events. The original though was to make these events mutually exclusive to avoid both events firing... hence if one consumer was listening to v2 events, the system would disable v1 events. We can probably handle this implementation detail for code we own (i.e. Glimpse, AI, etc) but others outside of MS have started listening to DS events and hence just arbitrary picking one vs the other doesn't seem to make much sense. Hence the thought was that if consumers who want to support v1 and v2 have some way of knowing if they should expect v2 events, they can disable their v1 listeners (i.e. they would return |
I am looking at this now. |
Addresses https://github.com/dotnet/corefx/issues/18762 Basically we always check if a client needs deprecated events (previously we checked only if new events were not enabled). This allows clients to support both new and old simultaneously.
Addresses https://github.com/dotnet/corefx/issues/18762 Basically we always check if a client needs deprecated events (previously we checked only if new events were not enabled). This allows clients to support both new and old simultaneously.
Addresses https://github.com/dotnet/corefx/issues/18762 Basically we always check if a client needs deprecated events (previously we checked only if new events were not enabled). This allows clients to support both new and old simultaneously.
Fixed by dotnet/corefx#19659 |
In PR dotnet/corefx#16393 we have changed logging (DiagnosticSource) in HttoClient and introduced a new events:
We kept events that have been previously fired, but deprecated them:
We also made new and old events mutually exclusive.
However there is a valid production scenario when there are two listeners in the application that want different set of events:
e.g. ApplicationInsights for the 'new' events and Glimpse for the 'old' events. With mutual exclusiveness, only 'new' listener will receive any events.
Besides Glimpse, VisualStudio consumes 'old' events, however I do not know whether it is internal logging or listener is somehow injected into the application where other listeners may exist; may be @nbilling can provide more details on it.
Potentially there are other consumers affected by this change.
Simple solution would be to check for deprecated event listener with IsEnabled method even if there was a listener to new event, however the assumption is that frequently there will be just one listener.
IsEnabled for deprecated events may be cached under the assumption that there are no consumers that dynamically subscribe and unsubscribe.
/cc @vancem @avanderhoorn @nbilling @cwe1ss
The text was updated successfully, but these errors were encountered: