Azure / botbuilder-instrumentation-cs

BotBuilder Instrumentation (C#)
MIT License
5 stars 9 forks source link

Using telemetry within a dialog #7

Closed garypretty closed 7 years ago

garypretty commented 7 years ago

When I try and use the instrumentation within a dialog I get an error that it cannot be serialized, which makes sense. I have tried registering the service with Autofac, but cannot seem to get this working.

Do you have any examples of using telemetry within a dialog?

Thanks

Gary

morsh commented 7 years ago

@garypretty can you share the code you are trying to run? When working with the node version, I didn't find any problems (I was using an event called trackCustomEvent) so I think there shouldn't be a problem with c# version.

I'll try to get the C# folks to look into this as well.

garypretty commented 7 years ago

Morning.

I got to the bottom of this. We just need to ensure that the field is marked as static when used within a dialog.

I.e.

public static readonly BotFrameworkApplicationInsightsInstrumentation DefaultInstrumentation = DependencyResolver.Current.DefaultInstrumentationWithCognitiveServices;

That resolves the issue.

Gary

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Mor Shemeshmailto:notifications@github.com Sent: 06 August 2017 09:34 To: CatalystCode/botbuilder-instrumentation-csmailto:botbuilder-instrumentation-cs@noreply.github.com Cc: Gary Prettymailto:gary@garypretty.co.uk; Mentionmailto:mention@noreply.github.com Subject: Re: [CatalystCode/botbuilder-instrumentation-cs] Using telemetry within a dialog (#7)

@garyprettyhttps://github.com/garypretty can you share the code you are trying to run? When working with the node version, I didn't find any problems (I was using an event called trackCustomEvent) so I think there shouldn't be a problem with c# version.

I'll try to get the C# folks to look into this as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/CatalystCode/botbuilder-instrumentation-cs/issues/7#issuecomment-320493567, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADuE6ZsuT-4VyxSmv6TFLmt5TPRNazumks5sVXqogaJpZM4Ot3nj.

itye-msft commented 7 years ago

Closing the issue as it seems to be solved.