This repository was archived by the owner on Jul 9, 2025. It is now read-only.
fix: Register IBotTelemetryClient and add telemetry initializer middleware…#2916
Merged
fix: Register IBotTelemetryClient and add telemetry initializer middleware…#2916
Conversation
… to the adapter pipeline
carlosscastro
suggested changes
May 7, 2020
| }); | ||
| services.AddSingleton<IBotTelemetryClient, BotTelemetryClient>(); | ||
|
|
||
| var sp = services.BuildServiceProvider(); |
Member
There was a problem hiding this comment.
The github actions is issuing some good advice. This is expensive to run, please remove it. Instead, in line 169 you can do s.getservice there which is a factory method and will be called after the service provider is built.
If you need to use the telemetry somehwere else, just do as we did with the bot and use the factory method instead of the instance method to do deferred resolution. Ping me if you want to chat more about this.
Contributor
Author
There was a problem hiding this comment.
Sorry, I had done this for passing in TelemetryInitializerMiddleware on line 160, but missed the fact that I had access to the service provider here (which I didn't think I did). Thanks for the catch. I'll amend now,
carlosscastro
previously approved these changes
May 8, 2020
cwhitten
approved these changes
May 8, 2020
lei9444
pushed a commit
to lei9444/BotFramework-Composer-1
that referenced
this pull request
Jun 15, 2021
…eware… (microsoft#2916) * Register IBotTelemetryClient and add telemetry initializer middleware to the adapter pipeline * Update functions telemetry config and amend webapp implementaton * Remove yarn.lock * Pass instrumentation key to AddBotApplicationInsights method * Explicitly pass the instrumentation key in functions runtime * Fix issues introduced in merge Co-authored-by: Ben Brown <benbro@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2915 - registers the IBotTelemetryClient and adds the TelemetryInitializerMiddleware to the pipeline of the adapter.