[release/9.0.3xx] Use full Application Insights connection string instead of instrumentation key#55180
Open
nagilson wants to merge 1 commit into
Open
Conversation
…ation key Backport of dotnet#55127. Use the proper Application Insights connection string (including IngestionEndpoint, LiveEndpoint, and ApplicationId) instead of an instrumentation-key-only connection string. Resolving the endpoints from a bare instrumentation key requires an extra network round-trip; supplying the full connection string shaves 200+ms off the cost to POST telemetry. See dotnet#55127 for motivation and measurements. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit e17b6fc)
Contributor
There was a problem hiding this comment.
Pull request overview
Backports a small telemetry configuration update to release/9.0.3xx so the CLI telemetry client uses a full Application Insights connection string (including explicit ingestion/live endpoints) instead of an instrumentation-key-only connection string.
Changes:
- Update the telemetry
ConnectionStringconstant to includeIngestionEndpoint,LiveEndpoint, andApplicationIdmetadata alongside the existingInstrumentationKey.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Open
3 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #55127 to
release/9.0.3xx.The SDK telemetry client was configured with an Application Insights connection string that only contained the bare
InstrumentationKey. When only an instrumentation key is supplied, the Azure Monitor client must resolve the ingestion/live endpoints at runtime, which adds an extra network round-trip on everyPOSTof telemetry. Supplying the full connection string (withIngestionEndpoint,LiveEndpoint, andApplicationId) removes that round-trip.Instrumentation-key-only configuration is also the legacy approach; Azure Monitor has moved to connection strings. See the Microsoft Learn documentation: https://learn.microsoft.com/azure/azure-monitor/app/connection-strings
Motivation and measurements are in #55127 (and #55126). The telemetry code was substantially refactored in
main, so this could not be cherry-picked cleanly; the equivalent one-line change is applied tosrc/Cli/dotnet/Telemetry/Telemetry.cson this branch.Tactics
Summary
Switches the SDK telemetry client from an instrumentation-key-only Application Insights connection string to the full connection string (including
IngestionEndpoint,LiveEndpoint, andApplicationId). Connection strings are the current Azure Monitor standard and are ~200ms faster toPOSTbecause the ingestion endpoints no longer have to be resolved from a bare instrumentation key at runtime. We have moved on from instrumentation keys to connection strings (https://learn.microsoft.com/azure/azure-monitor/app/connection-strings). This is a one-line change tosrc/Cli/dotnet/Telemetry/Telemetry.cs, backporting #55127.Customer Impact
Improves the time to
POSTtelemetry (~200ms faster per post) and improves data consistency, since telemetry is sent directly to the correct ingestion/live endpoints rather than relying on endpoint resolution from a bare instrumentation key. There is no customer-facing behavior change other than reduced telemetry overhead.Regression?
No. This is not a regression; it is a performance and correctness improvement to how telemetry is posted.
Testing
Tested by posting telemetry using
curland by running existing SDK versions that carry the same fix, confirming telemetry is ingested correctly with the full connection string and that thePOSTcost is reduced (~250-300ms with the full connection string vs. ~535-557ms with the instrumentation-key-only string, as measured in #55127).Risk
Low. The change is a single-line update to the telemetry connection string constant. The connection string points to the same Application Insights resource (same instrumentation key), only adding the explicit endpoint/application metadata. See #54613 for an example of the tactics template.