Skip to content

Commit

Permalink
instrumenting controller to log system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonh-msft committed Oct 24, 2016
1 parent eceda45 commit c3e1c94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CSharp/core-AppInsights/Controllers/MessagesController.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace AppInsightsBot
{
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;

[BotAuthentication]
public class MessagesController : ApiController
Expand All @@ -31,6 +31,9 @@ public async Task<HttpResponseMessage> Post([FromBody]Activity activity)

private Activity HandleSystemMessage(Activity message)
{
WebApiApplication.Telemetry.TrackEvent(@"SystemMessage",
new System.Collections.Generic.Dictionary<string, string> { { @"Type", message.Type } });

if (message.Type == ActivityTypes.DeleteUserData)
{
// Implement user deletion here
Expand Down

0 comments on commit c3e1c94

Please sign in to comment.