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
{{ message }}
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
In the below code lastIKeyLookedUp is always null and is never equal to requestTelemetry.Context.InstrumentationKey so lastAppIdUsed never gets a chance to be anything except null.
when lastIKeyLookedUp does not match the current items ikey, we trigger a app id lookup, and stores ikey to lastIKeyLookedUp. I believe the issue is relying incorrectly on ApplicationIdProvider to resolve ikey to appid in the very 1st call. its not guaranteed to return app id for the 1st time (because it don't wait for task to complete), but gets it resolved by subsequent calls. The above perf fix prevented asking for appid once lastIKeyLookedUp is set.
This is an issue with actual AppIdProvider, not with a DictionaryProvider. Functional Tests used DictionaryProvider, hence did not catch the issue.
The fix would be to do look up when lastAppIdUsed is null.
Repro Steps
Actual Behavior
app always returns
Request-Context: appId=
(empty) headerExpected Behavior
non-empty appid is returned
Version Info
It was introduced in 2.8.0-beta1 with perf fixes:
In the below code
lastIKeyLookedUp
is always null and is never equal torequestTelemetry.Context.InstrumentationKey
solastAppIdUsed
never gets a chance to be anything except null.ApplicationInsights-aspnetcore/src/Microsoft.ApplicationInsights.AspNetCore/DiagnosticListeners/Implementation/HostingDiagnosticListener.cs
Lines 525 to 532 in a14386c
The text was updated successfully, but these errors were encountered: