You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1091 makes sure that AspNetCoreErrorDiagnosticsSubscriber can only be registered once.
That's the only check - other DiagnosticsSubscribers can be registered multiple times. Basically all DiagnosticsSubscribers are designed to be registered only once - if we register them multiple times each instance will create its own spans, which never really makes sense.
For example:
//adds the same HttpDiagnosticsSubscriber twice
app.UseElasticApm(_agent, _agent.Logger, new HttpDiagnosticsSubscriber(), new HttpDiagnosticsSubscriber());
//this could be called multiple times and also does not care if HttpDiagnosticsSubscriber is already added
Agent.Subscribe(new HttpDiagnosticsSubscriber());
The task here would be to make sure that each these subscribers can only be registered once.
First idea: let's just check if an instance is already added, if so, then ignore each subsequent registration for an already registered listener.
The text was updated successfully, but these errors were encountered:
This commit ignores duplicate subscriptions of the same
diagnostic listener type by default. The IDiagnosticListener
has a property to allow duplicates, which is required
for some DiagnosticListener names like SqlClientDiagnosticListener,
which emit events from more than one listener with that name.
Closes#1119
From #1091 (comment).
#1091 makes sure that
AspNetCoreErrorDiagnosticsSubscriber
can only be registered once.That's the only check - other DiagnosticsSubscribers can be registered multiple times. Basically all DiagnosticsSubscribers are designed to be registered only once - if we register them multiple times each instance will create its own spans, which never really makes sense.
For example:
The task here would be to make sure that each these subscribers can only be registered once.
First idea: let's just check if an instance is already added, if so, then ignore each subsequent registration for an already registered listener.
The text was updated successfully, but these errors were encountered: