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.

Trace Activities from Custom Actions not logged in App Insights

See original GitHub issue

Describe the bug

I am sending trace activities in Custom Action code that the composer bot calls.

await dc.Context.SendActivityAsync(new Activity(type: ActivityTypes.Trace, label: result ? "SmsAction SUCCESS" : "SmsAction FAILED", value: smsMessage));

The custom action is working as expected, and in local development I’m able to see the trace activities (in the emulator and in the WebChat tab in composer.) After deploying to Azure with this in appsettings, I do not see any traces in that App Insights resource:

   "telemetry": {
      "logActivities": true,
      "logPersonalInformation": false,
      "options": {
        "instrumentationKey": "<key>"
      }
    },

Version

v2.1.0

Browser

  • Electron distribution
  • Chrome
  • Safari
  • Firefox
  • Edge

OS

  • macOS
  • Windows
  • Ubuntu

To Reproduce

Steps to reproduce the behavior:

  1. Use custom action that sends trace activity
  2. Verify it’s working from your composer dialog
  3. Deploy to Azure with telemetry settings
  4. Search App Insights logs for the trace activity

Expected behavior

Trace activity from Custom Action should be logged in App Insights.

Screenshots

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Steveniccommented, Sep 8, 2021
1reaction
tonyanzianocommented, Sep 8, 2021

Hey @lshade ,

I spoke with a teammate and they informed me that Trace activities are only for debugging and are not logged to App Insights because they contain the entire dialog stack JSON and could have some state data that should not be persisted to the instance.

I think the way to go is to use the TelemetryLoggerMiddleware inside of your custom action – configured with your App Insights credentials.

I will try to confirm this and get more details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Track custom operations with Application Insights .NET SDK
This article provides guidance on how to track custom operations with the Application Insights SDK. This documentation is relevant for:.
Read more >
Application Insights not logging custom events - Stack Overflow
Currently I'm using the Free version of Application Insights. var appInsights = new TelemetryClient(); appInsights. TrackEvent(eventName, ...
Read more >
No custom Events or custom Metrics in the App Insights #196
But my problem is that custom Events and custom Metrics in Nodejs SDK do not show up in the charts. There are no...
Read more >
Custom Events and Metrics :: Application Insights (5 of 6)
ObjectiveThis course demonstrates the processes for configuring a web application to use Application Insights for performance tracking, log ...
Read more >
Structured Logging In Microsoft's Azure Application Insights
This becomes especially critical with automatic logging frameworks/SDKs like Application Insights. Azure Application Insights logs all the ...
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