Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/DocumentClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ private void InitializeClientTelemetry()
this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry(
clientId: this.clientId,
httpClient: this.httpClient,
userAgent: this.ConnectionPolicy.UserAgentContainer.UserAgent,
userAgent: this.ConnectionPolicy.UserAgentContainer.BaseUserAgent,
connectionMode: this.ConnectionPolicy.ConnectionMode,
authorizationTokenProvider: this.cosmosAuthorization,
diagnosticsHelper: DiagnosticsHandlerHelper.Instance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ private static void AssertAccountLevelInformation(
Assert.IsNotNull(telemetryInfo.ProcessId);
Assert.AreEqual(HashingExtension.ComputeHash(System.Diagnostics.Process.GetCurrentProcess().ProcessName), telemetryInfo.ProcessId);
Assert.IsNotNull(telemetryInfo.UserAgent);
Assert.IsFalse(telemetryInfo.UserAgent.Contains("userAgentSuffix"), "Useragent should not have suffix appended"); // Useragent should not contain useragentsuffix as it can have PII
Assert.IsNotNull(telemetryInfo.ConnectionMode);

if(!string.IsNullOrEmpty(telemetryInfo.MachineId))
Expand Down Expand Up @@ -1090,7 +1091,8 @@ private async Task<Container> CreateClientAndContainer(ConnectionMode mode,
}

this.cosmosClientBuilder = this.cosmosClientBuilder
.WithHttpClientFactory(() => new HttpClient(handlerHelper));
.WithHttpClientFactory(() => new HttpClient(handlerHelper))
.WithApplicationName("userAgentSuffix");

this.cosmosClient = mode == ConnectionMode.Gateway
? this.cosmosClientBuilder.WithConnectionModeGateway().Build()
Expand Down