-
Notifications
You must be signed in to change notification settings - Fork 185
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
Activity.Current null in isolated Azure Function v4 in .NET 6 #914
Comments
Any one faced this issue? |
Hi @debasish-das-it Thank you for the feedback, we will discuss this issue internally and let you know about the findings soon! |
Thanks @Ved2806 |
@debasish-das-it Could you share the relevant part of the code where you are getting this issue? |
hello @kshyju I am facing issue in the line with var correlation_id = Activity.Current.RootId; of the code. i get null for Activity.Current.
|
This should be addressed. Notes for the logic:
|
@fabiocav Not sure how to achieve that. |
Any Update on this? |
We have the same problem here. |
@debasish-das-it you can start an activity by using the traceparent form the context. string traceparent = "get the traceparent from TraceContext.Attributes"; |
@getsetcode. can you please share the working approach code. |
@debasish-das-it I am also facing this issue. Did you find any solution to resolve this? |
General advice, whether this is a bug or not, always check for See here |
I'm also experiencing this with a ServiceBusTrigger on a brand new .NET isolated v4 function. Our basic setup setup is API -> topic -> function #1 -> queue -> function 2. In application insights, I get telemetry up to and including function #1. The subsequent telemetry in the entire operation is not correlated. I tried debugging function #1 and can see that Activity.Current is null, which is a bit confusing since the telemetry from function #1 is correlated. Maybe switching to using an output binding, instead of using the Service Bus SDK will fix this? But it would be nice to be able to access the correlation ID for other purposes. |
@fabiocav Any update on when the development will be complete and we can refer Activity.Current in Azure Functions? |
We don't have any update for this at the moment, but we are evaluating the observability experience in Functions and will get back to this soon. |
Any news? |
Can you try the latest AppInsights preview package? https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ApplicationInsights/1.0.0-preview4 |
@jviau yes, activity is created. Would be good to know if there is any roadmap for a stable version. |
@Qualizorg - this would be directly related to that: Azure/azure-functions-host#9273. This is a proposal to align Functions telemetry with OpenTelemetry, and this package would fall under that work. |
Closing this as it is addressed by the preview package. |
Activity.Current appears null in isolated Azure Function v4 in .NET 6. can some one help me to fix this issue.
Following my project .csproj content.
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <AzureFunctionsVersion>v4</AzureFunctionsVersion> <OutputType>Exe</OutputType> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <Compile Remove="Clients\**" /> <EmbeddedResource Remove="Clients\**" /> <None Remove="Clients\**" /> </ItemGroup> <ItemGroup> <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" /> <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.3.0" /> <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.3.0" OutputItemType="Analyzer" /> <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.3.0" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> </ItemGroup> <ItemGroup> <None Update="host.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="local.settings.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </None> <None Update="swagger.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> <ItemGroup> <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" /> </ItemGroup> </Project>
The text was updated successfully, but these errors were encountered: