question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azure functions and application insights. AddTag() working but not AddBaggage()

See original GitHub issue

Please provide a succinct description of the issue.

 [FunctionName(nameof(MyOrchestrator))]
        public async Task RunAsync([OrchestrationTrigger] IDurableOrchestrationContext context)
        {
            var input = context.GetInput<Input>();
            Activity.Current?.AddTag("tag", input.test1.ToString());
            Activity.Current?.AddBaggage("baggage", input.test2.ToString());
}

Provide the steps required to reproduce the problem

When viewing the “performance” tab in application insights I can see the tag that I have added, but I cannot see the property for baggage

Expected behavior

The baggage will appear the same as the tag in custom properties of the request

Actual behavior

I can see the tag, but not the property for baggage

Known workarounds

In order to see the tag I had to explicitly use

<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0"></PackageReference>

Related information

Provide any related information

<PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <AzureFunctionsVersion>v3</AzureFunctionsVersion> <Configurations>Debug;Release;Integration Test CI</Configurations> <Platforms>AnyCPU</Platforms> </PropertyGroup> <ItemGroup> <PackageReference Include="AzureFunctions.Extensions.DependencyInjection" Version="1.1.3" /> <PackageReference Include="Guard.Net" Version="1.2.0" /> <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.6.0" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.0" /> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" /> <PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0"> <NoWarn>NU1605</NoWarn> </PackageReference> </ItemGroup>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ramya894commented, Sep 21, 2022

@miiic we will check this with our next level team and update you with the results.

0reactions
msftbot[bot]commented, Oct 23, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support Activity.Tags · Issue #562
Activity.Tags is a property bag with string key value pairs. Tags only belong to current activity and does not flow to the child...
Read more >
Log custom object in Application Insights from Function ...
Diagnostics.Activity.Current.AddBaggage(). This works without additional configuration (e.g. scopes are already enabled by default on AI).
Read more >
Azure function running but no "requests" showing up in ...
The issue I'm seeing seems similar to this question: ...
Read more >
Configure monitoring for Azure Functions
Learn how to connect your function app to Application Insights for monitoring and how to configure data collection.
Read more >
Application insights for function app not showing console ...
I am writing to figure out why application insights for function apps are not showing any console log statements in the function app's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found