-
Notifications
You must be signed in to change notification settings - Fork 287
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
Lost many context fields in 2.5.0 #708
Comments
Note, reverting to 2.4.0 resolved my issue. |
Looks like the same problem as #706 |
Hi @pharring, can you please clarify where? |
I'm sorry, I deleted my comment because I think it was unrelated and distracted from the issue at hand. |
@pharring
It’s not required as telemetry is initialized in the Track call anyway. In other StartOperation methods, I presume, it’s needed immediately for some reasons.
Anyway, this code shipped in 2.6 and cannot be the reason for 2.5 issue
|
The problem is indeed easy to repo
The root cause: TelemetryContext is not initialized in because ITelemetry.OperationContext (device context, etc) are not yet initialized by lazy initialization: internal void Initialize(TelemetryContext source, string instrumentationKey)
{
Property.Initialize(ref this.instrumentationKey, instrumentationKey);
this.component?.CopyFrom(source);
this.device?.CopyFrom(source);
this.cloud?.CopyFrom(source);
this.session?.CopyFrom(source);
this.user?.CopyFrom(source);
this.operation?.CopyFrom(source);
this.location?.CopyFrom(source);
this.Internal.CopyFrom(source);
} All of them are null i.e. CopyTo is not called. 2.4 TelemetryContext.Intitialize - https://github.com/Microsoft/ApplicationInsights-dotnet/blob/v2.4.0/src/Core/Managed/Shared/DataContracts/TelemetryContext.cs#L140 2.5 TelemetryContext.Initialize - https://github.com/Microsoft/ApplicationInsights-dotnet/blob/v2.5.0/src/Microsoft.ApplicationInsights/DataContracts/TelemetryContext.cs#L155 TelemetyContext had a lot of changes from 2.4 |
Today we released Microsoft.ApplicationInsights (v2.5.1) and Microsoft.ApplicationInsights.Web (v2.5.1) with this fix. |
I am having trouble tracking down the expected behavior, but in the latest version various important context fields such as Context.Component.Version are no longer being transmitted to the service and show as "Undefined" in my data. Upon examining the telemetry object, I see these tags are showing up under the "Sanitized" property. Is this expected behavior and how do I resolve? Thanks!
Repro Steps
Actual Behavior
Version shows up in Azure portal as
[undefined]
Expected Behavior
Version should show up correctly....
Version Info
SDK Version : 2.5.0
.NET Version : 4.5.2
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : c#/nuget
OS : Windows 10
The text was updated successfully, but these errors were encountered: