diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index dc287c8a4d..590e89297a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -101,6 +101,9 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Enable Client Telemetry")] public bool EnableTelemetry { get; set; } + [Option(Required = false, HelpText = "Enable Distributed Tracing")] + public bool EnableDistributedTracing { get; set; } + [Option(Required = false, HelpText = "Client Telemetry Schedule in Seconds")] public int TelemetryScheduleInSec { get; set; } @@ -219,6 +222,8 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true); } + clientOptions.EnableDistributedTracing = this.EnableDistributedTracing; + return new Microsoft.Azure.Cosmos.CosmosClient( this.EndPoint, accountKey, diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh index 2edfb67530..81cafc4a4a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh @@ -54,8 +54,8 @@ sleep 10 #Wait dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait -# Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of open telemetry. -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithOpenTelemetry --enableOpenTelemetry --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk +# Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of distributed tracing (without listener) +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --enableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait #Point read operations