diff --git a/Directory.Build.props b/Directory.Build.props index a24f0ab2ac..eb4940bf4b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,11 +1,11 @@ - 3.33.0 - 3.33.0 + 3.35.0 + 3.35.0 preview - 3.30.8 - 2.0.1 - 2.0.1 + 3.31.2 + 2.0.2 + 2.0.2 preview 1.0.0-preview05 1.1.0-preview3 diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json index 8f858ddb94..1912d16407 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json @@ -51,6 +51,13 @@ ], "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken)[System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Microsoft.Azure.Cosmos.Encryption.Custom.CosmosDataEncryptionKeyProvider+))]": { + "Type": "Method", + "Attributes": [ + "AsyncStateMachineAttribute" + ], + "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void .ctor(Microsoft.Azure.Cosmos.Encryption.Custom.EncryptionKeyWrapProvider, Microsoft.Data.Encryption.Cryptography.EncryptionKeyStoreProvider, System.Nullable`1[System.TimeSpan])[System.ObsoleteAttribute(\"Please use the constructor with EncryptionKeyStoreProvider only.\")]": { "Type": "Constructor", "Attributes": [ @@ -398,6 +405,13 @@ ], "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken)[System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Microsoft.Azure.Cosmos.Encryption.Custom.CosmosDataEncryptionKeyProvider+))]": { + "Type": "Method", + "Attributes": [ + "AsyncStateMachineAttribute" + ], + "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void .ctor(Microsoft.Azure.Cosmos.Encryption.Custom.EncryptionKeyWrapProvider, Microsoft.Data.Encryption.Cryptography.EncryptionKeyStoreProvider, System.Nullable`1[System.TimeSpan])[System.ObsoleteAttribute(\"Please use the constructor with EncryptionKeyStoreProvider only.\")]": { "Type": "Constructor", "Attributes": [ @@ -426,6 +440,11 @@ "Type": "Method", "Attributes": [], "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} diff --git a/Microsoft.Azure.Cosmos.Encryption/changelog.md b/Microsoft.Azure.Cosmos.Encryption/changelog.md index a5e7101074..a8edf3441d 100644 --- a/Microsoft.Azure.Cosmos.Encryption/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption/changelog.md @@ -3,6 +3,16 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [2.0.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.2) - 2023-06-01 + +#### Added +- [#3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Adds support for Microsoft.Azure.Cosmos up to 3.34.0. + +### [2.0.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.2-preview) - 2023-06-01 + +#### Added +- [#3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Adds support for Microsoft.Azure.Cosmos 3.34.0-preview. + ### [2.0.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.1) - 2023-03-11 #### Added diff --git a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj index f58b171cd5..94e93aa6fe 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj @@ -28,11 +28,11 @@ - + - + diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md new file mode 100644 index 0000000000..7821e1eefd --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md @@ -0,0 +1,73 @@ +# Running benchmarks on ARM Tempaltes + +[ARM Templates](https://learn.microsoft.com/azure/azure-resource-manager/templates/) makes executing the Azure Cosmos DB SDK Benchmark extremely easy, with very few steps involved. Plus, it lets you test and evaluate performance quickly on multiple resource (CPU/RAM) configurations and across multiple Azure regions seamlessly. + +For the below steps, you will **need an Azure Subscription**. + +## Steps + +### Deploy with one click + +Just click in the **Deploy to Azure button** and it will guide you into automatically configuring, deploying, and running the benchmark. + +[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-cosmos-dotnet-v3%2Fmaster%2FMicrosoft.Azure.Cosmos.Samples%2FTools%2FBenchmark%2FARMTemplate%2FbenchmarkTemplate.json) + +Please populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). + +Optionally you can modify the other parameters, such as the `throughput` for the container that will get created, the amount of `documents` to insert, the degree of `parallelism`, and if you want the container to be deleted after the benchmark is run (`cleanUpOnFinish` `true/false`). + +Additionally, the template lets you customize the size of the container instance that will be deployed, which you can make as similar as possible to the instance you will be running in production to simulate results. + +### Deploy with Azure CLI + +First open the `parameters.json` file and populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). + + Next, modify the other parameters, such as the `throughput` for the container that will get created, the amount of `documents` to insert, the degree of `parallelism`, and if you want the container to be deleted after the benchmark is run (`cleanUpOnFinish` `true/false`). + + If you're deploying the template to a resource group that does not exist you must create one first. Please note that the name of the resource group can only include alphanumeric characters, periods, underscores, hyphens, and parenthesis. It can be up to 90 characters. The name can't end in a period. To create a resource group use the following command: + ```bash + az group create --name $resourceGroupName --location $location + ``` + + To run the benchmark first navigate to the directory the `benchmarkTemplate.json` and `parameters.json` files are stored and use the Azure CLI with the following command: + ```bash + az deployment group create --resource-group $resourceGroupName --template-file benchmarkTemplate.json --parameters @parameters.json + ``` + +### The Benchmark + +Once you create the benchmark, it will do the following: + +1. It will create a Linux container named `cosmosdbsdkperf` and provision an image with NET 6 inside an instance with the configured CPU and RAM. +![Provisioned Container Instance](./arm1.png) +2. Clone the Azure Cosmos DB SDK repository with the required files +3. Execute the benchmark and provide output logs +4. Stop the instance + +While the container instance is running (or after), you can either use the Azure Portal or the Azure CLI to check the benchmark results with: + +```bash +az container logs -g $resourceGroupName -n cosmosdbsdkperf +``` + +Additionally you can check the logs in the Azure Portal by navigating to the container instance and clicking on the **Logs** tab. + +The logs will show the information, including the initial parameters: + +![Initial benchmark parameters](./arm2.png) + +And the results: + +![Benchmark results](./arm3.png) + +### Clean up + +If you want to remove the Benchmark instance, ypu can delete the container from the Azure Portal. You can also do so from the Azure CLI: + +```bash +az container delete -g $resourceGroupName -n cosmosdbsdkperf +``` + +You can also delete the Benchmark instance from the Azure Portal by navigating to the container instance and clicking on the **Delete** button. + +**Remember to delete the Database and Container** that were created for the Benchmark in your CosmosDB account if you did not use the `CLEANUPFINISH` parameter as `true`. diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png new file mode 100644 index 0000000000..c740b8b3d7 Binary files /dev/null and b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png differ diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm2.png b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm2.png new file mode 100644 index 0000000000..f40e01aa7a Binary files /dev/null and b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm2.png differ diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm3.png b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm3.png new file mode 100644 index 0000000000..639be6ca76 Binary files /dev/null and b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm3.png differ diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json new file mode 100644 index 0000000000..13bb3070da --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json @@ -0,0 +1,154 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "endpoint": { + "type": "string", + "metadata": { + "description": "Your account endpoint" + } + }, + "key": { + "type": "securestring", + "metadata": { + "description": "Your account key" + } + }, + "throughput": { + "type": "string", + "metadata": { + "description": "The throughput for the container." + } + }, + "documents": { + "type": "string", + "metadata": { + "description": "The amount of items to insert." + } + }, + "parallelism": { + "type": "string", + "metadata": { + "description": "The degree of parallelism." + }, + "defaultValue": "-1" + }, + "cleanUpOnFinish": { + "type": "string", + "metadata": { + "description": "Whether to delete the container after the benchmark is run." + }, + "defaultValue": "false" + }, + "containerGroupName": { + "type": "string", + "metadata": { + "description": "Name for the container group" + }, + "defaultValue": "CosmosDBBenchmark" + }, + "containerName": { + "type": "string", + "metadata": { + "description": "Name for the container" + }, + "defaultValue": "cosmosdbsdkperf" + }, + "volumeName": { + "type": "string", + "metadata": { + "description": "Name for the gitRepo volume" + }, + "defaultValue": "cosmosdbsdk" + }, + "port": { + "type": "string", + "metadata": { + "description": "Port to open on the container and the public IP address." + }, + "defaultValue": "80" + }, + "cpuCores": { + "type": "string", + "metadata": { + "description": "The number of CPU cores to allocate to the container." + }, + "defaultValue": "4" + }, + "memoryInGb": { + "type": "string", + "metadata": { + "description": "The amount of memory to allocate to the container in gigabytes." + }, + "defaultValue": "8" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + } + } + }, + "variables": {}, + "resources": [ + { + "name": "[parameters('containerGroupName')]", + "type": "Microsoft.ContainerInstance/containerGroups", + "apiVersion": "2020-11-01", + "location": "[parameters('location')]", + "properties": { + "containers": [ + { + "name": "[parameters('containerName')]", + "properties": { + "image": "mcr.microsoft.com/dotnet/sdk:6.0", + "ports": [ + { + "port": "[parameters('port')]" + } + ], + "resources": { + "requests": { + "cpu": "[parameters('cpuCores')]", + "memoryInGB": "[parameters('memoryInGb')]" + } + }, + "volumeMounts": [ + { + "name": "[parameters('volumeName')]", + "mountPath": "/mnt/gitrepos/", + "readOnly": false + } + ], + "command": [ + "/bin/bash", + "-c", + "[concat('cd /mnt/gitrepos/azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate;export ENDPOINT=\"', parameters('endpoint'),'\";export KEY=\"', parameters('key'),'\";export THROUGHPUT=\"', parameters('throughput'),'\";export DOCUMENTS=\"', parameters('documents'),'\";export PARALLELISM=\"', parameters('parallelism'),'\";export CLEANUPFINISH=\"', parameters('cleanUpOnFinish'),'\";chmod +x run.sh;./run.sh')]" + ] + } + } + ], + "osType": "Linux", + "restartPolicy": "Never", + "ipAddress": { + "type": "Public", + "ports": [ + { + "protocol": "TCP", + "port": "[parameters('port')]" + } + ] + }, + "volumes": [ + { + "name": "[parameters('volumeName')]", + "gitRepo": { + "repository": "https://github.com/Azure/azure-cosmos-dotnet-v3" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json new file mode 100644 index 0000000000..f8b1983b33 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "endpoint": { + "value": "" + }, + "key": { + "value": "" + }, + "throughput": { + "value": "" + }, + "documents": { + "value": "" + }, + "parallelism": { + "value": "-1" + }, + "cleanUpOnFinish": { + "value": "false" + }, + "containergroupname": { + "value": "CosmosDBBenchmark" + }, + "containername": { + "value": "cosmosdbsdkperf" + }, + "volumename": { + "value": "cosmosdbsdk" + }, + "cpuCores": { + "value": "4" + }, + "memoryInGb": { + "value": "8" + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh new file mode 100644 index 0000000000..3b8855a95f --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh @@ -0,0 +1,2 @@ +cd .. +dotnet run -c Release -e ${ENDPOINT} -k ${KEY} -t ${THROUGHPUT} -n ${DOCUMENTS} --pl ${PARALLELISM} --CleanupOnFinish ${CLEANUPFINISH} -w InsertV2BenchmarkOperation \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json new file mode 100644 index 0000000000..028030099b --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json @@ -0,0 +1,5 @@ +{ + "CosmosDBEndPointUrl": "https://localhost:8081", + "CosmosDBAuthorizationKey": "Super secret key", + "ApplicationInsightsConnectionString": "Super secret connection string" +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj new file mode 100644 index 0000000000..59162abaca --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj @@ -0,0 +1,25 @@ + + + + Exe + net6.0 + Cosmos.Samples.ApplicationInsights + Cosmos.Samples.ApplicationInsights + latest + + + + + + + + + + + + + PreserveNewest + + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs new file mode 100644 index 0000000000..288ce80c64 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs @@ -0,0 +1,118 @@ +namespace Cosmos.Samples.ApplicationInsights +{ + using System; + using System.Threading.Tasks; + using Newtonsoft.Json; + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Logging; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + using Microsoft.ApplicationInsights; + using Microsoft.ApplicationInsights.WorkerService; + using Microsoft.Extensions.Logging.ApplicationInsights; + + internal class Program + { + private static readonly string databaseName = "samples"; + private static readonly string containerName = "ai-sample"; + + private static TelemetryClient? _telemetryClient; + + static async Task Main() + { + try + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("AppSettings.json") + .Build(); + + string endpoint = configuration["CosmosDBEndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid CosmosDBEndPointUrl in the appSettings.json"); + } + + string authKey = configuration["CosmosDBAuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid CosmosDBAuthorizationKey in the appSettings.json"); + } + + string aiConnectionString = configuration["ApplicationInsightsConnectionString"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret connection string")) + { + throw new ArgumentException("Please specify a valid ApplicationInsightsConnectionString in the appSettings.json"); + } + + // + IServiceCollection services = new ServiceCollection(); + services.AddApplicationInsightsTelemetryWorkerService((ApplicationInsightsServiceOptions options) => options.ConnectionString = aiConnectionString); + + IServiceProvider serviceProvider = services.BuildServiceProvider(); + _telemetryClient = serviceProvider.GetRequiredService(); + // + + CosmosClientOptions options = new CosmosClientOptions() + { + IsDistributedTracingEnabled = true // Defaults to true, set to false to disable + }; + using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + await Program.RunCrudDemo(container); + } + } + finally + { + // Explicitly calling Flush() followed by sleep is required for Application Insights logging in console apps to ensure that telemetry is sent to the back-end even if application terminates. + _telemetryClient?.Flush(); + await Task.Delay(5000); + + Console.WriteLine("End of demo."); + } + } + + public static async Task RunCrudDemo(Container container) + { + // Any operations will automatically generate telemetry + + for (int i = 1; i <= 5; i++) + { + await container.CreateItemAsync(new Item { Id = $"{i}", Status = "new" }, new PartitionKey($"{i}")); + Console.WriteLine($"Created document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReadItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Read document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReplaceItemAsync(new Item { Id = $"{i}", Status = "updated" }, $"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Updated document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.DeleteItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Deleted document with id: {i}"); + } + } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public string Status { get; set; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln index de1e1f4731..999b48d928 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln +++ b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln @@ -51,6 +51,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelAllVersionsAndDe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelLatestVersionMode", "CFPullModelLatestVersionMode\CFPullModelLatestVersionMode.csproj", "{985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry", "OpenTelemetry\OpenTelemetry.csproj", "{C6EF6948-C085-4013-A21F-99303ECBA7A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationInsights", "ApplicationInsights\ApplicationInsights.csproj", "{55149A3C-A263-4EE5-AD2D-02FE9AC4D291}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -153,6 +157,14 @@ Global {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Release|Any CPU.Build.0 = Release|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json new file mode 100644 index 0000000000..e0d21e3e09 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json @@ -0,0 +1,12 @@ +{ + "Logging": { + "OpenTelemetry": { + "LogLevel": { + "Azure.Cosmos.Operation.Request.Diagnostics": "Warning" + } + } + }, + "CosmosDBEndPointUrl": "https://localhost:8081", + "CosmosDBAuthorizationKey": "Super secret key", + "ApplicationInsightsConnectionString": "Super secret connection string" +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj new file mode 100644 index 0000000000..83224d4570 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj @@ -0,0 +1,24 @@ + + + + Exe + net6.0 + Cosmos.Samples.OpenTelemetry + Cosmos.Samples.OpenTelemetry + latest + + + + + + + + + + + + PreserveNewest + + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs new file mode 100644 index 0000000000..b4729e41c7 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs @@ -0,0 +1,153 @@ +namespace Cosmos.Samples.OpenTelemetry +{ + using global::OpenTelemetry; + using global::OpenTelemetry.Trace; + using global::OpenTelemetry.Resources; + using System; + using System.Threading.Tasks; + using Newtonsoft.Json; + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Azure; + using Microsoft.Extensions.Logging; + using Microsoft.Extensions.Configuration; + using Azure.Monitor.OpenTelemetry.Exporter; + + internal class Program + { + private static readonly string databaseName = "samples"; + private static readonly string containerName = "otel-sample"; + private static readonly string serviceName = "MySampleService"; + + private static TracerProvider? _traceProvider; + + static async Task Main() + { + try + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("AppSettings.json") + .Build(); + + string endpoint = configuration["CosmosDBEndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid CosmosDBEndPointUrl in the appSettings.json"); + } + + string authKey = configuration["CosmosDBAuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid CosmosDBAuthorizationKey in the appSettings.json"); + } + + string aiConnectionString = configuration["ApplicationInsightsConnectionString"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret connection string")) + { + throw new ArgumentException("Please specify a valid ApplicationInsightsConnectionString in the appSettings.json"); + } + + // + ResourceBuilder resource = ResourceBuilder.CreateDefault().AddService( + serviceName: serviceName, + serviceVersion: "1.0.0"); + + // Set up logging to forward logs to chosen exporter + using ILoggerFactory loggerFactory + = LoggerFactory.Create(builder => builder + .AddConfiguration(configuration.GetSection("Logging")) + .AddOpenTelemetry(options => + { + options.IncludeFormattedMessage = true; + options.SetResourceBuilder(resource); + options.AddAzureMonitorLogExporter(o => o.ConnectionString = aiConnectionString); // Set up exporter of your choice + })); + /*.AddFilter(level => level == LogLevel.Error) // Filter is irrespective of event type or event name*/ + + AzureEventSourceLogForwarder logforwader = new AzureEventSourceLogForwarder(loggerFactory); + logforwader.Start(); + + // Configure OpenTelemetry trace provider + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + _traceProvider = Sdk.CreateTracerProviderBuilder() + .AddSource("Azure.Cosmos.Operation") // Cosmos DB source for operation level telemetry + .AddAzureMonitorTraceExporter(o => o.ConnectionString = aiConnectionString) // Set up exporter of your choice + .SetResourceBuilder(resource) + .Build(); + // + + // + CosmosClientOptions options = new CosmosClientOptions() + { + IsDistributedTracingEnabled = true // Defaults to true, set to false to disable + }; + + // + using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + await Program.RunCrudDemo(container); + } + } + finally + { + _traceProvider?.Dispose(); + // Sleep is required for logging in console apps to ensure that telemetry is sent to the back-end even if application terminates. + await Task.Delay(5000); + + Console.WriteLine("End of demo."); + } + } + + public static async Task RunCrudDemo(Container container) + { + // Any operations will automatically generate telemetry + + for(int i = 1; i <= 5; i++) + { + await container.CreateItemAsync(new Item { Id = $"{i}", Status = "new" }, new PartitionKey($"{i}")); + Console.WriteLine($"Created document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReadItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Read document with id: {i}"); + } + + try + { + await container.ReadItemAsync($"random key", new PartitionKey($"random partition")); + } + catch(Exception) + { + Console.WriteLine("Generate exception by reading an invalid key"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReplaceItemAsync(new Item { Id = $"{i}", Status = "updated" }, $"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Updated document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.DeleteItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Deleted document with id: {i}"); + } + } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public string Status { get; set; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt new file mode 100644 index 0000000000..4087f63f84 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt @@ -0,0 +1,1558 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt new file mode 100644 index 0000000000..a365c00c6a --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt @@ -0,0 +1,1499 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs index aa8ff6af62..a479f3d8b0 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs @@ -107,7 +107,9 @@ namespace Microsoft.Azure.Cosmos /// ]]> /// /// - /// Limits on TransactionalBatch requests + /// + /// Limits on TransactionalBatch requests + /// public abstract class TransactionalBatch { /// @@ -244,6 +246,7 @@ public abstract TransactionalBatch PatchItem( /// /// This API only throws on client side exceptions. This is to increase performance and prevent the overhead of throwing exceptions. /// Use on the response returned to ensure that the transactional batch succeeded. + /// Limits on TransactionalBatch requests /// public abstract Task ExecuteAsync( CancellationToken cancellationToken = default); @@ -275,6 +278,7 @@ public abstract Task ExecuteAsync( /// /// This API only throws on client side exceptions. This is to increase performance and prevent the overhead of throwing exceptions. /// Use on the response returned to ensure that the transactional batch succeeded. + /// Limits on TransactionalBatch requests /// public abstract Task ExecuteAsync( TransactionalBatchRequestOptions requestOptions, diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs index 7df0871d74..50098a8057 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs @@ -38,12 +38,7 @@ internal ChangeFeedMode() /// Latest version mode includes item creations and updates, not deletions. /// /// A to receive latest version item changes. -#if PREVIEW - public -#else - internal -#endif - static ChangeFeedMode LatestVersion => ChangeFeedModeIncremental.Instance; + public static ChangeFeedMode LatestVersion => ChangeFeedModeIncremental.Instance; /// /// Creates a to receive notifications for creations, deletes, as well as all intermediary snapshots for updates. diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index 172aac4fbb..7abfd76deb 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Cosmos /// internal sealed class ConnectionPolicy { - private const int defaultRequestTimeout = 10; + private const int defaultRequestTimeout = 6; // defaultMediaRequestTimeout is based upon the blob client timeout and the retry policy. private const int defaultMediaRequestTimeout = 300; private const int defaultMaxConcurrentFanoutRequests = 32; diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index d4fe7dcb9b..d622e9ddcb 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -92,6 +92,9 @@ namespace Microsoft.Azure.Cosmos /// ]]> /// /// + /// + /// The returned not-initialized reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls + /// /// /// /// Performance Tips @@ -179,6 +182,9 @@ protected CosmosClient() /// ]]> /// /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// /// /// /// Performance Tips @@ -221,6 +227,9 @@ public CosmosClient( /// ]]> /// /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// /// /// /// Performance Tips @@ -274,7 +283,10 @@ public CosmosClient( /// /// Performance Tips /// Diagnose and troubleshoot issues - /// AzureKeyCredential enables changing/updating master-key/ResourceToken whle CosmosClient is still in use. + /// + /// AzureKeyCredential enables changing/updating master-key/ResourceToken whle CosmosClient is still in use. + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// public CosmosClient( string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, @@ -292,6 +304,9 @@ public CosmosClient( /// of the application which enables efficient connection management and performance. Please refer to the /// performance guide. /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// /// The cosmos service endpoint to use. /// The token to provide AAD token for authorization. /// (Optional) client options @@ -368,6 +383,9 @@ internal CosmosClient( /// ]]> /// /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because initialization doesn't make any network calls. + /// public static async Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList<(string databaseId, string containerId)> containers, diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index c826bb90d1..1fce195915 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -223,7 +223,7 @@ public int GatewayModeMaxConnectionLimit /// Gets the request timeout in seconds when connecting to the Azure Cosmos DB service. /// The number specifies the time to wait for response to come back from network peer. /// - /// Default value is 1 minute. + /// Default value is 6 seconds. /// public TimeSpan RequestTimeout { get; set; } diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 451166618d..068bb5b857 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -6644,6 +6644,11 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory } else { + Documents.Telemetry.DistributedTracingOptions distributedTracingOptions = new () + { + IsDistributedTracingEnabled = this.isDistributedTracingEnabled + }; + StoreClientFactory newClientFactory = new StoreClientFactory( this.ConnectionPolicy.ConnectionProtocol, (int)this.ConnectionPolicy.RequestTimeout.TotalSeconds, @@ -6667,7 +6672,7 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory addressResolver: this.AddressResolver, rntbdMaxConcurrentOpeningConnectionCount: this.rntbdMaxConcurrentOpeningConnectionCount, remoteCertificateValidationCallback: this.remoteCertificateValidationCallback, - isDistributedTracingEnabled: this.isDistributedTracingEnabled); + distributedTracingOptions: distributedTracingOptions); if (this.transportClientHandlerFactory != null) { diff --git a/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs b/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs index 47f84fd280..1a04800b50 100644 --- a/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs +++ b/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs @@ -4,11 +4,13 @@ namespace Microsoft.Azure.Cosmos { + using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; /// /// FeedRange that represents an exact Partition Key value. @@ -31,8 +33,13 @@ public FeedRangePartitionKey(PartitionKey partitionKey) return Task.FromResult( new List> { - Documents.Routing.Range.GetPointRange( - this.PartitionKey.InternalKey.GetEffectivePartitionKeyString(partitionKeyDefinition)) + Documents.Routing.PartitionKeyInternal.GetEffectivePartitionKeyRange( + partitionKeyDefinition, + new Documents.Routing.Range( + min: this.PartitionKey.InternalKey, + max: this.PartitionKey.InternalKey, + isMinInclusive: true, + isMaxInclusive: true)) }); } diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 692d5b498a..8b72bfffa4 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -167,9 +167,13 @@ public CosmosClientBuilder( /// /// A method to create the cosmos client + /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime + /// of the application which enables efficient connection management and performance. Please refer to the + /// performance guide. /// /// /// Setting this property after sending any request won't have any effect. + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. /// /// An instance of . public CosmosClient Build() @@ -191,6 +195,11 @@ public CosmosClient Build() /// /// A method to create the cosmos client and initialize the provided containers. + /// In addition to that it initializes the client with containers provided i.e The SDK warms up the caches and + /// connections before the first call to the service is made. Use this to obtain lower latency while startup of your application. + /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime + /// of the application which enables efficient connection management and performance. Please refer to the + /// performance guide. /// /// Containers to be initialized identified by it's database name and container name. /// (Optional) Cancellation Token @@ -214,9 +223,13 @@ public Task BuildAndInitializeAsync(IReadOnlyList<(string database /// /// A method to create the cosmos client + /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime + /// of the application which enables efficient connection management and performance. Please refer to the + /// performance guide. /// /// /// Setting this property after sending any request won't have any effect. + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. /// internal virtual CosmosClient Build(DocumentClient documentClient) { diff --git a/Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs new file mode 100644 index 0000000000..41a6db5168 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Fluent +{ + using System; + using System.Collections.ObjectModel; + + /// + /// Computed Properties fluent definition. + /// + /// +#if PREVIEW + public +#else + internal +#endif + class ComputedPropertiesDefinition + { + private readonly Collection computedProperties = new Collection(); + private readonly T parent; + private readonly Action> attachCallback; + + internal ComputedPropertiesDefinition( + T parent, + Action> attachCallback) + { + this.parent = parent; + this.attachCallback = attachCallback; + } + + /// + /// Adds a computed property to the current + /// + /// Name of the computed property + /// Query for the computed property values + /// An instance of the current + public ComputedPropertiesDefinition WithComputedProperty(string name, string query) + { + this.computedProperties.Add( + new ComputedProperty + { + Name = name, + Query = query + }); + + return this; + } + + /// + /// Applies the current definition to the parent. + /// + /// An instance of the parent. + public T Attach() + { + this.attachCallback(this.computedProperties); + return this.parent; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs index a1141fc3f0..1678688c41 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs @@ -4,6 +4,8 @@ namespace Microsoft.Azure.Cosmos.Fluent { using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; /// /// Azure Cosmos container fluent definition. @@ -18,6 +20,7 @@ public abstract class ContainerDefinition private IndexingPolicy indexingPolicy; private string timeToLivePropertyPath; private PartitionKeyDefinitionVersion? partitionKeyDefinitionVersion = null; + private Collection computedProperties; /// /// Creates an instance for unit-testing @@ -123,6 +126,28 @@ public IndexingPolicyDefinition WithIndexingPolicy() (indexingPolicy) => this.WithIndexingPolicy(indexingPolicy)); } + /// + /// definition for Azure Cosmos container. + /// + /// An instance of . +#if PREVIEW + public +#else + internal +#endif + ComputedPropertiesDefinition WithComputedProperties() + { + if (this.computedProperties != null) + { + // Overwrite + throw new NotSupportedException(); + } + + return new ComputedPropertiesDefinition( + (T)this, + (computedProperties) => this.WithComputedProperties(computedProperties)); + } + /// /// Applies the current Fluent definition and creates a container configuration. /// @@ -152,6 +177,11 @@ public ContainerProperties Build() containerProperties.PartitionKeyDefinitionVersion = this.partitionKeyDefinitionVersion.Value; } + if (this.computedProperties != null) + { + containerProperties.ComputedProperties = this.computedProperties; + } + containerProperties.ValidateRequiredProperties(); return containerProperties; @@ -161,5 +191,10 @@ private void WithIndexingPolicy(IndexingPolicy indexingPolicy) { this.indexingPolicy = indexingPolicy; } + + private void WithComputedProperties(Collection computedProperties) + { + this.computedProperties = computedProperties; + } } } diff --git a/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs b/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs index 2754dfaa40..5413103fee 100644 --- a/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs +++ b/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs @@ -49,7 +49,7 @@ await this.cosmosAuthorization.AddAuthorizationHeaderAsync( using (ITrace trace = Trace.GetRootTrace("Account Read", TraceComponent.Transport, TraceLevel.Info)) { - IClientSideRequestStatistics stats = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace.Summary); + IClientSideRequestStatistics stats = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); try { diff --git a/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs index e524214976..7baf8a7254 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs @@ -93,7 +93,7 @@ internal async Task ProcessMessageAsync( DocumentServiceRequest serviceRequest = request.ToDocumentServiceRequest(); - ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, request.Trace.Summary); + ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, request.Trace); serviceRequest.RequestContext.ClientRequestStatistics = clientSideRequestStatisticsTraceDatum; //TODO: extrace auth into a separate handler diff --git a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs index e8c584d782..f12595d832 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs @@ -177,6 +177,18 @@ public virtual string EndEpk set => this.SetProperty(HttpConstants.HttpHeaders.EndEpk, value); } + public virtual string OptimisticDirectExecute + { + get => this.GetValueOrDefault(HttpConstants.HttpHeaders.OptimisticDirectExecute); + set => this.SetProperty(HttpConstants.HttpHeaders.OptimisticDirectExecute, value); + } + + public virtual string RequiresDistribution + { + get => this.GetValueOrDefault(HttpConstants.HttpHeaders.RequiresDistribution); + set => this.SetProperty(HttpConstants.HttpHeaders.RequiresDistribution, value); + } + public abstract INameValueCollection INameValueCollection { get; } public virtual string this[string headerName] diff --git a/Microsoft.Azure.Cosmos/src/Headers/Headers.cs b/Microsoft.Azure.Cosmos/src/Headers/Headers.cs index 611de5f147..40f90c423a 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/Headers.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/Headers.cs @@ -171,6 +171,18 @@ internal virtual string PartitionKey set => this.CosmosMessageHeaders.PartitionKey = value; } + internal virtual string OptimisticDirectExecute + { + get => this.CosmosMessageHeaders.OptimisticDirectExecute; + set => this.CosmosMessageHeaders.OptimisticDirectExecute = value; + } + + internal virtual string RequiresDistribution + { + get => this.CosmosMessageHeaders.RequiresDistribution; + set => this.CosmosMessageHeaders.RequiresDistribution = value; + } + internal virtual string PartitionKeyRangeId { get => this.CosmosMessageHeaders.PartitionKeyRangeId; diff --git a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs index 9147c31026..68086095f7 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs @@ -46,6 +46,12 @@ public override string XDate set => this.requestNameValueCollection.XDate = value; } + public override string OptimisticDirectExecute + { + get => this.requestNameValueCollection.OptimisticDirectExecute; + set => this.requestNameValueCollection.OptimisticDirectExecute = value; + } + public override string ConsistencyLevel { get => this.requestNameValueCollection.ConsistencyLevel; diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index 0fde01afb5..c29c3a5b94 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Cosmos using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; + using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Collections; @@ -361,9 +362,11 @@ private async Task SendHttpHelperAsync( } catch (Exception e) { + ITrace trace = NoOpTrace.Singleton; if (clientSideRequestStatistics is ClientSideRequestStatisticsTraceDatum datum) { datum.RecordHttpException(requestMessage, e, resourceType, requestStartTime); + trace = datum.Trace; } bool isOutOfRetries = CosmosHttpClientCore.IsOutOfRetries(timeoutPolicy, startDateTimeUtc, timeoutEnumerator); @@ -394,6 +397,7 @@ private async Task SendHttpHelperAsync( ActivityId = System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(), SubStatusCode = SubStatusCodes.TransportGenerated503 }, + trace: trace, innerException: e); } diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs index b9d6d2047a..0df6582cf6 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs @@ -33,7 +33,7 @@ abstract partial class JsonWriter : IJsonWriter /// Blitted bytes. public static PreblittedBinaryJsonScope CapturePreblittedBinaryJsonScope(Action scopeWriter) { - JsonBinaryWriter jsonBinaryWriter = new JsonBinaryWriter(initialCapacity: 256, serializeCount: false, enableEncodedStrings: false); + JsonBinaryWriter jsonBinaryWriter = new JsonBinaryWriter(initialCapacity: 256, enableEncodedStrings: false); Contract.Requires(!jsonBinaryWriter.JsonObjectState.InArrayContext); Contract.Requires(!jsonBinaryWriter.JsonObjectState.InObjectContext); Contract.Requires(!jsonBinaryWriter.JsonObjectState.IsPropertyExpected); @@ -243,13 +243,6 @@ private enum RawValueType : byte /// private readonly Stack bufferedContexts; - /// - /// With binary encoding json elements like arrays and object are prefixed with a length in bytes and optionally a count. - /// This flag just determines whether you want to serialize the count, since it's optional and up to the user to make the - /// tradeoff between O(1) .Count() operation as the cost of additional storage. - /// - private readonly bool serializeCount; - /// /// When a user writes an open array or object we reserve this much space for the type marker + length + count /// And correct it later when they write a close array or object. @@ -269,18 +262,15 @@ private enum RawValueType : byte /// Initializes a new instance of the JsonBinaryWriter class. /// /// The initial capacity to avoid intermediary allocations. - /// Whether to serialize the count for object and array typemarkers. /// enable reference string encoding public JsonBinaryWriter( int initialCapacity, - bool serializeCount, bool enableEncodedStrings) { this.EnableEncodedStrings = enableEncodedStrings; this.binaryWriter = new JsonBinaryMemoryWriter(initialCapacity); this.bufferedContexts = new Stack(); - this.serializeCount = serializeCount; - this.reservationSize = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.OneByteLength + (this.serializeCount ? JsonBinaryEncoding.OneByteCount : 0); + this.reservationSize = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.OneByteLength; this.sharedStrings = new List(); this.sharedStringIndexes = new ReferenceStringDictionary(); this.stringReferenceOffsets = new List(); @@ -300,13 +290,13 @@ public JsonBinaryWriter( public override long CurrentLength => this.binaryWriter.Position; /// - public override void WriteObjectStart() => this.WriterArrayOrObjectStart(isArray: false); + public override void WriteObjectStart() => this.WriteArrayOrObjectStart(isArray: false); /// public override void WriteObjectEnd() => this.WriteArrayOrObjectEnd(isArray: false); /// - public override void WriteArrayStart() => this.WriterArrayOrObjectStart(isArray: true); + public override void WriteArrayStart() => this.WriteArrayOrObjectStart(isArray: true); /// public override void WriteArrayEnd() => this.WriteArrayOrObjectEnd(isArray: true); @@ -536,7 +526,7 @@ internal PreblittedBinaryJsonScope CapturePreblittedBinaryJsonScope(int startPos this.binaryWriter.BufferAsSpan.Slice(startPosition, this.binaryWriter.Position - startPosition).ToArray()); } - private void WriterArrayOrObjectStart(bool isArray) + private void WriteArrayOrObjectStart(bool isArray) { this.RegisterArrayOrObjectStart(isArray, this.binaryWriter.Position, valueCount: 0); @@ -544,10 +534,6 @@ private void WriterArrayOrObjectStart(bool isArray) // We'll adjust this as needed when writing the end of the array/object. this.binaryWriter.Write((byte)0); this.binaryWriter.Write((byte)0); - if (this.serializeCount) - { - this.binaryWriter.Write((byte)0); - } } private void RegisterArrayOrObjectStart(bool isArray, long offset, int valueCount) @@ -611,16 +597,20 @@ private void WriteArrayOrObjectEnd(bool isArray) // Need to figure out how many bytes to encode the length and the count if (payloadLength <= byte.MaxValue) { - // 1 byte length - don't need to move the buffer + bool serializeCount = isArray && (count > 16); + + // 1 byte length - move the buffer forward + Span buffer = this.binaryWriter.BufferAsSpan; int bytesToWrite = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.OneByteLength - + (this.serializeCount ? JsonBinaryEncoding.OneByteCount : 0); + + (serializeCount ? JsonBinaryEncoding.OneByteCount : 0); + this.MoveBuffer(buffer, payloadIndex, payloadLength, typeMarkerIndex, bytesToWrite, stringStartIndex, stringReferenceStartIndex); // Move the cursor back this.binaryWriter.Position = typeMarkerIndex; // Write the type marker - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write(isArray ? JsonBinaryEncoding.TypeMarker.Array1ByteLengthAndCount : JsonBinaryEncoding.TypeMarker.Object1ByteLengthAndCount); this.binaryWriter.Write((byte)payloadLength); @@ -637,9 +627,11 @@ private void WriteArrayOrObjectEnd(bool isArray) } else if (payloadLength <= ushort.MaxValue) { + bool serializeCount = isArray && ((count > 16) || (payloadLength > 0x1000)); + // 2 byte length - make space for the extra byte length (and extra byte count) this.binaryWriter.Write((byte)0); - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write((byte)0); } @@ -648,14 +640,14 @@ private void WriteArrayOrObjectEnd(bool isArray) Span buffer = this.binaryWriter.BufferAsSpan; int bytesToWrite = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.TwoByteLength - + (this.serializeCount ? JsonBinaryEncoding.TwoByteCount : 0); + + (serializeCount ? JsonBinaryEncoding.TwoByteCount : 0); this.MoveBuffer(buffer, payloadIndex, payloadLength, typeMarkerIndex, bytesToWrite, stringStartIndex, stringReferenceStartIndex); // Move the cursor back this.binaryWriter.Position = typeMarkerIndex; // Write the type marker - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write(isArray ? JsonBinaryEncoding.TypeMarker.Array2ByteLengthAndCount : JsonBinaryEncoding.TypeMarker.Object2ByteLengthAndCount); this.binaryWriter.Write((ushort)payloadLength); @@ -673,11 +665,12 @@ private void WriteArrayOrObjectEnd(bool isArray) else { // (payloadLength <= uint.MaxValue) + bool serializeCount = isArray; // 4 byte length - make space for an extra 3 byte length (and 3 byte count) this.binaryWriter.Write((byte)0); this.binaryWriter.Write((ushort)0); - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write((byte)0); this.binaryWriter.Write((ushort)0); @@ -687,14 +680,14 @@ private void WriteArrayOrObjectEnd(bool isArray) Span buffer = this.binaryWriter.BufferAsSpan; int bytesToWrite = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.FourByteLength - + (this.serializeCount ? JsonBinaryEncoding.FourByteCount : 0); + + (serializeCount ? JsonBinaryEncoding.FourByteCount : 0); this.MoveBuffer(buffer, payloadIndex, payloadLength, typeMarkerIndex, bytesToWrite, stringStartIndex, stringReferenceStartIndex); // Move the cursor back this.binaryWriter.Position = typeMarkerIndex; // Write the type marker - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write(isArray ? JsonBinaryEncoding.TypeMarker.Array4ByteLengthAndCount : JsonBinaryEncoding.TypeMarker.Object4ByteLengthAndCount); this.binaryWriter.Write((uint)payloadLength); @@ -915,7 +908,7 @@ private bool TryRegisterStringValue(Utf8Span utf8Span) // In order to avoid having to change the typer marker later on, we need to account for the case // where the buffer might shift as a result of adjusting array/object length. - int maxOffset = (this.JsonObjectState.CurrentDepth * 3) + (int)this.CurrentLength; + int maxOffset = (this.JsonObjectState.CurrentDepth * 7) + (int)this.CurrentLength; bool shouldAddValue = (utf8Span.Length >= 5) || ((maxOffset <= byte.MaxValue) && (utf8Span.Length >= 2)) || diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs index 8e75c0c116..9ea7b42325 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs @@ -58,7 +58,6 @@ public static IJsonWriter Create( JsonSerializationFormat.Text => new JsonTextWriter(initalCapacity), JsonSerializationFormat.Binary => new JsonBinaryWriter( initialCapacity: initalCapacity, - serializeCount: false, enableEncodedStrings: enableEncodedStrings), _ => throw new ArgumentException( string.Format( diff --git a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs index 93c09d65ab..db875f3ae0 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs @@ -18,33 +18,62 @@ static TypeCheckFunctions() { TypeCheckFunctionsDefinitions = new Dictionary { - { - "IsDefined", - new SqlBuiltinFunctionVisitor("IS_DEFINED", + [nameof(CosmosLinqExtensions.IsArray)] = new SqlBuiltinFunctionVisitor( + "IS_ARRAY", true, new List() { new Type[]{typeof(object)}, - }) - }, - { - "IsNull", - new SqlBuiltinFunctionVisitor("IS_NULL", + }), + [nameof(CosmosLinqExtensions.IsBool)] = new SqlBuiltinFunctionVisitor( + "IS_BOOL", true, new List() { new Type[]{typeof(object)}, - }) - }, - { - "IsPrimitive", - new SqlBuiltinFunctionVisitor("IS_PRIMITIVE", + }), + [nameof(CosmosLinqExtensions.IsDefined)] = new SqlBuiltinFunctionVisitor( + "IS_DEFINED", true, new List() { new Type[]{typeof(object)}, - }) - } + }), + [nameof(CosmosLinqExtensions.IsNull)] = new SqlBuiltinFunctionVisitor( + "IS_NULL", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsNumber)] = new SqlBuiltinFunctionVisitor( + "IS_NUMBER", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsObject)] = new SqlBuiltinFunctionVisitor( + "IS_OBJECT", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsPrimitive)] = new SqlBuiltinFunctionVisitor( + "IS_PRIMITIVE", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsString)] = new SqlBuiltinFunctionVisitor( + "IS_STRING", + true, + new List() + { + new Type[]{typeof(object)}, + }), }; } diff --git a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs index dc86de0cb6..6663f52673 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs @@ -20,6 +20,44 @@ namespace Microsoft.Azure.Cosmos.Linq /// public static class CosmosLinqExtensions { + /// + /// Returns a Boolean value indicating if the type of the specified expression is an array. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is an array; otherwise, false. + /// + /// + /// document.Names.IsArray()); + /// ]]> + /// + /// + public static bool IsArray(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + + /// + /// Returns a Boolean value indicating if the type of the specified expression is a boolean. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is a boolean; otherwise, false. + /// + /// + /// document.IsRegistered.IsBool()); + /// ]]> + /// + /// + public static bool IsBool(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// Determines if a certain property is defined or not. /// This method is to be used in LINQ expressions only and will be evaluated on server. @@ -52,12 +90,50 @@ public static bool IsDefined(this object obj) /// var isNullQuery = documents.Where(document => document.Name.IsNull()); /// ]]> /// - /// s> + /// public static bool IsNull(this object obj) { throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); } + /// + /// Returns a Boolean value indicating if the type of the specified expression is a number. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is a number; otherwise, false. + /// + /// + /// document.Age.IsNumber()); + /// ]]> + /// + /// + public static bool IsNumber(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + + /// + /// Returns a Boolean value indicating if the type of the specified expression is an object. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is an object; otherwise, false. + /// + /// + /// document.Address.IsObject()); + /// ]]> + /// + /// + public static bool IsObject(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// Determines if a certain property is of primitive JSON type. /// This method is to be used in LINQ expressions only and will be evaluated on server. @@ -74,12 +150,31 @@ public static bool IsNull(this object obj) /// var isPrimitiveQuery = documents.Where(document => document.Name.IsPrimitive()); /// ]]> /// - /// s> + /// public static bool IsPrimitive(this object obj) { throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); } + /// + /// Returns a Boolean value indicating if the type of the specified expression is a string. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is a string; otherwise, false. + /// + /// + /// document.Name.IsString()); + /// ]]> + /// + /// + public static bool IsString(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// This method generate query definition from LINQ query. /// diff --git a/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs b/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs index 9205052604..8fc95d8701 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs @@ -119,6 +119,7 @@ public void PopParameter() { ParameterExpression last = this.lambdaParametersStack[this.lambdaParametersStack.Count - 1]; this.lambdaParametersStack.RemoveAt(this.lambdaParametersStack.Count - 1); + this.substitutions.Remove(last); } /// @@ -337,6 +338,11 @@ public Expression Lookup(ParameterExpression parameter) return null; } + internal void Remove(ParameterExpression parameter) + { + this.substitutionTable.Remove(parameter); + } + public const string InputParameterName = "root"; } diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index 6a5be8ccbb..f8afb4af6c 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -24,7 +24,6 @@ Microsoft.Azure.Cosmos microsoft;azure;cosmos;cosmosdb;documentdb;docdb;nosql;azureofficial;dotnetcore;netcore;netstandard The change log for this SDK is made available at https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md at the time of release. - https://aka.ms/netcoregaeula https://github.com/Azure/azure-cosmos-dotnet-v3 true http://go.microsoft.com/fwlink/?LinkID=288890 @@ -43,8 +42,13 @@ NU5125 true $(LangVersion) + LICENSE + + + + @@ -55,7 +59,7 @@ - + diff --git a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs index 1132a40a35..7d8683c3fe 100644 --- a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs +++ b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs @@ -258,16 +258,17 @@ public async Task> MonadicQueryAsync( } QueryRequestOptions queryRequestOptions = this.queryRequestOptions == null ? new QueryRequestOptions() : this.queryRequestOptions; + AdditionalRequestHeaders additionalRequestHeaders = new AdditionalRequestHeaders(this.correlatedActivityId, isContinuationExpected: false, optimisticDirectExecute: queryPaginationOptions.OptimisticDirectExecute); + TryCatch monadicQueryPage = await this.cosmosQueryClient.ExecuteItemQueryAsync( this.resourceLink, this.resourceType, Documents.OperationType.Query, - this.correlatedActivityId, feedRangeState.FeedRange, queryRequestOptions, + additionalRequestHeaders, sqlQuerySpec, feedRangeState.State == null ? null : ((CosmosString)feedRangeState.State.Value).Value, - isContinuationExpected: false, queryPaginationOptions.PageSizeLimit ?? int.MaxValue, trace, cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs b/Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs new file mode 100644 index 0000000000..add4e15c99 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core +{ + using System; + + /// + /// Captures additional headers to be sent in the web request. + /// + internal sealed class AdditionalRequestHeaders + { + /// + /// Enable backend to link multiple activityIds that belong to the same operation. + /// + public Guid CorrelatedActivityId { get; } + + /// + /// Let the backend know if continuations are expected for a certain query. + /// + public bool IsContinuationExpected { get; } + + /// + /// Let the backend know if a query is utilizing the OptimisticDirectExecute pipeline. + /// + public bool OptimisticDirectExecute { get; } + + public AdditionalRequestHeaders(Guid correlatedActivityId, bool isContinuationExpected, bool optimisticDirectExecute) + { + this.CorrelatedActivityId = correlatedActivityId; + this.IsContinuationExpected = isContinuationExpected; + this.OptimisticDirectExecute = optimisticDirectExecute; + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index e276466f9d..47aa1c4490 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -188,7 +188,7 @@ private static async Task> TryCreateCoreContextAsy // If the query would go to gateway, but we have a partition key, // then try seeing if we can execute as a passthrough using client side only logic. // This is to short circuit the need to go to the gateway to get the query plan. - if (cosmosQueryContext.QueryClient.ByPassQueryParsing() + if (cosmosQueryContext.QueryClient.BypassQueryParsing() && inputParameters.PartitionKey.HasValue) { bool parsed; @@ -477,7 +477,6 @@ private static TryCatch TryCreateOptimisticDirectExecutionC documentContainer: documentContainer, inputParameters: inputParameters, targetRange: new FeedRangeEpk(targetRange.ToRange()), - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: inputParameters.MaxItemCount), fallbackQueryPipelineStageFactory: (continuationToken) => { // In fallback scenario, the Specialized pipeline is always invoked @@ -587,7 +586,7 @@ private static async Task GetPartitionedQueryExec CancellationToken cancellationToken) { PartitionedQueryExecutionInfo partitionedQueryExecutionInfo; - if (cosmosQueryContext.QueryClient.ByPassQueryParsing()) + if (cosmosQueryContext.QueryClient.BypassQueryParsing()) { // For non-Windows platforms(like Linux and OSX) in .NET Core SDK, we cannot use ServiceInterop, so need to bypass in that case. // We are also now bypassing this for 32 bit host process running even on Windows as there are many 32 bit apps that will not work without this diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs index 0664603024..e62ecf41f0 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs @@ -19,6 +19,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQu using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.Parallel; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; internal sealed class OptimisticDirectExecutionQueryPipelineStage : IQueryPipelineStage { @@ -28,11 +29,12 @@ private enum ExecutionState SpecializedDocumentQueryExecution, } - private const string optimisticDirectExecutionToken = "OptimisticDirectExecutionToken"; + private const string OptimisticDirectExecutionToken = "OptimisticDirectExecutionToken"; private readonly FallbackQueryPipelineStageFactory queryPipelineStageFactory; private TryCatch inner; private CosmosElement continuationToken; private ExecutionState executionState; + private bool? previousRequiresDistribution; private OptimisticDirectExecutionQueryPipelineStage(TryCatch inner, FallbackQueryPipelineStageFactory queryPipelineStageFactory, CosmosElement continuationToken) { @@ -40,6 +42,12 @@ private OptimisticDirectExecutionQueryPipelineStage(TryCatch> FallbackQueryPipelineStageFactory(CosmosElement continuationToken); @@ -55,22 +63,43 @@ public async ValueTask MoveNextAsync(ITrace trace) { TryCatch hasNext = await this.inner.TryAsync(pipelineStage => pipelineStage.MoveNextAsync(trace)); bool success = hasNext.Succeeded && hasNext.Result; - bool isPartitionSplitException = hasNext.Succeeded && this.Current.Failed && this.Current.InnerMostException.IsPartitionSplitException(); - - if (success && !isPartitionSplitException) - { - this.continuationToken = this.Current.Succeeded ? this.Current.Result.State?.Value : null; - } - else if (isPartitionSplitException && this.executionState == ExecutionState.OptimisticDirectExecution) + if (this.executionState == ExecutionState.OptimisticDirectExecution) { - this.inner = await this.queryPipelineStageFactory(this.TryUnwrapContinuationToken()); - this.executionState = ExecutionState.SpecializedDocumentQueryExecution; - if (this.inner.Failed) + bool isPartitionSplitException = hasNext.Succeeded && this.Current.Failed && this.Current.InnerMostException.IsPartitionSplitException(); + if (success && !isPartitionSplitException) { - return false; + this.continuationToken = this.Current.Succeeded ? this.Current.Result.State?.Value : null; + if (this.continuationToken != null) + { + bool requiresDistribution; + if (this.Current.Result.AdditionalHeaders.TryGetValue(HttpConstants.HttpHeaders.RequiresDistribution, out string requiresDistributionHeaderValue)) + { + requiresDistribution = bool.Parse(requiresDistributionHeaderValue); + } + else + { + requiresDistribution = true; + } + + if (this.previousRequiresDistribution.HasValue && this.previousRequiresDistribution != requiresDistribution) + { + // We should never enter this if statement as requiresDistribution flag can never switch mid execution. + // Hence, this exception should never be thrown. + throw new InvalidOperationException($"Unexpected switch in {HttpConstants.HttpHeaders.RequiresDistribution} value. Previous value : {this.previousRequiresDistribution} Current value : {requiresDistribution}."); + } + + if (requiresDistribution) + { + success = await this.SwitchToFallbackPipelineAsync(continuationToken: null, trace); + } + + this.previousRequiresDistribution = requiresDistribution; + } + } + else if (isPartitionSplitException) + { + success = await this.SwitchToFallbackPipelineAsync(continuationToken: UnwrapContinuationToken(this.continuationToken), trace); } - - success = await this.inner.Result.MoveNextAsync(trace); } return success; @@ -81,32 +110,46 @@ public void SetCancellationToken(CancellationToken cancellationToken) this.inner.Try(pipelineStage => pipelineStage.SetCancellationToken(cancellationToken)); } - private CosmosElement TryUnwrapContinuationToken() + private static CosmosElement UnwrapContinuationToken(CosmosElement continuationToken) { - if (this.continuationToken != null) + if (continuationToken == null) return null; + + CosmosObject cosmosObject = continuationToken as CosmosObject; + CosmosElement backendContinuationToken = cosmosObject[OptimisticDirectExecutionToken]; + Debug.Assert(backendContinuationToken != null); + + return CosmosArray.Create(backendContinuationToken); + } + + private async Task SwitchToFallbackPipelineAsync(CosmosElement continuationToken, ITrace trace) + { + Debug.Assert(this.executionState == ExecutionState.OptimisticDirectExecution, "OptimisticDirectExecuteQueryPipelineStage Assert!", "Only OptimisticDirectExecute pipeline can create this fallback pipeline"); + this.executionState = ExecutionState.SpecializedDocumentQueryExecution; + this.inner = continuationToken != null + ? await this.queryPipelineStageFactory(continuationToken) + : await this.queryPipelineStageFactory(null); + + if (this.inner.Failed) { - CosmosObject cosmosObject = this.continuationToken as CosmosObject; - CosmosElement backendContinuationToken = cosmosObject[optimisticDirectExecutionToken]; - Debug.Assert(backendContinuationToken != null); - return CosmosArray.Create(backendContinuationToken); + return false; } - return null; + return await this.inner.Result.MoveNextAsync(trace); } public static TryCatch MonadicCreate( DocumentContainer documentContainer, CosmosQueryExecutionContextFactory.InputParameters inputParameters, FeedRangeEpk targetRange, - QueryPaginationOptions queryPaginationOptions, FallbackQueryPipelineStageFactory fallbackQueryPipelineStageFactory, CancellationToken cancellationToken) { + QueryPaginationOptions paginationOptions = new QueryPaginationOptions(pageSizeHint: inputParameters.MaxItemCount, optimisticDirectExecute: true); TryCatch pipelineStage = OptimisticDirectExecutionQueryPipelineImpl.MonadicCreate( documentContainer: documentContainer, sqlQuerySpec: inputParameters.SqlQuerySpec, targetRange: targetRange, - queryPaginationOptions: queryPaginationOptions, + queryPaginationOptions: paginationOptions, partitionKey: inputParameters.PartitionKey, continuationToken: inputParameters.InitialUserContinuationToken, cancellationToken: cancellationToken); @@ -120,7 +163,7 @@ public static TryCatch MonadicCreate( return TryCatch.FromResult(odePipelineStageMonadicCreate); } - private class OptimisticDirectExecutionQueryPipelineImpl : IQueryPipelineStage + private sealed class OptimisticDirectExecutionQueryPipelineImpl : IQueryPipelineStage { private readonly QueryPartitionRangePageAsyncEnumerator queryPartitionRangePageAsyncEnumerator; @@ -226,7 +269,6 @@ public static TryCatch MonadicCreate( } FeedRangeState feedRangeState = monadicExtractState.Result; - QueryPartitionRangePageAsyncEnumerator partitionPageEnumerator = new QueryPartitionRangePageAsyncEnumerator( documentContainer, sqlQuerySpec, diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs index 0b692160be..c285135feb 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs @@ -15,6 +15,8 @@ internal sealed class QueryPaginationOptions : PaginationOptions { public static readonly QueryPaginationOptions Default = new QueryPaginationOptions(); + public bool OptimisticDirectExecute { get; } + public static readonly ImmutableHashSet BannedHeaders = new HashSet() { HttpConstants.HttpHeaders.Continuation, @@ -29,10 +31,12 @@ internal sealed class QueryPaginationOptions : PaginationOptions public QueryPaginationOptions( int? pageSizeHint = null, + bool optimisticDirectExecute = false, JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) { + this.OptimisticDirectExecute = optimisticDirectExecute; } protected override ImmutableHashSet BannedAdditionalHeaders => BannedHeaders; diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs index c2bcf91619..3fa4cb90e7 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs @@ -54,12 +54,11 @@ public abstract Task> ExecuteItemQueryAsync( string resourceUri, Documents.ResourceType resourceType, Documents.OperationType operationType, - Guid clientQueryCorrelationId, FeedRange feedRange, QueryRequestOptions requestOptions, + AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, - bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken); @@ -99,7 +98,7 @@ public abstract Task ExecuteQueryPlanRequestAsync bool forceRefresh, ITrace trace); - public abstract bool ByPassQueryParsing(); + public abstract bool BypassQueryParsing(); public abstract Task ForceRefreshCollectionCacheAsync( string collectionLink, diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs index 6e7b0b4a8f..c62a65b27a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs @@ -147,11 +147,7 @@ internal PartitionedQueryExecutionInfo ConvertPartitionedQueryExecutionInfo( List> effectiveRanges = new List>(queryInfoInternal.QueryRanges.Count); foreach (Documents.Routing.Range internalRange in queryInfoInternal.QueryRanges) { - effectiveRanges.Add(new Documents.Routing.Range( - internalRange.Min.GetEffectivePartitionKeyString(partitionKeyDefinition, false), - internalRange.Max.GetEffectivePartitionKeyString(partitionKeyDefinition, false), - internalRange.IsMinInclusive, - internalRange.IsMaxInclusive)); + effectiveRanges.Add(PartitionKeyInternal.GetEffectivePartitionKeyRange(partitionKeyDefinition, internalRange)); } effectiveRanges.Sort(Documents.Routing.Range.MinComparer.Instance); diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index 138f32c593..1c5a9ef21f 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -119,12 +119,11 @@ public override async Task> ExecuteItemQueryAsync( string resourceUri, ResourceType resourceType, OperationType operationType, - Guid clientQueryCorrelationId, FeedRange feedRange, QueryRequestOptions requestOptions, + AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, - bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken) @@ -143,13 +142,14 @@ public override async Task> ExecuteItemQueryAsync( { cosmosRequestMessage.Headers.Add( HttpConstants.HttpHeaders.IsContinuationExpected, - isContinuationExpected.ToString()); + additionalRequestHeaders.IsContinuationExpected.ToString()); QueryRequestOptions.FillContinuationToken( cosmosRequestMessage, continuationToken); cosmosRequestMessage.Headers.Add(HttpConstants.HttpHeaders.ContentType, MediaTypes.QueryJson); cosmosRequestMessage.Headers.Add(HttpConstants.HttpHeaders.IsQuery, bool.TrueString); - cosmosRequestMessage.Headers.Add(WFConstants.BackendHeaders.CorrelatedActivityId, clientQueryCorrelationId.ToString()); + cosmosRequestMessage.Headers.Add(WFConstants.BackendHeaders.CorrelatedActivityId, additionalRequestHeaders.CorrelatedActivityId.ToString()); + cosmosRequestMessage.Headers.Add(HttpConstants.HttpHeaders.OptimisticDirectExecute, additionalRequestHeaders.OptimisticDirectExecute.ToString()); }, trace: trace, cancellationToken: cancellationToken); @@ -285,7 +285,7 @@ public override async Task> GetTargetPartitionKeyRangesA } } - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return CustomTypeExtensions.ByPassQueryParsing(); } diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs index b1325f2652..215ca22b2c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs @@ -51,16 +51,17 @@ internal override Task> ExecuteQueryAsync( ITrace trace, CancellationToken cancellationToken) { + AdditionalRequestHeaders additionalRequestHeaders = new AdditionalRequestHeaders(this.CorrelatedActivityId, isContinuationExpected, optimisticDirectExecute: false); + return this.QueryClient.ExecuteItemQueryAsync( resourceUri: this.ResourceLink, resourceType: this.ResourceTypeEnum, operationType: this.OperationTypeEnum, - clientQueryCorrelationId: this.CorrelatedActivityId, requestOptions: queryRequestOptions, + additionalRequestHeaders: additionalRequestHeaders, sqlQuerySpec: querySpecForInit, continuationToken: continuationToken, feedRange: feedRange, - isContinuationExpected: isContinuationExpected, pageSize: pageSize, trace: trace, cancellationToken: cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index 853bc48267..33c258aaf7 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -349,5 +349,20 @@ public static class Regions /// Name of the Azure Poland Central region in the Azure Cosmos DB service. /// public const string PolandCentral = "Poland Central"; + + /// + /// Name of the Azure Malaysia South region in the Azure Cosmos DB service. + /// + public const string MalaysiaSouth = "Malaysia South"; + + /// + /// Name of the Azure Italy North region in the Azure Cosmos DB service. + /// + public const string ItalyNorth = "Italy North"; + + /// + /// Name of the Azure Israel Central region in the Azure Cosmos DB service. + /// + public const string IsraelCentral = "Israel Central"; } } diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs index 59b5b245f7..d807f42f57 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs @@ -151,6 +151,7 @@ internal override void PopulateRequestOptions(RequestMessage request) } DedicatedGatewayRequestOptions.PopulateMaxIntegratedCacheStalenessOption(this.DedicatedGatewayRequestOptions, request); + DedicatedGatewayRequestOptions.PopulateBypassIntegratedCacheOption(this.DedicatedGatewayRequestOptions, request); RequestOptions.SetSessionToken(request, this.SessionToken); base.PopulateRequestOptions(request); diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 8711836191..60cea5b48c 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -44,12 +44,20 @@ public class QueryRequestOptions : RequestOptions public bool? EnableLowPrecisionOrderBy { get; set; } /// - /// Gets or sets the option for customers to opt in for direct (optimistic) execution of the query.. + /// Gets or sets the option for customers to opt in for direct (optimistic) execution of the query. /// /// /// Direct (optimistic) execution offers improved performance for several kinds of queries such as a single partition streaming query. /// - internal bool EnableOptimisticDirectExecution { get; set; } +#if PREVIEW + public +#else + internal +#endif + bool EnableOptimisticDirectExecution { get; set; } +#if PREVIEW + = true; +#endif /// /// Gets or sets the maximum number of items that can be buffered client side during @@ -264,6 +272,7 @@ internal override void PopulateRequestOptions(RequestMessage request) } DedicatedGatewayRequestOptions.PopulateMaxIntegratedCacheStalenessOption(this.DedicatedGatewayRequestOptions, request); + DedicatedGatewayRequestOptions.PopulateBypassIntegratedCacheOption(this.DedicatedGatewayRequestOptions, request); request.Headers.Add(HttpConstants.HttpHeaders.PopulateQueryMetrics, bool.TrueString); diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index d16d1c8bcc..42e128ac2e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -497,6 +497,7 @@ private async Task RunWithDiagnosticsHelperAsync( databaseName: databaseName, operationType: operationType, requestOptions: requestOptions, + trace: trace, clientContext: this.isDisposed ? null : this)) using (new ActivityScope(Guid.NewGuid())) { diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs index 1defe1f3cc..2978d741bf 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs @@ -751,6 +751,7 @@ public abstract Task> ReadManyItemsAsync( /// ]]> /// /// + /// Supported partial document update modes public abstract Task> PatchItemAsync( string id, PartitionKey partitionKey, @@ -783,6 +784,7 @@ public abstract Task> PatchItemAsync( /// /// /// + /// Supported partial document update modes public abstract Task PatchItemStreamAsync( string id, PartitionKey partitionKey, @@ -1342,6 +1344,9 @@ public abstract ChangeFeedEstimator GetChangeFeedEstimator( /// /// The partition key for all items in the batch. /// A new instance of . + /// + /// Limits on TransactionalBatch requests + /// public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); /// diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs new file mode 100644 index 0000000000..9eaf5f806b --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + /// + /// Represents a computed property definition in a Cosmos DB collection. + /// +#if PREVIEW + public +#else + internal +#endif + sealed class ComputedProperty + { + /// + /// Gets or sets the name of the computed property. + /// + /// + /// The name of the computed property. + /// + /// + /// Name of the computed property should be chosen such that it does not collide with any existing or future document properties. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the query for the computed property. + /// + /// + /// The query used to evaluate the value for the computed property. + /// + /// + /// For example: + /// SELECT VALUE LOWER(c.firstName) FROM c + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// This contains additional values for scenarios where the SDK is not aware of new fields. + /// This ensures that if resource is read and updated none of the fields will be lost in the process. + /// + [JsonExtensionData] + internal IDictionary AdditionalProperties { get; private set; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index 94cb93cff5..534f4f033d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -78,6 +78,9 @@ public class ContainerProperties [JsonProperty(PropertyName = "clientEncryptionPolicy", NullValueHandling = NullValueHandling.Ignore)] private ClientEncryptionPolicy clientEncryptionPolicyInternal; + [JsonProperty(PropertyName = "computedProperties", NullValueHandling = NullValueHandling.Ignore)] + private Collection computedProperties; + /// /// This contains additional values for scenarios where the SDK is not aware of new fields. /// This ensures that if resource is read and updated none of the fields will be lost in the process. @@ -286,6 +289,48 @@ public IndexingPolicy IndexingPolicy } } + /// + /// Gets or sets the collection containing objects in the container. + /// + /// + /// The collection containing objects associated with the container. + /// + + /// + /// Gets or sets the collection containing objects in the container. + /// + /// + /// The collection containing objects associated with the container. + /// + [JsonIgnore] +#if PREVIEW + public +#else + internal +#endif + Collection ComputedProperties + { + get + { + if (this.computedProperties == null) + { + this.computedProperties = new Collection(); + } + + return this.computedProperties; + } + + set + { + if (value == null) + { + throw new ArgumentException($"{nameof(value)}"); + } + + this.computedProperties = value; + } + } + /// /// Gets the associated with the container from the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs index e3b7dccf3f..9ca854388c 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs @@ -23,6 +23,40 @@ public class DedicatedGatewayRequestOptions /// public TimeSpan? MaxIntegratedCacheStaleness { get; set; } + /// + /// Gets or sets if bypass the integrated cache or not associated with the request in the Azure CosmosDB service. + /// When set this value to true, the request will not be served from the integrated cache, and the response will not be cached either. + /// + /// Default value is false. + /// + /// + /// + /// + /// +#if PREVIEW + public +#else + internal +#endif + bool? BypassIntegratedCache { get; set; } + internal static void PopulateMaxIntegratedCacheStalenessOption(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions, RequestMessage request) { if (dedicatedGatewayRequestOptions?.MaxIntegratedCacheStaleness != null) @@ -37,5 +71,13 @@ internal static void PopulateMaxIntegratedCacheStalenessOption(DedicatedGatewayR request.Headers.Set(HttpConstants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness, cacheStalenessInMilliseconds.ToString(CultureInfo.InvariantCulture)); } } + + internal static void PopulateBypassIntegratedCacheOption(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions, RequestMessage request) + { + if (dedicatedGatewayRequestOptions != null && dedicatedGatewayRequestOptions.BypassIntegratedCache.HasValue && dedicatedGatewayRequestOptions.BypassIntegratedCache.Value) + { + request.Headers.Set(HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache, true.ToString(CultureInfo.InvariantCulture)); + } + } } } diff --git a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs index 30ece5015b..530bbfceb5 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs @@ -186,7 +186,7 @@ private async Task ReadCollectionAsync( { headers.XDate = Rfc1123DateTimeCache.UtcNow(); - request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace.Summary); + request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); if (clientSideRequestStatistics == null) { childTrace.AddDatum( diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index d99be609ea..14b641959a 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -85,7 +85,7 @@ public GatewayAddressCache( GatewayAddressCache.ProtocolString(this.protocol)); this.openConnectionsHandler = openConnectionsHandler; - this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariableAsBool( + this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariable( name: Constants.EnvironmentVariables.ReplicaConnectivityValidationEnabled, defaultValue: false); } @@ -550,10 +550,17 @@ await this.GetServerAddressesViaGatewayAsync(request, collectionRid, new[] { par } this.ValidateReplicaAddresses(transportAddressUris); + this.CaptureTransportAddressUriHealthStates( + partitionAddressInformation: mergedAddresses, + transportAddressUris: transportAddressUris); return mergedAddresses; } + this.CaptureTransportAddressUriHealthStates( + partitionAddressInformation: result.Item2, + transportAddressUris: result.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris); + return result.Item2; } } @@ -936,6 +943,22 @@ TransportAddressHealthState.HealthStatus.Unknown or TransportAddressHealthState.HealthStatus.UnhealthyPending); } + /// + /// The replica health status of the transport address uri will change eventually with the motonically increasing time. + /// However, the purpose of this method is to capture the health status snapshot at this moment. + /// + /// An instance of . + /// A read-only list of . + private void CaptureTransportAddressUriHealthStates( + PartitionAddressInformation partitionAddressInformation, + IReadOnlyList transportAddressUris) + { + partitionAddressInformation + .Get(Protocol.Tcp)? + .SetTransportAddressUrisHealthState( + replicaHealthStates: transportAddressUris.Select(x => x.GetCurrentHealthState().GetHealthStatusDiagnosticString()).ToList()); + } + protected virtual void Dispose(bool disposing) { if (this.disposedValue) diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs index 4373d61f56..d9e2854b2b 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs @@ -316,7 +316,7 @@ private async Task ExecutePartitionKeyRangeReadChangeFe } request.Headers[HttpConstants.HttpHeaders.Authorization] = authorizationToken; - request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace.Summary); + request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); if (clientSideRequestStatistics == null) { childTrace.AddDatum("Client Side Request Stats", request.RequestContext.ClientRequestStatistics); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs index 059e799d99..e7f859ff18 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs @@ -68,12 +68,7 @@ sealed class SqlPropertyName : SqlObject private SqlPropertyName(string value) { - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException($"{nameof(value)} must not be null, empty, or whitespace."); - } - - this.Value = value; + this.Value = value ?? throw new ArgumentNullException(nameof(value)); } public string Value { get; } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index 755e1e3a66..1bb66170b5 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -10,6 +10,7 @@ internal sealed class OpenTelemetryAttributeKeys public const string DiagnosticNamespace = "Azure.Cosmos"; public const string ResourceProviderNamespace = "Microsoft.DocumentDB"; public const string OperationPrefix = "Operation"; + public const string NetworkLevelPrefix = "Request"; // Common database attributes public const string DbSystemName = "db.system"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index c199c0727c..2ef929ca8c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; using System.Collections.Generic; + using System.Diagnostics; using global::Azure.Core; /// @@ -14,11 +15,12 @@ namespace Microsoft.Azure.Cosmos.Telemetry internal struct OpenTelemetryCoreRecorder : IDisposable { private const string CosmosDb = "cosmosdb"; - - private readonly DiagnosticScope scope; - private readonly DistributedTracingOptions config; - private readonly Documents.OperationType operationType; + private readonly DiagnosticScope scope = default; + private readonly DistributedTracingOptions config = null; + private readonly Activity activity = null; + + private readonly Documents.OperationType operationType = Documents.OperationType.Invalid; private OpenTelemetryAttributes response = null; internal static IDictionary> OTelCompatibleExceptions = new Dictionary>() @@ -30,7 +32,19 @@ internal struct OpenTelemetryCoreRecorder : IDisposable { typeof(ChangeFeedProcessorUserException), (exception, scope) => ChangeFeedProcessorUserException.RecordOtelAttributes((ChangeFeedProcessorUserException)exception, scope)} }; - public OpenTelemetryCoreRecorder( + private OpenTelemetryCoreRecorder(DiagnosticScope scope) + { + this.scope = scope; + this.scope.Start(); + } + + private OpenTelemetryCoreRecorder(string operationName) + { + this.activity = new Activity(operationName); + this.activity.Start(); + } + + private OpenTelemetryCoreRecorder( DiagnosticScope scope, string operationName, string containerName, @@ -54,6 +68,45 @@ public OpenTelemetryCoreRecorder( } } + /// + /// Used for creating parent activity in scenario where there are no listeners at operation level + /// but they are present at network level + /// + public static OpenTelemetryCoreRecorder CreateNetworkLevelParentActivity(DiagnosticScope networkScope) + { + return new OpenTelemetryCoreRecorder(networkScope); + } + + /// + /// Used for creating parent activity in scenario where there are no listeners at operation level and network level + /// + public static OpenTelemetryCoreRecorder CreateParentActivity(string operationName) + { + return new OpenTelemetryCoreRecorder(operationName); + } + + /// + /// Used for creating parent activity in scenario where there are listeners at operation level + /// + public static OpenTelemetryCoreRecorder CreateOperationLevelParentActivity( + DiagnosticScope operationScope, + string operationName, + string containerName, + string databaseName, + Documents.OperationType operationType, + CosmosClientContext clientContext, + DistributedTracingOptions config) + { + return new OpenTelemetryCoreRecorder( + operationScope, + operationName, + containerName, + databaseName, + operationType, + clientContext, + config); + } + public bool IsEnabled => this.scope.IsEnabled; public void Record(string key, string value) @@ -179,6 +232,10 @@ Documents.OperationType operationType this.scope.Dispose(); } + else + { + this.activity?.Stop(); + } } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 51b4666b6f..ca0b864d2f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -5,7 +5,9 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; + using System.Diagnostics; using global::Azure.Core; + using Microsoft.Azure.Cosmos.Tracing; /// /// This class is used to generate Activities with Azure.Cosmos.Operation Source Name @@ -15,33 +17,44 @@ internal static class OpenTelemetryRecorderFactory /// /// Singleton to make sure we only have one instance of the DiagnosticScopeFactory and pattern matching of listener happens only once /// - private static DiagnosticScopeFactory ScopeFactory { get; set; } - + private static readonly Lazy LazyOperationScopeFactory = new Lazy( + valueFactory: () => new DiagnosticScopeFactory( + clientNamespace: $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.{OpenTelemetryAttributeKeys.OperationPrefix}", + resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, + isActivityEnabled: true, + suppressNestedClientActivities: true), + isThreadSafe: true); + + private static readonly Lazy LazyNetworkScopeFactory = new Lazy( + valueFactory: () => new DiagnosticScopeFactory( + clientNamespace: $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.{OpenTelemetryAttributeKeys.NetworkLevelPrefix}", + resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, + isActivityEnabled: true, + suppressNestedClientActivities: true), + isThreadSafe: true); + public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, string containerName, string databaseName, Documents.OperationType operationType, RequestOptions requestOptions, + ITrace trace, CosmosClientContext clientContext) { + OpenTelemetryCoreRecorder openTelemetryRecorder = default; if (clientContext is { ClientOptions.IsDistributedTracingEnabled: true }) { - OpenTelemetryRecorderFactory.ScopeFactory ??= new DiagnosticScopeFactory(clientNamespace: OpenTelemetryAttributeKeys.DiagnosticNamespace, - resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, - isActivityEnabled: true, - suppressNestedClientActivities: true); - // If there is no source then it will return default otherwise a valid diagnostic scope - DiagnosticScope scope = OpenTelemetryRecorderFactory - .ScopeFactory - .CreateScope(name: $"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}", + DiagnosticScope scope = LazyOperationScopeFactory.Value.CreateScope(name: operationName, kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client); // Record values only when we have a valid Diagnostic Scope if (scope.IsEnabled) { - return new OpenTelemetryCoreRecorder( - scope: scope, + scope.SetDisplayName($"{operationName} {containerName}"); + + openTelemetryRecorder = OpenTelemetryCoreRecorder.CreateOperationLevelParentActivity( + operationScope: scope, operationName: operationName, containerName: containerName, databaseName: databaseName, @@ -49,9 +62,17 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, clientContext: clientContext, config: requestOptions?.DistributedTracingOptions ?? clientContext.ClientOptions?.DistributedTracingOptions); } - } +#if !INTERNAL + else if (Activity.Current is null) + { + DiagnosticScope requestScope = LazyNetworkScopeFactory.Value.CreateScope(name: operationName); - return default; + openTelemetryRecorder = requestScope.IsEnabled ? OpenTelemetryCoreRecorder.CreateNetworkLevelParentActivity(networkScope: requestScope) : OpenTelemetryCoreRecorder.CreateParentActivity(operationName); + } +#endif + trace.AddDatum("DistributedTraceId", Activity.Current?.TraceId); + } + return openTelemetryRecorder; } } } diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs index 10845f133f..def12c8262 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs @@ -33,9 +33,8 @@ internal sealed class ClientSideRequestStatisticsTraceDatum : TraceDatum, IClien private IReadOnlyList shallowCopyOfStoreResponseStatistics = null; private IReadOnlyList shallowCopyOfHttpResponseStatistics = null; private SystemUsageHistory systemUsageHistory = null; - public TraceSummary TraceSummary = null; - public ClientSideRequestStatisticsTraceDatum(DateTime startTime, TraceSummary summary) + public ClientSideRequestStatisticsTraceDatum(DateTime startTime, ITrace trace) { this.RequestStartTimeUtc = startTime; this.RequestEndTimeUtc = null; @@ -45,7 +44,7 @@ public ClientSideRequestStatisticsTraceDatum(DateTime startTime, TraceSummary su this.FailedReplicas = new HashSet(); this.RegionsContacted = new HashSet<(string, Uri)>(); this.httpResponseStatistics = new List(); - this.TraceSummary = summary; + this.Trace = trace; } public DateTime RequestStartTimeUtc { get; } @@ -75,6 +74,10 @@ public IReadOnlyDictionary EndpointToAddres public HashSet<(string, Uri)> RegionsContacted { get; } + public ITrace Trace { get; private set; } + + public TraceSummary TraceSummary => this.Trace?.Summary; + public IReadOnlyList StoreResponseStatisticsList { get @@ -502,11 +505,11 @@ public HttpResponseStatistics( if (responseMessage != null) { Headers headers = new Headers(GatewayStoreClient.ExtractResponseHeaders(responseMessage)); - this.ActivityId = headers.ActivityId ?? Trace.CorrelationManager.ActivityId.ToString(); + this.ActivityId = headers.ActivityId ?? System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(); } else { - this.ActivityId = Trace.CorrelationManager.ActivityId.ToString(); + this.ActivityId = System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(); } } diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs index 74363c8ca1..247c9f2587 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs @@ -430,6 +430,8 @@ public void Visit(StoreResult storeResult) this.jsonWriter.WriteFieldName("BELatencyInMs"); this.WriteStringValueOrNull(storeResult.BackendRequestDurationInMs); + this.WriteJsonUriArray("ReplicaHealthStatuses", storeResult.ReplicaHealthStatuses); + this.VisitTransportRequestStats(storeResult.TransportRequestStats); this.jsonWriter.WriteFieldName("TransportException"); @@ -468,6 +470,22 @@ private void WriteJsonUriArray(string propertyName, IEnumerable replicaHealthStatuses) + { + this.jsonWriter.WriteFieldName(propertyName); + this.jsonWriter.WriteArrayStart(); + + if (replicaHealthStatuses != null) + { + foreach (string replicaHealthStatus in replicaHealthStatuses) + { + this.WriteStringValueOrNull(replicaHealthStatus); + } + } + + this.jsonWriter.WriteArrayEnd(); + } + private void WriteRegionsContactedArray(string propertyName, IEnumerable<(string, Uri)> uris) { this.jsonWriter.WriteFieldName(propertyName); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs index e9fbc54267..62f20f1fe4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs @@ -153,8 +153,8 @@ public void ExecuteTestSuite(IEnumerable inputs, [CallerMemberName] stri Please run the ..\azure-cosmos-dotnet-v3\UpdateContracts.ps1 script to update the baselines. Expected: {baselineTextSuffix}, Actual: {outputTextSuffix}, - OutputPath: {outputPath}, - BaselinePath: {baselinePath}"); + OutputPath: {Path.GetFullPath(outputPath)}, + BaselinePath: {Path.GetFullPath(baselinePath)}"); } /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 90f32b89c9..66edf29c06 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -38,6 +38,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Execute Next Batch(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ├── Create Batch Request(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds @@ -64,7 +66,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -128,10 +131,38 @@ ] } ] -}]]> - Operation.ExecuteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ExecuteAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Batch + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 1001 + 207 + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index b776a8eaae..053f6ecc39 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -35,6 +35,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -69,7 +71,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -152,29 +155,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -212,6 +441,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -240,7 +471,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -310,29 +542,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -370,6 +828,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -398,7 +858,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -468,29 +929,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -528,6 +1215,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -556,7 +1245,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -626,29 +1316,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -686,6 +1602,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -714,7 +1632,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -784,29 +1703,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -844,6 +1989,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -872,7 +2019,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -942,29 +2090,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -1002,6 +2376,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1030,7 +2406,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1100,29 +2477,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -1160,6 +2763,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1188,7 +2793,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1258,29 +2864,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -1318,6 +3150,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1346,7 +3180,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1416,29 +3251,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -1476,6 +3537,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1504,7 +3567,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1574,29 +3638,255 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + + + + + + + @@ -1650,6 +3940,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1824,7 +4116,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2323,10 +4616,29 @@ ] } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + + Some Value + Create + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 4189b4bab8..379c887104 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -30,6 +30,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -72,6 +74,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -99,6 +103,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -126,6 +132,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -153,6 +161,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -245,7 +255,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -408,7 +419,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -495,7 +507,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -582,7 +595,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -669,7 +683,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -951,19 +966,142 @@ ] } ] -}]]> - Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + + + + + + + @@ -997,6 +1135,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1040,6 +1180,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1068,6 +1210,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1096,6 +1240,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1131,7 +1277,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1298,7 +1445,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1389,7 +1537,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1480,7 +1629,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1568,19 +1718,142 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + + + + + + + @@ -1615,6 +1888,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1657,6 +1932,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1684,6 +1961,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1711,6 +1990,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1745,7 +2026,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1908,7 +2190,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1995,7 +2278,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2082,7 +2366,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2166,19 +2451,142 @@ ] } ] -}]]> - Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + + + + + + + @@ -2213,6 +2621,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2256,6 +2666,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2284,6 +2696,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2312,6 +2726,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2347,7 +2763,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2514,7 +2931,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2605,7 +3023,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2696,7 +3115,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2784,19 +3204,142 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + + + + + + + @@ -2826,6 +3369,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Initialize Lease Store(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -2895,7 +3440,8 @@ "name": "Change Feed Estimator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -3065,10 +3611,38 @@ ] } ] -}]]> - Operation.Change Feed Estimator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Estimator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 591a6af4ac..7341e76cb9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -4,7 +4,7 @@ Custom Handler - Operation.DeleteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteAsync + miscdbcustonhandler + + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateDatabaseAsync + miscdbcustonhandler + + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + @@ -120,7 +166,7 @@ - Operation.DeleteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteAsync + miscdbdataplane + + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateDatabaseAsync + miscdbdataplane + + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 64e7e0c3ed..4e11d5e4b7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -37,6 +37,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -71,7 +73,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -147,11 +150,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -204,6 +226,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -257,7 +281,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -389,11 +414,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -472,6 +516,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -517,7 +563,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -614,11 +661,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -697,6 +763,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -753,7 +821,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -871,11 +940,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -954,6 +1042,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1032,7 +1122,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1192,11 +1283,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -1236,6 +1346,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1270,7 +1382,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1346,10 +1459,29 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index d2abebc194..8b737a419e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -24,6 +24,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -64,6 +66,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -97,6 +101,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -130,6 +136,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -171,6 +179,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -298,6 +307,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -391,6 +401,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -484,6 +495,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -573,17 +585,111 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -610,6 +716,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -651,6 +759,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -685,6 +795,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -719,6 +831,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -761,6 +875,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -892,6 +1007,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -989,6 +1105,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1086,6 +1203,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1179,17 +1297,111 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -1217,6 +1429,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1257,6 +1471,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1290,6 +1506,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1323,6 +1541,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -1364,6 +1584,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1491,6 +1712,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1584,6 +1806,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1677,6 +1900,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1766,17 +1990,111 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -1804,6 +2122,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1845,6 +2165,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1879,6 +2201,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1913,6 +2237,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -1955,6 +2281,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2086,6 +2413,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2183,6 +2511,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2280,6 +2609,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2373,17 +2703,111 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -2414,6 +2838,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2475,6 +2901,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2509,6 +2937,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2543,6 +2973,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -2585,6 +3017,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2760,6 +3193,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2857,6 +3291,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2954,6 +3389,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3047,17 +3483,111 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -3087,6 +3617,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3128,6 +3660,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3161,6 +3695,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3194,6 +3730,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -3235,6 +3773,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3368,6 +3907,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3461,6 +4001,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3554,6 +4095,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3643,17 +4185,111 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -3683,6 +4319,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3725,6 +4363,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3759,6 +4399,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3793,6 +4435,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -3835,6 +4479,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3972,6 +4617,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4069,6 +4715,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4166,6 +4813,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4259,16 +4907,110 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index dc6df3eacf..86f16841b5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -24,6 +24,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -64,6 +66,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -89,6 +93,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -114,6 +120,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -146,7 +154,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -301,7 +310,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -380,7 +390,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -459,7 +470,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -535,17 +547,111 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -572,6 +678,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -613,6 +721,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -639,6 +749,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -665,6 +777,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -698,7 +812,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -857,7 +972,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -940,7 +1056,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1023,7 +1140,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1103,17 +1221,111 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -1141,6 +1353,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1181,6 +1395,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1206,6 +1422,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1231,6 +1449,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1263,7 +1483,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1418,7 +1639,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1497,7 +1719,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1576,7 +1799,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1652,17 +1876,111 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + @@ -1690,6 +2008,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1731,6 +2051,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1757,6 +2079,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1783,6 +2107,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1816,7 +2142,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1975,7 +2302,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2058,7 +2386,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2141,7 +2470,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2221,16 +2551,110 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 29b36304ec..42c948a0d9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -16,6 +16,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Execute query for a partitionkeyrange(00000000-0000-0000-0000-000000000000) Query-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -141,7 +143,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -541,11 +544,39 @@ ] } ] -}]]> - Operation.ReadManyItemsStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadManyItemsStreamAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + @@ -561,6 +592,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Execute query for a partitionkeyrange(00000000-0000-0000-0000-000000000000) Query-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -689,7 +722,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1101,10 +1135,38 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.ReadManyItemsAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadManyItemsAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 18f11acd62..ea5327040a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -22,6 +22,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -44,7 +46,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -88,11 +91,39 @@ ] } ] -}]]> - Operation.CreateItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemStreamAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 201 + + + @@ -111,6 +142,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -133,7 +166,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -177,11 +211,39 @@ ] } ] -}]]> - Operation.ReadItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadItemStreamAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + @@ -208,6 +270,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -230,7 +294,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -274,11 +339,39 @@ ] } ] -}]]> - Operation.ReplaceItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReplaceItemStreamAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Replace + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + @@ -300,6 +393,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -322,7 +417,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -366,10 +462,38 @@ ] } ] -}]]> - Operation.DeleteItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteItemStreamAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 204 + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index abeaa41de8..25b6e52364 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -20,6 +20,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -46,7 +48,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -108,11 +111,39 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 201 + + + @@ -131,6 +162,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -154,7 +187,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -202,11 +236,39 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.ReadItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + @@ -233,6 +295,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -257,7 +321,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -309,11 +374,39 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.ReplaceItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReplaceItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Replace + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + @@ -334,6 +427,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -357,7 +452,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -405,10 +501,38 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.DeleteItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteItemAsync + databaseName + containerName + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 204 + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml new file mode 100644 index 0000000000..bd2e168e76 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml @@ -0,0 +1,38 @@ + + + + Where with same predicate instance]]> + + + + + + + + + Select with same predicate instance]]> + + + + + + + + + Select -> Where with same predicate instance]]> + new AnonymousType(Int = 10, Result = c)).Where(DisplayClass.predicate2)]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml index 90a463defa..97aac9ef55 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml @@ -1,4 +1,52 @@  + + + + doc.ArrayField.IsArray())]]> + + + + + + + + + doc.StringField.IsArray())]]> + + + + + + + + + Convert(doc.BooleanField, Object).IsBool())]]> + + + + + + + + + doc.StringField.IsBool())]]> + + + + + @@ -45,6 +93,52 @@ FROM root WHERE IS_NULL(root["StringField"])]]> + + + + Convert(doc.NumericField, Object).IsNumber())]]> + + + + + + + + + doc.StringField.IsNumber())]]> + + + + + + + + + doc.ObjectField.IsObject())]]> + + + + + + + + + doc.StringField.IsObject())]]> + + + + + @@ -68,4 +162,27 @@ FROM root WHERE IS_PRIMITIVE(root["StringField"])]]> + + + + doc.StringField.IsString())]]> + + + + + + + + + Convert(doc.NumericField, Object).IsString())]]> + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs index e977a8b459..e07fe85a7e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs @@ -205,7 +205,7 @@ public async Task InitializeContainersAsync_WhenThrowsException_ShouldDisposeCos public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldOpenRntbdConnectionsToBackendReplicas() { // Arrange. - int httpCallsMade = 0; + int httpCallsMade = 0, maxRequestsPerConnection = 6; HttpClientHandlerHelper httpClientHandlerHelper = new () { RequestCallBack = (request, cancellationToken) => @@ -227,6 +227,7 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO { HttpClientFactory = () => new HttpClient(httpClientHandlerHelper), ConnectionMode = ConnectionMode.Direct, + MaxRequestsPerTcpConnection = maxRequestsPerConnection, }; // Act. @@ -275,8 +276,11 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO .GetValue(loadBalancingPartition); Assert.IsNotNull(openChannels); - Assert.AreEqual(30, channelCapacity); - Assert.AreEqual(1, openChannels.Count); + Assert.AreEqual(48, openChannels.Count, "Here the expected value 48 rather explains how many time we call the" + + "LoadBalancingPartition.OpenChannelAsync(). The emulator by default returns 12 partitions, and each partition has 4 replicas," + + "and by behavior the emulator uses the same URI for eac of these replica, hence 12 * 4 = 48 times we call the OpenChannelAsync()." + + "In ideal world, the value should be 1, because for each unique URI, the OpenChannelAsync() call will just be 1."); + Assert.AreEqual(openChannels.Count * maxRequestsPerConnection, channelCapacity); Documents.Rntbd.LbChannelState channelState = openChannels.First(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs new file mode 100644 index 0000000000..486e785978 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs @@ -0,0 +1,45 @@ +namespace Microsoft.Azure.Cosmos +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics.CodeAnalysis; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + class ComputedPropertyComparer : IEqualityComparer + { + public static void AssertAreEqual(Collection expected, Collection actual) + { + int expectedCount = expected?.Count ?? 0; + int actualCount = actual?.Count ?? 0; + Assert.AreEqual(expectedCount, actualCount); + + for (int i = 0; i < expectedCount; i++) + { + AssertAreEqual(expected[i], actual[i]); + } + } + + public static void AssertAreEqual(ComputedProperty expected, ComputedProperty actual) + { + ComputedPropertyComparer comparer = new ComputedPropertyComparer(); + Assert.IsTrue(comparer.Equals(expected, actual), $"Expected: {ToString(expected)}{Environment.NewLine}Actual:{ToString(actual)}"); + } + + private static string ToString(ComputedProperty computedProperty) => $@"""Name"":""{computedProperty.Name}"", ""Query"":""{computedProperty.Query}"""; + + public bool Equals(ComputedProperty x, ComputedProperty y) + { + if (x == null) return y == null; + if (y == null) return false; + + return (x.Name?.Equals(y.Name) == true) && + (x.Query?.Equals(y.Query) == true); + } + + public int GetHashCode([DisallowNull] ComputedProperty obj) + { + return obj.GetHashCode(); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs new file mode 100644 index 0000000000..a2c7f552ee --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs @@ -0,0 +1,549 @@ +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using global::Azure; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class ComputedPropertyTests + { + private static readonly CosmosClient cosmosClient; + private static readonly Database database; + + private static readonly ComputedProperty LowerName; + private static readonly ComputedProperty ParentsFullName; + private static readonly Collection AllComputedProperties; + + private static readonly IndexingPolicy IndexAllComputedProperties_IncludeAll; + private static readonly IndexingPolicy IndexAllComputedProperties_ExcludeAll; + private static readonly IndexingPolicy IndexDefault_IncludeAll; + private static readonly IndexingPolicy IndexDefault_ExcludeAll; + + private static readonly string SelectAllComputedPropertiesQuery; + private static readonly List AllComputedPropertiesResult; + private static readonly List EmptyResult; + + static ComputedPropertyTests() + { + cosmosClient = TestCommon.CreateCosmosClient(); + database = cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()).Result; + + LowerName = new ComputedProperty + { + Name = "lowerLastName", + Query = "SELECT VALUE LOWER(IS_DEFINED(c.lastName) ? c.lastName : c.parents[0].familyName) FROM c" + }; + ParentsFullName = new ComputedProperty + { + Name = "parentsFullName", + Query = "SELECT VALUE CONCAT(CONCAT(c.parents[0].firstName, ' ', c.lastName), ' & ', CONCAT(c.parents[1].firstName, ' ', c.lastName)) FROM c" + }; + AllComputedProperties = new Collection { { LowerName }, { ParentsFullName } }; + + IndexAllComputedProperties_IncludeAll = new IndexingPolicy + { + IncludedPaths = new Collection + { + { new IncludedPath { Path = $"/{LowerName.Name}/*" } }, + { new IncludedPath { Path = $"/{ParentsFullName.Name}/*" } }, + { new IncludedPath { Path = $"/*" } }, + } + }; + IndexAllComputedProperties_ExcludeAll = new IndexingPolicy + { + IncludedPaths = new Collection + { + { new IncludedPath { Path = $"/{LowerName.Name}/*" } }, + { new IncludedPath { Path = $"/{ParentsFullName.Name}/*" } }, + }, + ExcludedPaths = new Collection + { + { new ExcludedPath { Path = $"/*" } } + } + }; + IndexDefault_IncludeAll = new IndexingPolicy + { + IncludedPaths = new Collection + { + { new IncludedPath { Path = $"/*" } }, + } + }; + IndexDefault_ExcludeAll = new IndexingPolicy + { + ExcludedPaths = new Collection + { + { new ExcludedPath { Path = $"/*" } } + } + }; + + SelectAllComputedPropertiesQuery = @"SELECT c.lowerLastName, c.parentsFullName FROM c"; + AllComputedPropertiesResult = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen"",{Environment.NewLine} ""parentsFullName"": ""Thomas Andersen & Mary Kay Andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + }; + EmptyResult = new List + { + @"{}", + @"{}" + }; + } + + [ClassCleanup] + public static async Task Cleanup() + { + await database?.DeleteAsync(); + } + + [Ignore] + [TestMethod] + public async Task TestComputedProperties() + { + TestVariation[] variations = new TestVariation[] + { + ///////////////// + // Create tests + ///////////////// + new TestVariation + { + Description = "V1: null; V2: Empty", + V1 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + }, + V2 = new ContainerState + { + ComputedProperties = new Collection(), + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, no indexing", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, indexed, exclude /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, indexed, include /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, not indexed, exclude /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, not indexed, include /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + new TestVariation + { + Description = "V1: one computed property; V2: All computed properties, not indexed, include /*", + V1 = new ContainerState() + { + ComputedProperties = new Collection{ LowerName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + }, + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + + ///////////////// + // Replace tests + ///////////////// + new TestVariation + { + Description = "V1: one computed property; V2: other computed property, not indexed, include /*", + V1 = new ContainerState() + { + ComputedProperties = new Collection{ LowerName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + }, + V2 = new ContainerState + { + ComputedProperties = new Collection{ ParentsFullName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""parentsFullName"": ""Thomas Andersen & Mary Kay Andersen""{Environment.NewLine}}}", + @"{}" + } + } + }, + new TestVariation + { + Description = "V1: one computed property; V2: updated computed property definition, not indexed, include /*", + V1 = new ContainerState() + { + ComputedProperties = new Collection{ LowerName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + }, + V2 = new ContainerState + { + ComputedProperties = new Collection + { + new ComputedProperty + { + Name = "lowerLastName", + Query = "SELECT VALUE LOWER(c.lastName) FROM c" + } + }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + @"{}" + } + } + }, + + ///////////////// + // Drop tests + ///////////////// + new TestVariation + { + Description = "V1: All computed properties; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties; V2: only 1 computed property", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = new Collection{ LowerName }, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + } + }, + new TestVariation + { + Description = "V1: All computed properties, indexed, exclude /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties, indexed, include /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties, not indexed, exclude /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties, not indexed, include /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + } + }; + + int i = 0; + foreach (TestVariation variation in variations) + { + Console.WriteLine($"Variation {i++} : {variation.Description}"); + await this.RunTest(variation); + } + } + + private async Task RunTest(TestVariation variation) + { + Container container = await this.CreateOrReplace(container: null, containerState: variation.V1); + return await this.CreateOrReplace(container, containerState: variation.V2); + } + + private async Task CreateOrReplace(Container container, ContainerState containerState) + { + ContainerProperties containerProperties = new ContainerProperties(container?.Id ?? Guid.NewGuid().ToString(), "/id") + { + IndexingPolicy = containerState.IndexingPolicy ?? new IndexingPolicy(), + ComputedProperties = containerState.ComputedProperties ?? new Collection(), + }; + + ContainerResponse response = container == null ? + await database.CreateContainerAsync(containerProperties) : + await container.ReplaceContainerAsync(containerProperties); + + this.ValidateComputedProperties(containerState.ComputedProperties, response.Resource.ComputedProperties); + + if (container == null) + { + await this.InsertDocuments(response.Container); + } + else + { + // Sometimes the container changes are not immediately reflected in the query. + // We force a insert-delete after container replacement, which seems to help with this problem. + // If this still doesn't help with the flakiness, we need to find other ways of running the query scenario. + // One alternative is to wait for V2 for all test variations to take effect + // and then run queries separately on each container. + await this.DeleteReinsertDocuments(response.Container); + } + + if (!string.IsNullOrEmpty(containerState.Query)) + { + List results = await this.QueryItems(response.Container, containerState.Query); + + Assert.AreEqual(containerState.ExpectedDocuments.Count, results.Count); + for (int i = 0; i < containerState.ExpectedDocuments.Count; i++) + { + Assert.AreEqual(containerState.ExpectedDocuments[i], results[i]); + } + } + + return response.Container; + } + + private async Task DeleteReinsertDocuments(Container container) + { + foreach (CosmosObject document in Documents) + { + string id = ((CosmosString)document["id"]).Value; + await container.DeleteItemAsync(id, new PartitionKey(id)); + } + + await this.InsertDocuments(container); + } + + private async Task InsertDocuments(Container container) + { + foreach(CosmosObject document in Documents) + { + await container.CreateItemAsync(document); + } + } + + private async Task> QueryItems(Container container, string query) + { + List results = new List(); + FeedIterator iterator = container.GetItemQueryIterator(query); + do + { + FeedResponse page = await iterator.ReadNextAsync(); + results.AddRange(page.Select(item => item.ToString())); + } while (iterator.HasMoreResults); + + return results; + } + + private void ValidateComputedProperties(Collection expected, Collection actual) + { + ComputedPropertyComparer.AssertAreEqual(expected, actual); + } + + private class TestVariation + { + public string Description { get; set; } + public ContainerState V1 { get; set; } + public ContainerState V2 { get; set; } + } + + private class ContainerState + { + public Collection ComputedProperties { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public List ExpectedDocuments { get; set; } + public string Query { get; set; } + } + + private static readonly CosmosObject AndersenFamily = CosmosObject.Parse(@" + { + ""id"": ""AndersenFamily"", + ""lastName"": ""Andersen"", + ""parents"": [ + { ""firstName"": ""Thomas"" }, + { ""firstName"": ""Mary Kay""} + ], + ""children"": [ + { + ""firstName"": ""Henriette Thaulow"", + ""gender"": ""female"", + ""grade"": 5, + ""pets"": [{ ""givenName"": ""Fluffy"" }] + } + ], + ""address"": { ""state"": ""WA"", ""county"": ""King"", ""city"": ""seattle"" }, + ""creationDate"": 1431620472, + ""isRegistered"": true, + ""_rid"": ""0fomAIxnukU1AQAAAAAAAA=="" + }"); + + private static readonly CosmosObject WakefieldFamily = CosmosObject.Parse(@" + { + ""id"": ""WakefieldFamily"", + ""parents"": [ + { ""familyName"": ""Wakefield"", ""givenName"": ""Robin"" }, + { ""familyName"": ""Miller"", ""givenName"": ""Ben"" } + ], + ""children"": [ + { + ""familyName"": ""Merriam"", + ""givenName"": ""Jesse"", + ""gender"": ""female"", ""grade"": 1, + ""pets"": [ + { ""givenName"": ""Goofy"" }, + { ""givenName"": ""Shadow"" } + ] + }, + { + ""familyName"": ""Miller"", + ""givenName"": ""Lisa"", + ""gender"": ""female"", + ""grade"": 8 } + ], + ""address"": { ""state"": ""NY"", ""county"": ""Manhattan"", ""city"": ""NY"" }, + ""creationDate"": 1431620462, + ""isRegistered"": false, + ""_rid"": ""0fomAIxnukU1AQAAAAAAAB=="" + }"); + + private static readonly CosmosElement[] Documents = new CosmosElement[] + { + AndersenFamily, + WakefieldFamily, + }; + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs index 8b4728c122..f50319f65f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs @@ -163,7 +163,7 @@ public DisableServiceInterop( { } - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return true; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs new file mode 100644 index 0000000000..8b5825831c --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs @@ -0,0 +1,222 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.SDK.EmulatorTests; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json.Linq; + using OpenTelemetry.Trace; + using OpenTelemetry; + using AzureCore = global::Azure.Core; + using Microsoft.Azure.Cosmos.Telemetry; + using System.Diagnostics; + using Microsoft.Azure.Cosmos.Tracing; + using System.Net.Http; + using System.ComponentModel; + + [VisualStudio.TestTools.UnitTesting.TestClass] + public sealed class DistributedTracingOTelTests : BaseCosmosClientHelper + { + [TestInitialize] + public void TestInitialize() + { + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + AzureCore.ActivityExtensions.ResetFeatureSwitch(); + } + + [DataTestMethod] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at operation and network level with Diagnostic TraceId being added to logs")] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", null, DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at operation level with Diagnostic TraceId being added to logs")] + public async Task SourceEnabled_FlagOn_DirectMode_RecordsActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) + { + string[] sources = new string[] { operationLevelSource, networkLevelSource }; + sources = sources.Where(x => x != null).ToArray(); + + using TracerProvider provider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() + .AddSource(sources) + .Build(); + + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(true) + .WithConnectionModeDirect()); + + Container containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + CosmosObject cosmosObject = CosmosObject.Create( + new Dictionary() + { + { "id", CosmosString.Create("1") } + }); + + ItemResponse createResponse = await containerResponse.CreateItemAsync(JToken.Parse(cosmosObject.ToString())); + + //Assert traceparent header in Direct mode request + Assert.IsTrue(createResponse.RequestMessage.Headers.TryGetValue("traceparent", out string traceheader)); + Assert.IsNotNull(traceheader); + string[] traceheaderParts = traceheader.Split('-'); + string traceheaderId = traceheaderParts[1]; + + //Assert traceId in Diagnostics logs + string diagnosticsCreateItem = createResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateItem); + string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; + Assert.IsFalse(string.IsNullOrEmpty(distributedTraceId)); + + //Assert diagnostics log trace id is same as parent trace id of the activity + string operationName = (string)objDiagnosticsCreate["name"]; + string traceIdCreateItem = CustomOtelExporter.CollectedActivities + .Where(x => x.OperationName.Contains(operationName)) + .FirstOrDefault() + .TraceId + .ToString(); + //Assert created activity traceId and diagnosticsLog traceId + Assert.AreEqual(distributedTraceId, traceIdCreateItem); + + //Assert requestHeader trace id and and diagnosticsLog traceId + Assert.AreEqual(distributedTraceId, traceheaderId); + + //Assert activity creation + Assert.IsNotNull(CustomOtelExporter.CollectedActivities); + + if (networkLevelSource != null) + { + // Assert activity created at network level have an existing parent activity + Activity networkLevelChildActivity = CustomOtelExporter.CollectedActivities + .Where(x => x.OperationName.Contains("Request")) + .FirstOrDefault(); + Assert.IsNotNull(CustomOtelExporter.CollectedActivities + .Where(x => x.Id == networkLevelChildActivity.ParentId)); + } + } + + [DataTestMethod] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at operation and network level with Diagnostic TraceId being added to logs")] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", null, DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at operation level with Diagnostic TraceId being added to logs")] + public async Task SourceEnabled_FlagOn_GatewayMode_RecordsActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) + { + string[] sources = new string[] { operationLevelSource, networkLevelSource }; + sources = sources.Where(x => x != null).ToArray(); + + HttpClientHandlerHelper httpClientHandlerHelper = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.Headers.TryGetValues("traceparent", out IEnumerable traceparentHeaderValues)) + { + Assert.IsNotNull(traceparentHeaderValues); + } + return null; + } + }; + + using TracerProvider provider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() + .AddSource(sources) + .Build(); + + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(true) + .WithHttpClientFactory(() => new HttpClient(httpClientHandlerHelper)) + .WithConnectionModeGateway()); + + ContainerResponse containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + List b = CustomOtelExporter.CollectedActivities.ToList(); + //Assert traceId in Diagnostics logs + string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); + string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; + Assert.IsFalse(string.IsNullOrEmpty(distributedTraceId)); + + //Assert diagnostics log trace id is same as parent trace id of the activity + string operationName = (string)objDiagnosticsCreate["name"]; + string traceIdCreateContainer = CustomOtelExporter.CollectedActivities + .Where(x => x.OperationName.Contains(operationName)) + .FirstOrDefault() + .TraceId + .ToString(); + Assert.AreEqual(distributedTraceId, traceIdCreateContainer); + + //Assert activity creation + Assert.IsNotNull(CustomOtelExporter.CollectedActivities); + } + + [DataTestMethod] + [DataRow(false, true, "random.source.name", DisplayName = "DirectMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] + [DataRow(true, true, "random.source.name", DisplayName = "GatewayMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] + [DataRow(false, false, "random.source.name", DisplayName = "DirectMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] + [DataRow(true, false, "random.source.name", DisplayName = "GatewayMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] + [DataRow(false, false, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "DirectMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] + [DataRow(true, false, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "GatewayMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] + public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_AssertLogTraceId(bool useGateway, bool enableDistributingTracing, string source) + { + using TracerProvider provider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() + .AddSource(source) + .Build(); + + if (useGateway) + { + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(enableDistributingTracing) + .WithConnectionModeGateway()); + } + else + { + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(enableDistributingTracing)); + } + + ContainerResponse containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + //Assert traceId in Diagnostics logs + string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); + + if (enableDistributingTracing) + { + //DistributedTraceId present in logs + string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; + Assert.IsFalse(string.IsNullOrEmpty(distributedTraceId), "Distributed Trace Id is not there in diagnostics"); + } + else + { + //DistributedTraceId field not present in logs + Assert.IsNull(objDiagnosticsCreate["data"]["DistributedTraceId"], "Distributed Trace Id has value in diagnostics i.e. " + (string)objDiagnosticsCreate["data"]["DistributedTraceId"]); + } + + //Assert no activity with attached source is created + Assert.AreEqual(0, CustomOtelExporter.CollectedActivities.Count()); + } + + [TestCleanup] + public async Task CleanUp() + { + await base.TestCleanup(); + + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", false); + AzureCore.ActivityExtensions.ResetFeatureSwitch(); + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs index 9de85f9f7e..8eb72cac25 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using System; + using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; @@ -98,6 +99,11 @@ public async Task ContainerContractTest() } } }, + // ComputedProperties = new Collection + // { + // { new ComputedProperty{ Name = "lowerName", Query = "SELECT VALUE LOWER(c.Name) FROM c" } }, + // { new ComputedProperty{ Name = "fullName", Query = "SELECT VALUE CONCAT(c.Name, ' ', c.LastName) FROM c" } } + // }, ClientEncryptionPolicy = new ClientEncryptionPolicy(paths) }; @@ -140,6 +146,129 @@ public async Task ContainerContractTest() Assert.IsTrue(responseProperties.ClientEncryptionPolicy.PolicyFormatVersion <= 2); ClientEncryptionIncludedPath clientEncryptionIncludedPath = responseProperties.ClientEncryptionPolicy.IncludedPaths.First(); Assert.IsTrue(this.VerifyClientEncryptionIncludedPath(clientEncryptionIncludedPath1, clientEncryptionIncludedPath)); + + ComputedPropertyComparer.AssertAreEqual(containerProperties.ComputedProperties, responseProperties.ComputedProperties); + ComputedPropertyComparer.AssertAreEqual(containerProperties.ComputedProperties, deserialziedTest.ComputedProperties); + } + + [Ignore] + [TestMethod] + public async Task ContainerNegativeComputedPropertyTest() + { + string query = "SELECT VALUE LOWER(c.name) FROM c"; + var variations = new[] + { + new + { + ComputedProperties = new Collection + { + new ComputedProperty {Name = "lowerName", Query = @"SELECT VALUE LOWER(c.name) FROM c"}, + new ComputedProperty {Name = "lowerName", Query = @"SELECT VALUE LOWER(c.lastName) FROM c"} + }, + Error = @"""Errors"":[""Computed property name 'lowerName' cannot be used in multiple definitions.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Query = query } }, + Error = @"""Errors"":[""One of the specified inputs is invalid""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "", Query = query } }, + Error = @"""Errors"":[""Computed property 'name' is either empty or unspecified.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "lowerName" } }, + Error = @"""Errors"":[""One of the specified inputs is invalid""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "lowerName", Query = "" } }, + Error = @"""Errors"":[""Computed property 'query' is either empty or unspecified.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "id", Query = query } }, + Error = @"""Errors"":[""The system property name 'id' cannot be used as a computed property name.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "spatial", Query = query } }, + Error = @"""Errors"":[""Computed property 'spatial' at index (0) has a spatial index. Remove the spatial index on this path.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty {Name = "lowerName", Query = @"SELECT LOWER(c.name) FROM c"} }, + Error = @"""Errors"":[""Required VALUE expression missing from computed property query 'SELECT LOWER(c.name) FROM c' at index (0).""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty {Name = "lowerName", Query = @"SELECT LOWER(c.name) FROM r"} }, + Error = @"""Errors"":[""Computed property at index (0) has a malformed query: 'SELECT LOWER(c.name) FROM r' Error details: '{\""errors\"":[{\""severity\"":\""Error\"",\""code\"":2001,\""message\"":\""Identifier 'c' could not be resolved.\""}]}'""]" + }, + }; + + IndexingPolicy indexingPolicy = new IndexingPolicy + { + SpatialIndexes = new Collection + { + new SpatialPath + { + Path = "/spatial/*", + SpatialTypes = new Collection() + { + Cosmos.SpatialType.LineString, + Cosmos.SpatialType.MultiPolygon, + Cosmos.SpatialType.Point, + Cosmos.SpatialType.Polygon, + } + } + } + }; + + // Create + foreach (var variation in variations) + { + ContainerProperties containerProperties = new ContainerProperties(Guid.NewGuid().ToString(), "/users") + { + IndexingPolicy = indexingPolicy, + GeospatialConfig = new GeospatialConfig(GeospatialType.Geography), + ComputedProperties = variation.ComputedProperties + }; + + try + { + ContainerResponse response = await this.database.CreateContainerAsync(containerProperties); + Assert.Fail($@"Computed Property '{variation.ComputedProperties.Last().Name}' Query '{variation.ComputedProperties.Last().Query}' was expected to fail with error '{variation.Error}'."); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.BadRequest) + { + Assert.IsTrue(ce.Message.Contains(variation.Error), $"Message expected to contain:'{variation.Error}'{Environment.NewLine}Actual Message: '{ce.Message}'"); + } + } + + // Replace + Container containerToReplace = await this.database.CreateContainerAsync(new ContainerProperties(Guid.NewGuid().ToString(), "/users")); + foreach (var variation in variations) + { + ContainerProperties containerProperties = new ContainerProperties(Guid.NewGuid().ToString(), "/users") + { + IndexingPolicy = indexingPolicy, + GeospatialConfig = new GeospatialConfig(GeospatialType.Geography), + ComputedProperties = variation.ComputedProperties + }; + + try + { + ContainerResponse response = await containerToReplace.ReplaceContainerAsync(containerProperties); + Assert.Fail($@"Computed Property '{variation.ComputedProperties.Last().Name}' Query '{variation.ComputedProperties.Last().Query}' was expected to fail with error '{variation.Error}'."); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.BadRequest) + { + Assert.IsTrue(ce.Message.Contains(variation.Error), $"Message expected to contain:'{variation.Error}'{Environment.NewLine}Actual Message: '{ce.Message}'"); + } + } } [TestMethod] @@ -230,6 +359,17 @@ public async Task ContainerMigrationTest() SpatialTypes = new Collection() { SpatialType.Point } }); + // List computedProperties = new List + // { + // new ComputedProperty() { Name = "lowerName", Query = "SELECT VALUE LOWER(c.name) FROM c" }, + // new ComputedProperty() { Name = "estimatedTax", Query = "SELECT VALUE c.salary * 0.2 FROM c" } + // }; + + // foreach (ComputedProperty computedProperty in computedProperties) + // { + // containerProperties.ComputedProperties.Add(computedProperty); + // } + ContainerProperties propertiesAfterReplace = await container.ReplaceContainerAsync(containerProperties); Assert.AreEqual(0, propertiesAfterReplace.IndexingPolicy.IncludedPaths.First().Indexes.Count); Assert.AreEqual(1, propertiesAfterReplace.IndexingPolicy.CompositeIndexes.Count); @@ -242,6 +382,8 @@ public async Task ContainerMigrationTest() Assert.AreEqual(1, propertiesAfterReplace.IndexingPolicy.SpatialIndexes.Count); Assert.AreEqual("/address/test/*", propertiesAfterReplace.IndexingPolicy.SpatialIndexes.First().Path); + + ComputedPropertyComparer.AssertAreEqual(containerProperties.ComputedProperties, propertiesAfterReplace.ComputedProperties); } [TestMethod] @@ -449,6 +591,52 @@ await this.database.DefineContainer(containerName, partitionKeyPath) Assert.AreEqual(HttpStatusCode.NoContent, containerResponse.StatusCode); } + [Ignore] + [TestMethod] + public async Task WithComputedProperties() + { + string containerName = Guid.NewGuid().ToString(); + string partitionKeyPath = "/users"; + + var definitions = new[] + { + new { Name = "lowerName", Query = "SELECT VALUE LOWER(c.name) FROM c" }, + new { Name = "estimatedTax", Query = "SELECT VALUE c.salary * 0.2 FROM c" } + }; + ContainerResponse containerResponse = + await this.database.DefineContainer(containerName, partitionKeyPath) + .WithComputedProperties() + .WithComputedProperty(definitions[0].Name, definitions[0].Query) + .WithComputedProperty(definitions[1].Name, definitions[1].Query) + .Attach() + .CreateAsync(); + + Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); + Assert.AreEqual(containerName, containerResponse.Resource.Id); + Assert.AreEqual(partitionKeyPath, containerResponse.Resource.PartitionKey.Paths.First()); + + Assert.AreEqual(2, containerResponse.Resource.ComputedProperties.Count); + Assert.AreEqual(definitions[0].Name, containerResponse.Resource.ComputedProperties[0].Name); + Assert.AreEqual(definitions[0].Query, containerResponse.Resource.ComputedProperties[0].Query); + Assert.AreEqual(definitions[1].Name, containerResponse.Resource.ComputedProperties[1].Name); + Assert.AreEqual(definitions[1].Query, containerResponse.Resource.ComputedProperties[1].Query); + + Container container = containerResponse; + containerResponse = await container.ReadContainerAsync(); + Assert.AreEqual(HttpStatusCode.OK, containerResponse.StatusCode); + Assert.AreEqual(containerName, containerResponse.Resource.Id); + Assert.AreEqual(partitionKeyPath, containerResponse.Resource.PartitionKey.Paths.First()); + + Assert.AreEqual(2, containerResponse.Resource.ComputedProperties.Count); + Assert.AreEqual(definitions[0].Name, containerResponse.Resource.ComputedProperties[0].Name); + Assert.AreEqual(definitions[0].Query, containerResponse.Resource.ComputedProperties[0].Query); + Assert.AreEqual(definitions[1].Name, containerResponse.Resource.ComputedProperties[1].Name); + Assert.AreEqual(definitions[1].Query, containerResponse.Resource.ComputedProperties[1].Query); + + containerResponse = await containerResponse.Container.DeleteContainerAsync(); + Assert.AreEqual(HttpStatusCode.NoContent, containerResponse.StatusCode); + } + [TestMethod] public async Task ThroughputTest() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs index a9782bb26b..3fc3aff900 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs @@ -1272,6 +1272,25 @@ orderby f.FamilyId descending this.ExecuteTestSuite(inputs); } + [TestMethod] + public void TestLambdaReuse() + { + List inputs = new List(); + + System.Linq.Expressions.Expression> predicate = f => f.Int == 5; + inputs.Add(new LinqTestInput("Where -> Where with same predicate instance", b => getQuery(b).Where(predicate).Where(predicate))); + inputs.Add(new LinqTestInput("Where -> Select with same predicate instance", b => getQuery(b).Where(predicate).Select(predicate))); + + System.Linq.Expressions.Expression> predicate2 = f => f.ToString() == "a"; + inputs.Add(new LinqTestInput("Where -> Select -> Where with same predicate instance", + b => getQuery(b) + .Where(predicate2) + .Select(c => new { Int = 10, Result = c }) + .Where(predicate2))); + + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void TestThenByTranslation() { @@ -1922,7 +1941,7 @@ public async Task ValidateLinqQueries() Gender = "female", Grade = 1, Pets = new List() { pet, new Pet() { GivenName = "koko" } }, - Things = new Dictionary() { { "A", "B" }, { "C", "D" } }, + Things = new Dictionary() { { "A", "B" }, { "C", "D" } } }; Address address = new Address { State = "NY", County = "Manhattan", City = "NY" }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 76bd0ffc81..5a46a2d118 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -116,6 +116,7 @@ internal class DataObject : LinqTestObject public int? NullableField; #pragma warning disable CS0649 // Field is never assigned to, and will always have its default value false public bool BooleanField; + public SimpleObject ObjectField = new SimpleObject(); public Guid GuidField; #pragma warning restore // Field is never assigned to, and will always have its default value false @@ -155,6 +156,11 @@ internal class DataObject : LinqTestObject public string Pk; } + internal class SimpleObject + { + public string Field { get; set; } + } + class DateJsonConverter : IsoDateTimeConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) @@ -257,7 +263,7 @@ public void TestLiteralSerialization() [TestMethod] public void TestTypeCheckFunctions() { - // IsDefined, IsNull, and IsPrimitive are not supported on the client side. + // IsArray, IsBool, IsDefined, IsNull, IsNumber, IsObject, IsPrimitive, and IsString are not supported on the client side. // Partly because IsPrimitive is not trivial to implement. // Therefore these methods are verified with baseline only. List data = new List(); @@ -266,12 +272,22 @@ public void TestTypeCheckFunctions() List inputs = new List { + new LinqTestInput("IsArray array", b => getQuery(b).Where(doc => doc.ArrayField.IsArray())), + new LinqTestInput("IsArray string", b => getQuery(b).Where(doc => doc.StringField.IsArray())), + new LinqTestInput("IsBool bool", b => getQuery(b).Where(doc => doc.BooleanField.IsBool())), + new LinqTestInput("IsBool string", b => getQuery(b).Where(doc => doc.StringField.IsBool())), new LinqTestInput("IsDefined array", b => getQuery(b).Select(doc => doc.ArrayField.IsDefined())), new LinqTestInput("IsDefined string", b => getQuery(b).Where(doc => doc.StringField.IsDefined())), new LinqTestInput("IsNull array", b => getQuery(b).Select(doc => doc.ArrayField.IsNull())), new LinqTestInput("IsNull string", b => getQuery(b).Where(doc => doc.StringField.IsNull())), + new LinqTestInput("IsNumber number", b => getQuery(b).Select(doc => doc.NumericField.IsNumber())), + new LinqTestInput("IsNumber string", b => getQuery(b).Where(doc => doc.StringField.IsNumber())), + new LinqTestInput("IsObject object", b => getQuery(b).Select(doc => doc.ObjectField.IsObject())), + new LinqTestInput("IsObject string", b => getQuery(b).Where(doc => doc.StringField.IsObject())), new LinqTestInput("IsPrimitive array", b => getQuery(b).Select(doc => doc.ArrayField.IsPrimitive())), - new LinqTestInput("IsPrimitive string", b => getQuery(b).Where(doc => doc.StringField.IsPrimitive())) + new LinqTestInput("IsPrimitive string", b => getQuery(b).Where(doc => doc.StringField.IsPrimitive())), + new LinqTestInput("IsString string", b => getQuery(b).Where(doc => doc.StringField.IsString())), + new LinqTestInput("IsString number", b => getQuery(b).Select(doc => doc.NumericField.IsString())), }; this.ExecuteTestSuite(inputs); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index a504adc855..51891d7e3f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -35,6 +35,7 @@ + @@ -283,6 +284,11 @@ + + + PreserveNewest + + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs index a0c821c72d..4db276f4ce 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs @@ -1,5 +1,6 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Query { + using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -14,9 +15,28 @@ public sealed class BypassQueryParsingTests : QueryTestsBase public async Task TestBypassQueryParsingWithNonePartitionKey() { int documentCount = 400; - QueryRequestOptions feedOptions = new QueryRequestOptions { PartitionKey = PartitionKey.None }; + string query = "SELECT VALUE r.numberField FROM r"; - IReadOnlyList expected = Enumerable.Range(0, documentCount).ToList(); + IReadOnlyList expectedOutput = Enumerable.Range(0, documentCount).Select(i => i.ToString()).ToList(); + + await this.ValidateQueryBypassWithNonePartitionKey(documentCount, query, expectedOutput); + } + + [TestMethod] + [TestCategory("Query")] + public async Task TestBypassQueryParsingWithNonePartitionKeyEmptyPropertyName() + { + int documentCount = 400; + + string query = @"SELECT VALUE { """" : r.numberField } FROM r"; + IReadOnlyList expectedOutput = Enumerable.Range(0, documentCount).Select(i => String.Format("{{\"\":{0}}}", i)).ToList(); + + await this.ValidateQueryBypassWithNonePartitionKey(documentCount, query, expectedOutput); + } + + private async Task ValidateQueryBypassWithNonePartitionKey(int documentCount, string query, IReadOnlyList expectedOutput) + { + QueryRequestOptions feedOptions = new QueryRequestOptions { PartitionKey = PartitionKey.None }; async Task ImplementationAsync(Container container, IReadOnlyList documents) { @@ -34,9 +54,9 @@ async Task ImplementationAsync(Container container, IReadOnlyList cosmosQueryClientCore); List items = await RunQueryAsync(containerWithBypassParsing, query, feedOptions); - int[] actual = items.Cast().Select(x => (int)Number64.ToLong(x.Value)).ToArray(); + string[] actualOutput = items.Select(x => x.ToString()).ToArray(); - Assert.IsTrue(expected.SequenceEqual(actual)); + Assert.IsTrue(expectedOutput.SequenceEqual(actualOutput)); } IReadOnlyList documents = CreateDocuments(documentCount); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs index ee6eec3004..6dd861ec88 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs @@ -35,7 +35,7 @@ public MockCosmosQueryClient( public int QueryPlanCalls { get; private set; } - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return this.forceQueryPlanGatewayElseServiceInterop; } @@ -68,12 +68,11 @@ public override Task> ExecuteItemQueryAsync( string resourceUri, ResourceType resourceType, OperationType operationType, - Guid clientQueryCorrelationId, FeedRange feedRange, QueryRequestOptions requestOptions, + AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, - bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken) @@ -82,12 +81,11 @@ public override Task> ExecuteItemQueryAsync( resourceUri: resourceUri, resourceType: resourceType, operationType: operationType, - clientQueryCorrelationId: clientQueryCorrelationId, + feedRange: feedRange, requestOptions: requestOptions, + additionalRequestHeaders: additionalRequestHeaders, sqlQuerySpec: sqlQuerySpec, continuationToken: continuationToken, - feedRange: feedRange, - isContinuationExpected: isContinuationExpected, pageSize: pageSize, trace: trace, cancellationToken: cancellationToken); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs index cc9ef91733..78d4ddb8ed 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs @@ -20,7 +20,8 @@ public sealed class OptimisticDirectExecutionQueryTests : QueryTestsBase private static class PageSizeOptions { - public static readonly int[] NonGroupByPageSizeOptions = { -1, 1, 2, 10, 100 }; + public static readonly int[] NonGroupByAndNoContinuationTokenPageSizeOptions = { -1, 10 }; + public static readonly int[] NonGroupByWithContinuationTokenPageSizeOptions = { 1, 2 }; public static readonly int[] GroupByPageSizeOptions = { -1 }; public static readonly int[] PageSize100 = { 100 }; } @@ -42,49 +43,98 @@ public async Task TestPassingOptimisticDirectExecutionQueries() expectedResult: first5Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{PartitionKeyField}", expectedResult: first5Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: false, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), - // Simple query + // Simple query (requiresDist = false) CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - - // DISTINCT with ORDER BY + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // DISTINCT with ORDER BY (requiresDist = true) CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), - // TOP with GROUP BY + // DISTINCT (requiresDist = true) + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + // TOP with GROUP BY (requiresDist = true) CreateInput( query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r GROUP BY r.{NumberField}", expectedResult: first5Integers, @@ -99,72 +149,267 @@ public async Task TestPassingOptimisticDirectExecutionQueries() enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - - // OFFSET LIMIT with WHERE and BETWEEN + + // TOP (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // TOP with ORDER BY (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // OFFSET LIMIT with WHERE and BETWEEN (requiresDist = false) + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: partitionKeyValue, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + enableOptimisticDirectExecution: true, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: partitionKeyValue, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + enableOptimisticDirectExecution: true, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: null, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution) - }; - + }; + List multiPartitionContainerTestCases = new List() { - // Simple query + // Simple query (requiresDist = false) CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), - // DISTINCT with ORDER BY + // DISTINCT with ORDER BY (requiresDist = true) CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // TOP (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // TOP with ORDER BY (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized), - // OFFSET LIMIT with WHERE and BETWEEN + // OFFSET LIMIT with WHERE and BETWEEN (requiresDist = false) CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized) }; @@ -222,27 +467,34 @@ public async Task TestQueriesWithPartitionKeyNone() enableOptimisticDirectExecution: false, pageSizeOptions: PageSizeOptions.PageSize100, expectedPipelineType: TestInjections.PipelineType.Passthrough), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first400Integers, partitionKey: PartitionKey.None, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.PageSize100, - expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + expectedPipelineType: TestInjections.PipelineType.Specialized), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 CreateInput( query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} ASC", expectedResult: first400Integers, partitionKey: PartitionKey.None, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.PageSize100, - expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + expectedPipelineType: TestInjections.PipelineType.Specialized), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 CreateInput( query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first400IntegersReversed, partitionKey: PartitionKey.None, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.PageSize100, - expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, @@ -279,7 +531,7 @@ public async Task TestFailingOptimisticDirectExecutionOutput() { "SELECT TOP 10 * FOM r", null }, { "this is not a valid query", null }, }; - + await this.CreateIngestQueryDeleteAsync( ConnectionModes.Direct | ConnectionModes.Gateway, CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index f4983c10a7..75153d3b88 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -4,9 +4,11 @@ namespace Microsoft.Azure.Cosmos.Tracing { + using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; + using global::Azure; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -14,22 +16,22 @@ namespace Microsoft.Azure.Cosmos.Tracing internal static class AssertActivity { - public static void IsValid(Activity activity) + public static void IsValidOperationActivity(Activity activity) { - Assert.IsTrue(activity.OperationName == activity.DisplayName); + if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase)) + { + Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is empty for {activity.OperationName}"); - Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is emtpy for {activity.OperationName}"); + if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) + { + Assert.AreEqual(ActivityKind.Internal, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Internal} for {activity.OperationName}"); + } + else if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Direct.ToString()) + { + Assert.AreEqual(ActivityKind.Client, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Client} for {activity.OperationName}"); + } - if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) - { - Assert.AreEqual(ActivityKind.Internal, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Internal} for {activity.OperationName}"); - } - else if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Direct.ToString()) - { - Assert.AreEqual(ActivityKind.Client, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Client} for {activity.OperationName}"); - } - - IList expectedTags = new List + IList expectedTags = new List { "az.namespace", "az.schema_url", @@ -60,18 +62,19 @@ public static void IsValid(Activity activity) "db.cosmosdb.correlated_activity_id" }; - foreach (KeyValuePair actualTag in activity.Tags) - { - Assert.IsTrue(expectedTags.Contains(actualTag.Key), $"{actualTag.Key} is not allowed for {activity.OperationName}"); + foreach (KeyValuePair actualTag in activity.Tags) + { + Assert.IsTrue(expectedTags.Contains(actualTag.Key), $"{actualTag.Key} is not allowed for {activity.OperationName}"); - AssertActivity.AssertDatabaseAndContainerName(activity.OperationName, actualTag); + AssertActivity.AssertDatabaseAndContainerName(activity.OperationName, actualTag); + } } } public static void AreEqualAcrossListeners() { Assert.AreEqual( - JsonConvert.SerializeObject(CustomListener.CollectedActivities.OrderBy(x => x.Id)), + JsonConvert.SerializeObject(CustomListener.CollectedOperationActivities.OrderBy(x => x.Id)), JsonConvert.SerializeObject(CustomOtelExporter.CollectedActivities.OrderBy(x => x.Id))); } @@ -79,11 +82,11 @@ private static void AssertDatabaseAndContainerName(string name, KeyValuePair exceptionsForContainerAttribute = new List { - "Operation.CreateDatabaseAsync", - "Operation.CreateDatabaseIfNotExistsAsync", - "Operation.ReadAsync", - "Operation.DeleteAsync", - "Operation.DeleteStreamAsync" + "CreateDatabaseAsync", + "CreateDatabaseIfNotExistsAsync", + "ReadAsync", + "DeleteAsync", + "DeleteStreamAsync" }; if ((tag.Key == OpenTelemetryAttributeKeys.ContainerName && !exceptionsForContainerAttribute.Contains(name)) || diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 5f98a6191a..cae05fa94d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -30,30 +30,26 @@ internal class CustomListener : private ConcurrentBag subscriptions = new(); private ConcurrentBag Scopes { get; } = new(); - public static ConcurrentBag CollectedActivities { private set; get; } = new(); + public static ConcurrentBag CollectedOperationActivities { private set; get; } = new(); + public static ConcurrentBag CollectedNetworkActivities { private set; get; } = new(); private static ConcurrentBag CollectedEvents { set; get; } = new(); - private string SourceType { set; get; } + private static List EventSources { set; get; } = new(); - // Regex is used to match string 'n' against diagnosticNameSpace string - // which is constructed by combining first two parts of name. - // Eg: Azure.Cosmos.Operation where diagnosticNameSpace is Azure.Cosmos and Operation is the sourceType public CustomListener(string name, string eventName) - : this(n => - { - string[] nameParts = name.Split("."); - string diagnosticNameSpace = $"{nameParts[0]}.{nameParts[1]}"; - return Regex.Match(n, diagnosticNameSpace).Success; - }, name.Split(".")[2], eventName) - + : this(n => Regex.Match(n, name).Success, eventName) { } - public CustomListener(Func filter, string sourceType, string eventName) + public CustomListener(Func filter, string eventName) { this.sourceNameFilter = filter; this.eventName = eventName; - this.SourceType = sourceType; + + foreach (EventSource eventSource in EventSources) + { + this.OnEventSourceCreated(eventSource); + } DiagnosticListener.AllListeners.Subscribe(this); } @@ -87,12 +83,7 @@ public void OnNext(KeyValuePair value) string startSuffix = ".Start"; string stopSuffix = ".Stop"; string exceptionSuffix = ".Exception"; - - if(!this.SourceType.Contains("*") && !Activity.Current.OperationName.Contains(this.SourceType)) - { - return; - } - + if (value.Key.EndsWith(startSuffix)) { string name = value.Key[..^startSuffix.Length]; @@ -115,9 +106,16 @@ public void OnNext(KeyValuePair value) { if (producedDiagnosticScope.Activity.Id == Activity.Current.Id) { - AssertActivity.IsValid(producedDiagnosticScope.Activity); - CustomListener.CollectedActivities.Add(producedDiagnosticScope.Activity); - + if (producedDiagnosticScope.Activity.Source.Name.EndsWith("Operation")) + { + AssertActivity.IsValidOperationActivity(producedDiagnosticScope.Activity); + CustomListener.CollectedOperationActivities.Add(producedDiagnosticScope.Activity); + } + else if (producedDiagnosticScope.Activity.Source.Name.EndsWith("Request")) + { + CustomListener.CollectedNetworkActivities.Add(producedDiagnosticScope.Activity); + } + producedDiagnosticScope.IsCompleted = true; return; } @@ -161,6 +159,11 @@ public void OnNext(DiagnosticListener value) /// protected override void OnEventSourceCreated(EventSource eventSource) { + if(this.eventName == null) + { + EventSources.Add(eventSource); + } + if (eventSource != null && eventSource.Name.Equals(this.eventName)) { this.EnableEvents(eventSource, EventLevel.Informational); // Enable information level events @@ -173,13 +176,8 @@ protected override void OnEventSourceCreated(EventSource eventSource) protected override void OnEventWritten(EventWrittenEventArgs eventData) { StringBuilder builder = new StringBuilder(); - builder.Append("") - .Append("").Append(eventData.EventName).Append("") - .Append("Ideally, this should contain request diagnostics but request diagnostics is " + - "subject to change with each request as it contains few unique id. " + - "So just putting this tag with this static text to make sure event is getting generated" + - " for each test.") - .Append(""); + builder.Append($""); + CustomListener.CollectedEvents.Add(builder.ToString()); } @@ -238,35 +236,34 @@ private string GenerateTagForBaselineTest(Activity activity) { List tagsWithStaticValue = new List { + "az.schema_url", "kind", "az.namespace", "db.operation", "db.system", "net.peer.name", + "db.name", + "db.cosmosdb.container", "db.cosmosdb.connection_mode", "db.cosmosdb.operation_type", - "db.cosmosdb.regions_contacted" + "db.cosmosdb.regions_contacted", + "tcp.sub_status_code", + "tcp.status_code" }; StringBuilder builder = new StringBuilder(); - builder.Append("") - .Append("") - .Append(activity.OperationName) - .Append(""); - + builder.Append($""); foreach (KeyValuePair tag in activity.Tags) { - builder - .Append("") - .Append(tag.Key) - .Append(""); - if (tagsWithStaticValue.Contains(tag.Key)) { builder - .Append("") - .Append(tag.Value) - .Append(""); + .Append($"{tag.Value}"); + } + else + { + builder + .Append($"Some Value"); } } @@ -278,15 +275,26 @@ private string GenerateTagForBaselineTest(Activity activity) public List GetRecordedAttributes() { List generatedActivityTagsForBaselineXmls = new(); - List collectedActivities = new List(CustomListener.CollectedActivities); - - collectedActivities.OrderBy(act => act.OperationName); - foreach (Activity activity in collectedActivities) + List collectedOperationActivities = new List(CustomListener.CollectedOperationActivities); + foreach (Activity activity in collectedOperationActivities) { generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); } - + + HashSet collectedNetworkActivities = new HashSet(CustomListener.CollectedNetworkActivities, new NetworkActivityComparer()); + List orderedUniqueNetworkActivities = collectedNetworkActivities + .OrderBy(act => + act.Source.Name + + act.OperationName + + act.GetTagItem("tcp.status_code") + + act.GetTagItem("tcp.sub_status_code")) + .ToList(); + foreach (Activity activity in orderedUniqueNetworkActivities) + { + generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); + } + List outputList = new List(); if(generatedActivityTagsForBaselineXmls != null && generatedActivityTagsForBaselineXmls.Count > 0) { @@ -304,7 +312,8 @@ public List GetRecordedAttributes() public void ResetAttributes() { CustomListener.CollectedEvents = new(); - CustomListener.CollectedActivities = new(); + CustomListener.CollectedOperationActivities = new(); + CustomListener.CollectedNetworkActivities = new(); } public class ProducedDiagnosticScope @@ -340,5 +349,22 @@ public ProducedLink(string traceparent, string tracestate) public string Traceparent { get; set; } public string Tracestate { get; set; } } + + public class NetworkActivityComparer : IEqualityComparer + { + public bool Equals(Activity x, Activity y) + { + string xData = x.Source.Name + x.OperationName + x.GetTagItem("tcp.status_code") + x.GetTagItem("tcp.sub_status_code"); + string yData = y.Source.Name + y.OperationName + y.GetTagItem("tcp.status_code") + y.GetTagItem("tcp.sub_status_code"); + + return xData.Equals(yData, StringComparison.OrdinalIgnoreCase); + } + + public int GetHashCode(Activity obj) + { + return (obj.Source.Name + obj.OperationName + obj.GetTagItem("tcp.status_code") + obj.GetTagItem("tcp.sub_status_code")).GetHashCode() ; + } + } + } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs index 1f6c335fdd..eb46d83e48 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.Tracing using System; using System.Collections.Generic; using System.Diagnostics; + using Microsoft.Azure.Cosmos.Telemetry; using OpenTelemetry; using OpenTelemetry.Trace; @@ -18,11 +19,12 @@ internal class CustomOtelExporter : BaseExporter { private readonly string _name; - public static List CollectedActivities = new List(); + public static List CollectedActivities; public CustomOtelExporter(string name = "CustomOtelExporter") { this._name = name; + CollectedActivities = new List(); } public override ExportResult Export(in Batch batch) @@ -33,9 +35,12 @@ public override ExportResult Export(in Batch batch) foreach (Activity activity in batch) { - AssertActivity.IsValid(activity); - - CollectedActivities.Add(activity); + if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase)) + { + AssertActivity.IsValidOperationActivity(activity); + + CollectedActivities.Add(activity); + } } return ExportResult.Success; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index ba7e828edf..64bc7c015a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using System.Threading; using System.Threading.Tasks; using System.Xml; + using System.Xml.Linq; using global::Azure; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Diagnostics; @@ -70,11 +71,11 @@ public static async Task ClassInitAsync(TestContext context) })); EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync( - Guid.NewGuid().ToString(), + "databaseName", cancellationToken: default); EndToEndTraceWriterBaselineTests.container = await EndToEndTraceWriterBaselineTests.database.CreateContainerAsync( - id: Guid.NewGuid().ToString(), + id: "containerName", partitionKeyPath: "/id", throughput: 20000); @@ -400,7 +401,7 @@ public async Task ChangeFeedAsync() //---------------------------------------------------------------- { Container leaseContainer = await EndToEndTraceWriterBaselineTests.database.CreateContainerAsync( - id: Guid.NewGuid().ToString(), + id: "changefeedleasecontainer", partitionKeyPath: "/id"); ChangeFeedProcessor processor = container @@ -1346,7 +1347,7 @@ public async Task MiscellanousAsync() { startLineNumber = GetLineNumber(); - DatabaseResponse databaseResponse = await miscCosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); + DatabaseResponse databaseResponse = await miscCosmosClient.CreateDatabaseAsync("miscdbcustonhandler"); EndToEndTraceWriterBaselineTests.AssertCustomHandlerTime( databaseResponse.Diagnostics.ToString(), requestHandler.FullHandlerName, @@ -1369,7 +1370,7 @@ public async Task MiscellanousAsync() startLineNumber = GetLineNumber(); RequestOptions requestOptions = new RequestOptions(); DatabaseResponse databaseResponse = await client.CreateDatabaseAsync( - id: Guid.NewGuid().ToString(), + id: "miscdbdataplane", requestOptions: requestOptions); ITrace trace = ((CosmosTraceDiagnostics)databaseResponse.Diagnostics).Value; await databaseResponse.Database.DeleteAsync(); @@ -1452,10 +1453,12 @@ public override Output ExecuteTest(Input input) StringBuilder oTelActivitiesString = new StringBuilder(); if (input.OTelActivities != null && input.OTelActivities.Count > 0) { + oTelActivitiesString.Append(""); foreach (string attributes in input.OTelActivities) { oTelActivitiesString.AppendLine(attributes); } + oTelActivitiesString.Append(""); } AssertTraceProperites(input.Trace); @@ -1464,9 +1467,23 @@ public override Output ExecuteTest(Input input) Assert.IsTrue(text.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {text}"); Assert.IsTrue(json.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {json}"); - return new Output(text, JToken.Parse(json).ToString(Newtonsoft.Json.Formatting.Indented), oTelActivitiesString.ToString()); + return new Output(text, JToken.Parse(json).ToString(Newtonsoft.Json.Formatting.Indented), this.FormatXml(oTelActivitiesString.ToString())); } + private string FormatXml(string xml) + { + try + { + XDocument doc = XDocument.Parse(xml); + return doc.ToString(); + } + catch (Exception) + { + // Handle and throw if fatal exception here; don't just ignore them + return xml; + } + } + private static TraceForBaselineTesting CreateTraceForBaslineTesting(ITrace trace, TraceForBaselineTesting parent) { TraceForBaselineTesting convertedTrace = new TraceForBaselineTesting(trace.Name, trace.Level, trace.Component, parent); @@ -1650,9 +1667,7 @@ public override void SerializeAsXml(XmlWriter xmlWriter) if (!string.IsNullOrWhiteSpace(this.OTelActivities)) { - xmlWriter.WriteStartElement(nameof(this.OTelActivities)); xmlWriter.WriteRaw(this.OTelActivities); - xmlWriter.WriteEndElement(); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 59172beb33..366cc68811 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -548,11 +548,11 @@ internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() // Open Telemetry Listener Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() // use any exporter here - .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation") // Right now, it will capture only "Azure.Cosmos.Operation" + .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*") .Build(); // Custom Listener - Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", "Azure-Cosmos-Operation-Request-Diagnostics"); + Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics"); return Util.TestListener; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs index bcf95ba776..0d3d2ffd81 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs @@ -42,7 +42,7 @@ private ITrace CreateTestTraceTree() private TraceDatum GetDatumObject(string regionName1, string regionName2 = null) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(RegionContactedInDiagnosticsBenchmark))); Uri uri1 = new Uri("http://someUri1.com"); datum.RegionsContacted.Add((regionName1, uri1)); if (regionName2 != null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json index c97e0b5b2c..a06dabf09c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json @@ -14,7 +14,7 @@ "MockedItemBenchmark.DeleteItemNotExists;[Type=OfT]": 42172.5, "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTCustom]": 42174.75, "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 42166.5, - "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithDiagnosticsToString]": 56695.5, + "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithDiagnosticsToString]": 63338, "MockedItemBenchmark.DeleteItemNotExists;[Type=Stream]": 37610, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfT]": 13342232, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfTCustom]": 13341058, @@ -34,12 +34,12 @@ "MockedItemBenchmark.ReadItemExists;[Type=OfT]": 33630.5, "MockedItemBenchmark.ReadItemExists;[Type=OfTCustom]": 33636.25, "MockedItemBenchmark.ReadItemExists;[Type=OfTWithClientTelemetryEnabled]": 33627.75, - "MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 47961.25, + "MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 55044, "MockedItemBenchmark.ReadItemExists;[Type=Stream]": 26018.25, "MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 43489.25, "MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 43490, "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 43489.25, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 57420.25, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 58054, "MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 39044, "MockedItemBenchmark.UpdateItem;[Type=OfT]": 36591, "MockedItemBenchmark.UpdateItem;[Type=OfTCustom]": 36594.25, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml index 5e496fc564..a5e6d97841 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml @@ -66,20 +66,7 @@ - Null Partition Key Value - SELECT * FROM c - - /pk - - Hash - - - true - - - - - None Partition Key Value + Cosmos.PartitionKey.Null Partition Key Value SELECT * FROM c /pk diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index d3b996a0e9..d1dee72a0f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -187,7 +187,7 @@ TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TransportAddressUri uri1 = new TransportAddressUri(new Uri("http://someUri1.com")); TransportAddressUri uri2 = new TransportAddressUri(new Uri("http://someUri2.com")); @@ -340,6 +340,12 @@ "RequestCharge": 3.14, "RetryAfterInMs": "9000", "BELatencyInMs": "4.2", + "ReplicaHealthStatuses": [ + "http://storephysicaladdress-1p.com:Connected", + "http://storephysicaladdress-2s.com:Unknown", + "http://storephysicaladdress-3s.com:Unhealthy", + "http://storephysicaladdress-4s.com:Unknown" + ], "transportRequestTimeline": { "requestTimeline": [ { @@ -405,7 +411,7 @@ TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); datum.ContactedReplicas.Add(default); TraceWriterBaselineTests.GetPrivateField>(datum, "endpointToAddressResolutionStats").Add("asdf", default); @@ -529,6 +535,7 @@ "RequestCharge": 0, "RetryAfterInMs": null, "BELatencyInMs": null, + "ReplicaHealthStatuses": [], "transportRequestTimeline": null, "TransportException": null } @@ -546,7 +553,7 @@ TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TraceWriterBaselineTests.SetEndRequestTime(datum,DateTime.MaxValue); HttpResponseStatistics httpResponseStatistics = new HttpResponseStatistics( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 8a3d326d50..8546a93b2f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -169,16 +169,6 @@ "Type": "Method", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -253,6 +243,59 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.ComputedProperty;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.String get_Name()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Name();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_Query()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Query();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Name[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"name\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Name;CanRead:True;CanWrite:True;System.String get_Name();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Name(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Query[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"query\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Query;CanRead:True;CanWrite:True;System.String get_Query();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Query(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_Name(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Name(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_Query(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Query(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Container;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -284,10 +327,27 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedPolicy get_ChangeFeedPolicy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] ComputedProperties[Newtonsoft.Json.JsonIgnoreAttribute()]": { + "Type": "Property", + "Attributes": [ + "JsonIgnoreAttribute" + ], + "MethodInfo": "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] ComputedProperties;CanRead:True;CanWrite:True;System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] get_ComputedProperties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_ComputedProperties(System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] get_ComputedProperties()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] get_ComputedProperties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy)": { "Type": "Method", "Attributes": [], "MethodInfo": "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_ComputedProperties(System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty])": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Void set_ComputedProperties(System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -317,6 +377,31 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.Nullable`1[System.Boolean] BypassIntegratedCache": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Nullable`1[System.Boolean] BypassIntegratedCache;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_BypassIntegratedCache();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Boolean] get_BypassIntegratedCache()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Nullable`1[System.Boolean] get_BypassIntegratedCache();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.ChangeFeedPolicyDefinition;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -328,6 +413,22 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:True;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperty(System.String, System.String)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperty(System.String, System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "T Attach()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "T Attach();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.ContainerBuilder;Microsoft.Azure.Cosmos.Fluent.ContainerDefinition`1[[Microsoft.Azure.Cosmos.Fluent.ContainerBuilder, ]];IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -339,6 +440,17 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.Fluent.ContainerDefinition`1;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:True;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperties()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -384,8 +496,59 @@ }, "NestedTypes": {} }, - "Microsoft.Azure.Cosmos.RequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, + "Members": { + "Boolean EnableOptimisticDirectExecution": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.RequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": { + "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Boolean EnableOptimisticDirectExecution": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + } + }, "Members": { "System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] get_PriorityLevel()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 3eee7f406b..7fde376d49 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -307,10 +307,20 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_Incremental();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.ChangeFeedMode Incremental": { "Type": "Property", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode Incremental;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_Incremental();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -5296,6 +5306,20 @@ "Microsoft.Azure.Cosmos.Linq.CosmosLinqExtensions;System.Object;IsAbstract:True;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { + "Boolean IsArray(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsArray(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean IsBool(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsBool(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Boolean IsDefined(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ @@ -5310,6 +5334,20 @@ ], "MethodInfo": "Boolean IsNull(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Boolean IsNumber(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsNumber(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean IsObject(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsObject(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Boolean IsPrimitive(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ @@ -5317,6 +5355,13 @@ ], "MethodInfo": "Boolean IsPrimitive(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Boolean IsString(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsString(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.FeedIterator ToStreamIterator[T](System.Linq.IQueryable`1[T])[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ @@ -6635,6 +6680,16 @@ "Attributes": [], "MethodInfo": "System.String GermanyWestCentral;IsInitOnly:False;IsStatic:True;" }, + "System.String IsraelCentral": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String IsraelCentral;IsInitOnly:False;IsStatic:True;" + }, + "System.String ItalyNorth": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String ItalyNorth;IsInitOnly:False;IsStatic:True;" + }, "System.String JapanEast": { "Type": "Field", "Attributes": [], @@ -6665,6 +6720,11 @@ "Attributes": [], "MethodInfo": "System.String KoreaSouth;IsInitOnly:False;IsStatic:True;" }, + "System.String MalaysiaSouth": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String MalaysiaSouth;IsInitOnly:False;IsStatic:True;" + }, "System.String NorthCentralUS": { "Type": "Field", "Attributes": [], diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs index 865bb71d18..bda132d6a3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs @@ -33,6 +33,9 @@ public void DefaultIncludesPopulated() Cosmos.IncludedPath defaultEntry = containerSettings.IndexingPolicy.IncludedPaths[0]; Assert.AreEqual(Cosmos.IndexingPolicy.DefaultPath, defaultEntry.Path); Assert.AreEqual(0, defaultEntry.Indexes.Count); + + Assert.IsNotNull(containerSettings.ComputedProperties); + Assert.AreEqual(0, containerSettings.ComputedProperties.Count); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 0d475ca370..03fdb84ead 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -42,14 +42,17 @@ static Task sendFunc(HttpRequestMessage request, Cancellati HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost")); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => - new ValueTask(httpRequestMessage), - ResourceType.Collection, - timeoutPolicy: HttpTimeoutPolicyDefault.Instance, - new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow,new TraceSummary()), - default); - - Assert.AreEqual(httpRequestMessage, responseMessage.RequestMessage); + using (ITrace trace = Trace.GetRootTrace(nameof(ResponseMessageHasRequestMessageAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + new ValueTask(httpRequestMessage), + ResourceType.Collection, + timeoutPolicy: HttpTimeoutPolicyDefault.Instance, + new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), + default); + + Assert.AreEqual(httpRequestMessage, responseMessage.RequestMessage); + } } [TestMethod] @@ -111,15 +114,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(RetryTransientIssuesTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: currentTimeoutPolicy.Key, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); - Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + } } } @@ -178,15 +184,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(RetryTransient408sTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); - Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + } } [TestMethod] @@ -216,15 +225,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(DoesNotRetryTransient408sOnDefaultPolicyTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyControlPlaneRead.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); - - Assert.AreEqual(HttpStatusCode.RequestTimeout, responseMessage.StatusCode, "Should be a request timeout"); + + Assert.AreEqual(HttpStatusCode.RequestTimeout, responseMessage.StatusCode, "Should be a request timeout"); + } } [TestMethod] @@ -245,13 +257,16 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio try { - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(Retry3TimesOnDefaultPolicyTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyDefault.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); + } } catch (Exception ex) { @@ -282,14 +297,16 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio try { - - HttpResponseMessage responseMessage1 = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(NoRetryOnNoRetryPolicyTestAsync))) + { + HttpResponseMessage responseMessage1 = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(method, new Uri("http://localhost"))), resourceType: resourceType, timeoutPolicy: timeoutPolicy, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); + } } catch (Exception e) { @@ -301,6 +318,9 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio CosmosException cosmosException = (CosmosException)e; Assert.AreEqual(cosmosException.StatusCode, System.Net.HttpStatusCode.ServiceUnavailable); Assert.AreEqual((int)cosmosException.SubStatusCode,(int)SubStatusCodes.TransportGenerated503); + + Assert.IsNotNull(cosmosException.Trace); + Assert.AreNotEqual(cosmosException.Trace, NoOpTrace.Singleton); } } @@ -344,13 +364,16 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio try { - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(NoRetryOnNoRetryPolicyTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyNoRetry.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); + } } catch (Exception ex) { @@ -401,15 +424,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => - new ValueTask( - result: new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost"))), - resourceType: ResourceType.Document, - timeoutPolicy: HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), - cancellationToken: default); + using (ITrace trace = Trace.GetRootTrace(nameof(RetryTransientIssuesForQueryPlanTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + new ValueTask( + result: new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost"))), + resourceType: ResourceType.Document, + timeoutPolicy: HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), + cancellationToken: default); - Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs index 58361f89bb..d94aed92a4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs @@ -251,6 +251,56 @@ await containerFluentDefinitionForCreate It.IsAny()), Times.Once); } + [Ignore] + [TestMethod] + public async Task WithComputedProperties() + { + Mock mockContainerResponse = new Mock(MockBehavior.Strict); + Mock mockDatabase = new Mock(MockBehavior.Strict); + Mock mockClient = new Mock(MockBehavior.Strict); + mockDatabase.Setup(m => m.Client).Returns(mockClient.Object); + mockDatabase + .Setup(c => c.CreateContainerAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())) + .ReturnsAsync(mockContainerResponse.Object); + mockDatabase + .Setup(c => c.Id) + .Returns(Guid.NewGuid().ToString()); + + ContainerBuilder containerFluentDefinitionForCreate = new ContainerBuilder( + mockDatabase.Object, + containerName, + partitionKey); + + var definitions = new[] + { + new { Name = "lowerName", Query = "SELECT VALUE LOWER(c.name) FROM c" }, + new { Name = "estimatedTax", Query = "SELECT VALUE c.salary * 0.2 FROM c" } + }; + await containerFluentDefinitionForCreate + .WithComputedProperties() + .WithComputedProperty(definitions[0].Name, definitions[0].Query) + .WithComputedProperty(definitions[1].Name, definitions[1].Query) + .Attach() + .CreateAsync(); + + mockDatabase.Verify(c => c.CreateContainerAsync( + It.Is((settings) => + settings.ComputedProperties.Count == 2 && + definitions[0].Name.Equals(settings.ComputedProperties[0].Name) && + definitions[0].Query.Equals(settings.ComputedProperties[0].Query) && + definitions[1].Name.Equals(settings.ComputedProperties[1].Name) && + definitions[1].Query.Equals(settings.ComputedProperties[1].Query) + ), + It.IsAny(), + It.IsAny(), + It.IsAny()), + Times.Once); + } + [TestMethod] public async Task WithUniqueKey() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs index 2fc8359f68..cf54b12a52 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs @@ -57,15 +57,20 @@ public async Task DocumentClient_BuildHttpClientFactory_WithHandler() receivedResponseEventArgs: null); Assert.IsNotNull(httpClient); - HttpResponseMessage response = await httpClient.GetAsync( - uri: new Uri("https://localhost"), - additionalHeaders: new RequestNameValueCollection(), - resourceType: ResourceType.Document, - timeoutPolicy: HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), - cancellationToken: default); - - Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode); + + using (ITrace trace = Trace.GetRootTrace(nameof(DocumentClient_BuildHttpClientFactory_WithHandler))) + { + IClientSideRequestStatistics stats = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); + HttpResponseMessage response = await httpClient.GetAsync( + uri: new Uri("https://localhost"), + additionalHeaders: new RequestNameValueCollection(), + resourceType: ResourceType.Document, + timeoutPolicy: HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, + clientSideRequestStatistics: stats, + cancellationToken: default); + + Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 2d0d0a5c6a..5116eb22de 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -971,6 +971,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat expected: TransportAddressHealthState.HealthStatus.Connected, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 0, + numberOfUnknownReplicas: 4, + numberOfUnhealthyPendingReplicas: 0, + numberOfUnhealthyReplicas: 0); + Assert.AreEqual(4, addressInfo.AllAddresses.Count); Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); @@ -1008,6 +1015,14 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); mockHttpHandler.VerifyAll(); + + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 2, + numberOfUnknownReplicas: 1, + numberOfUnhealthyPendingReplicas: 1, + numberOfUnhealthyReplicas: 0); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 0, @@ -1106,6 +1121,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr manualResetEvent: manualResetEvent, shouldReset: true); + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 0, + numberOfUnknownReplicas: 4, + numberOfUnhealthyPendingReplicas: 0, + numberOfUnhealthyReplicas: 0); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 0, @@ -1157,6 +1179,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr expected: TransportAddressHealthState.HealthStatus.Unhealthy, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 2, + numberOfUnknownReplicas: 1, + numberOfUnhealthyPendingReplicas: 1, + numberOfUnhealthyReplicas: 0); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 1, @@ -1356,6 +1385,41 @@ private static void AssertOpenConnectionHandlerAttributes( Assert.AreEqual(expectedTotalSuccessAddressesToOpenCount, fakeOpenConnectionHandler.GetTotalSuccessfulInvocationCount()); } + /// + /// Helper method to validate and assert on the cached health states for diagnostics. + /// + /// An instance of containing the partition address information. + /// An integer containing the number of connected replicas to be validated inthe cached health status list. + /// An integer containing the number of unknown replicas to be validated inthe cached health status list. + /// An integer containing the number of unhealthy pending replicas to be validated inthe cached health status list. + /// An integer containing the number of unhealthy replicas to be validated inthe cached health status list. + private static void ValidateHealthStatesInDiagnostics( + PartitionAddressInformation addressInfo, + int numberOfConnectedReplicas, + int numberOfUnknownReplicas, + int numberOfUnhealthyPendingReplicas, + int numberOfUnhealthyReplicas) + { + IReadOnlyList replicaHealthStatuses = addressInfo.Get(Protocol.Tcp)?.ReplicaTransportAddressUrisHealthState; + + Assert.IsNotNull(replicaHealthStatuses); + Assert.AreEqual( + expected: numberOfConnectedReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: Connected |")).Count()); + + Assert.AreEqual( + expected: numberOfUnknownReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: Unknown |")).Count()); + + Assert.AreEqual( + expected: numberOfUnhealthyPendingReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: UnhealthyPending |")).Count()); + + Assert.AreEqual( + expected: numberOfUnhealthyReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: Unhealthy |")).Count()); + } + private class FakeMessageHandler : HttpMessageHandler { private bool returnFullReplicaSet; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs index 36b350a751..e16f176e61 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs @@ -865,21 +865,26 @@ public async Task GatewayStatsDurationTest() HttpMessageHandler mockMessageHandler = new MockMessageHandler(sendFunc); CosmosHttpClient cosmosHttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(mockMessageHandler), DocumentClientEventSource.Instance); - Tracing.TraceData.ClientSideRequestStatisticsTraceDatum clientSideRequestStatistics = new Tracing.TraceData.ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); - - await cosmosHttpClient.SendHttpAsync(() => new ValueTask(new HttpRequestMessage(HttpMethod.Get, "http://someuri.com")), - ResourceType.Document, - HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, - clientSideRequestStatistics, - CancellationToken.None); - - Assert.AreEqual(clientSideRequestStatistics.HttpResponseStatisticsList.Count, 2); - // The duration is calculated using date times which can cause the duration to be slightly off. This allows for up to 15 Ms of variance. - // https://stackoverflow.com/questions/2143140/c-sharp-datetime-now-precision#:~:text=The%20precision%20is%20related%20to,35%2D40%20ms%20accuracy - Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].Duration.TotalMilliseconds >= 985, $"First request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[0])}"); - Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[1].Duration.TotalMilliseconds >= 985, $"Second request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[1])}"); - Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].RequestStartTime < - clientSideRequestStatistics.HttpResponseStatisticsList[1].RequestStartTime); + + using(ITrace trace = Tracing.Trace.GetRootTrace(nameof(GatewayStatsDurationTest))) + { + + Tracing.TraceData.ClientSideRequestStatisticsTraceDatum clientSideRequestStatistics = new Tracing.TraceData.ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); + + await cosmosHttpClient.SendHttpAsync(() => new ValueTask(new HttpRequestMessage(HttpMethod.Get, "http://someuri.com")), + ResourceType.Document, + HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, + clientSideRequestStatistics, + CancellationToken.None); + + Assert.AreEqual(clientSideRequestStatistics.HttpResponseStatisticsList.Count, 2); + // The duration is calculated using date times which can cause the duration to be slightly off. This allows for up to 15 Ms of variance. + // https://stackoverflow.com/questions/2143140/c-sharp-datetime-now-precision#:~:text=The%20precision%20is%20related%20to,35%2D40%20ms%20accuracy + Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].Duration.TotalMilliseconds >= 985, $"First request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[0])}"); + Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[1].Duration.TotalMilliseconds >= 985, $"Second request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[1])}"); + Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].RequestStartTime < + clientSideRequestStatistics.HttpResponseStatisticsList[1].RequestStartTime); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs index e60ab573e8..b44cb49b1f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs @@ -16,7 +16,7 @@ public class JsonWriterTests #region Literals [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void TrueTest() { string expectedString = "true"; @@ -37,7 +37,7 @@ public void TrueTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void FalseTest() { string expectedString = "false"; @@ -58,7 +58,7 @@ public void FalseTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NullTest() { string expectedString = "null"; @@ -80,7 +80,7 @@ public void NullTest() #endregion #region Numbers [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void IntegerTest() { string expectedString = "1337"; @@ -103,7 +103,7 @@ public void IntegerTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void DoubleTest() { string expectedString = "1337.1337"; @@ -126,7 +126,7 @@ public void DoubleTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NaNTest() { string expectedString = "\"NaN\""; @@ -149,7 +149,7 @@ public void NaNTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void PositiveInfinityTest() { string expectedString = "\"Infinity\""; @@ -172,7 +172,7 @@ public void PositiveInfinityTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NegativeInfinityTest() { string expectedString = "\"-Infinity\""; @@ -195,7 +195,7 @@ public void NegativeInfinityTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NegativeNumberTest() { string expectedString = "-1337.1337"; @@ -218,7 +218,7 @@ public void NegativeNumberTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberWithScientificNotationTest() { string expectedString = "6.02252E+23"; @@ -241,7 +241,7 @@ public void NumberWithScientificNotationTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberRegressionTest() { // regression test - the value 0.00085647800000000004 was being incorrectly rejected @@ -267,7 +267,7 @@ public void NumberRegressionTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberPrecisionTest() { string expectedString = "[2.7620553993338772e+018,2.7620553993338778e+018]"; @@ -303,7 +303,7 @@ public void NumberPrecisionTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void LargeNumbersTest() { string expectedString = @"[1,-1,10,-10,14997460357411200,14997460357411000,1499746035741101,1499746035741109,-14997460357411200,-14997460357411000,-1499746035741101,-1499746035741109,1499746035741128,1499752659822592,1499752939110661,1499753827614475,1499970126403840,1499970590815128,1499970842400644,1499971371510025,1499972760675685,1499972969962006,1499973086735836,1499973302072392,1499976826748983]"; @@ -343,7 +343,7 @@ public void LargeNumbersTest() #endregion #region String [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmptyStringTest() { string expectedString = "\"\""; @@ -364,7 +364,7 @@ public void EmptyStringTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void StringTest() { string expectedString = "\"Hello World\""; @@ -387,7 +387,7 @@ public void StringTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void SystemStringTest() { int systemStringId = 0; @@ -418,7 +418,7 @@ public void SystemStringTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void DateTimeStringsTest() { { @@ -633,7 +633,7 @@ public void DateTimeStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void HexStringsTest() { { @@ -719,7 +719,7 @@ public void HexStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void CompressedStringsTest() { { @@ -933,7 +933,7 @@ public void CompressedStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void GuidStringsTest() { { @@ -1325,7 +1325,7 @@ public void GuidStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ReferenceStringsTest() { { @@ -1501,97 +1501,97 @@ public void ReferenceStringsTest() }; byte[] binaryPayload = new byte[] { - 0x80, 0xEB, 0xCE, 0x02, 0x89, 0x70, 0x72, 0x6F, + 0x80, 0xEB, 0xD2, 0x02, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x31, 0x86, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x31, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x32, 0xC3, 0x0E, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x33, 0xE2, 0x64, 0x89, 0x70, 0x72, - 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x30, 0xC3, - 0x04, 0xC3, 0x15, 0xC3, 0x21, 0x89, 0x70, 0x72, - 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x34, 0x89, - 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x35, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x36, 0x89, 0x70, 0x72, 0x6F, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x37, 0x89, 0x70, 0x72, - 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x38, 0x89, - 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x39, 0xC3, 0x0E, 0xC3, 0x0E, 0xC3, 0x0E, 0xC3, - 0x6F, 0xC3, 0x65, 0xC3, 0x5B, 0xC3, 0x47, 0xC3, - 0x3D, 0xC3, 0x21, 0xC3, 0x15, 0xC3, 0x04, 0xC3, - 0x2D, 0xC3, 0x21, 0xC3, 0x0E, 0xC3, 0x3D, 0xC3, - 0x0E, 0xC3, 0x47, 0xE2, 0xB8, 0x8E, 0x53, 0x74, + 0x74, 0x79, 0x33, 0xE5, 0x64, 0x16, 0x89, 0x70, + 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x30, + 0xC3, 0x04, 0xC3, 0x15, 0xC3, 0x21, 0x89, 0x70, + 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x34, + 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x35, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x36, 0x89, 0x70, 0x72, 0x6F, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x37, 0x89, 0x70, + 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x38, + 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x39, 0xC3, 0x0E, 0xC3, 0x0E, 0xC3, 0x0E, + 0xC3, 0x70, 0xC3, 0x66, 0xC3, 0x5C, 0xC3, 0x48, + 0xC3, 0x3E, 0xC3, 0x21, 0xC3, 0x15, 0xC3, 0x04, + 0xC3, 0x2E, 0xC3, 0x21, 0xC3, 0x0E, 0xC3, 0x3E, + 0xC3, 0x0E, 0xC3, 0x48, 0xE5, 0xB8, 0x16, 0x8E, + 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, + 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x30, 0x8E, 0x53, + 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, + 0x75, 0x65, 0x5F, 0x5F, 0x31, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, - 0x65, 0x5F, 0x5F, 0x30, 0x8E, 0x53, 0x74, 0x72, + 0x65, 0x5F, 0x5F, 0x32, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, - 0x5F, 0x5F, 0x31, 0x8E, 0x53, 0x74, 0x72, 0x69, + 0x5F, 0x5F, 0x33, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, - 0x5F, 0x32, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, + 0x5F, 0x34, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, - 0x33, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, - 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x34, + 0x35, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, + 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x36, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, - 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x35, 0x8E, + 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x37, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, - 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x36, 0x8E, 0x53, + 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x38, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, - 0x75, 0x65, 0x5F, 0x5F, 0x37, 0x8E, 0x53, 0x74, - 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, - 0x65, 0x5F, 0x5F, 0x38, 0x8E, 0x53, 0x74, 0x72, - 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, - 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, 0x6C, 0x75, - 0x65, 0x32, 0xC4, 0x33, 0x01, 0xC4, 0x33, 0x01, - 0xC4, 0x24, 0x01, 0xC4, 0x15, 0x01, 0xC4, 0x06, - 0x01, 0xC3, 0xE8, 0xC3, 0xD9, 0xC3, 0xCA, 0xC3, - 0xBB, 0xC3, 0xAC, 0xC3, 0x9D, 0xC3, 0x47, 0xC4, - 0x33, 0x01, 0xC3, 0x51, 0xC4, 0x33, 0x01, 0xC3, - 0x5B, 0xE2, 0xAA, 0x8C, 0x54, 0x65, 0x78, 0x74, - 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x30, + 0x75, 0x65, 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, + 0x6C, 0x75, 0x65, 0x32, 0xC4, 0x35, 0x01, 0xC4, + 0x35, 0x01, 0xC4, 0x26, 0x01, 0xC4, 0x17, 0x01, + 0xC4, 0x08, 0x01, 0xC3, 0xEA, 0xC3, 0xDB, 0xC3, + 0xCC, 0xC3, 0xBD, 0xC3, 0xAE, 0xC3, 0x9F, 0xC3, + 0x48, 0xC4, 0x35, 0x01, 0xC3, 0x52, 0xC4, 0x35, + 0x01, 0xC3, 0x5C, 0xE5, 0xAA, 0x16, 0x8C, 0x54, + 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, + 0x5F, 0x5F, 0x30, 0x8C, 0x54, 0x65, 0x78, 0x74, + 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x31, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, - 0x75, 0x65, 0x5F, 0x5F, 0x31, 0x8C, 0x54, 0x65, + 0x75, 0x65, 0x5F, 0x5F, 0x32, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, - 0x5F, 0x32, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, - 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x33, 0x8C, + 0x5F, 0x33, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, + 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x34, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, - 0x65, 0x5F, 0x5F, 0x34, 0x8C, 0x54, 0x65, 0x78, + 0x65, 0x5F, 0x5F, 0x35, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, - 0x35, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, - 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x36, 0x8C, 0x54, + 0x36, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, + 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x37, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, - 0x5F, 0x5F, 0x37, 0x8C, 0x54, 0x65, 0x78, 0x74, - 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x38, - 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, - 0x75, 0x65, 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, - 0x6C, 0x75, 0x65, 0x33, 0xC4, 0xE5, 0x01, 0xC4, - 0xE5, 0x01, 0xC4, 0xD8, 0x01, 0xC4, 0xCB, 0x01, - 0xC4, 0xBE, 0x01, 0xC4, 0xA4, 0x01, 0xC4, 0x97, - 0x01, 0xC4, 0x8A, 0x01, 0xC4, 0x7D, 0x01, 0xC4, - 0x70, 0x01, 0xC4, 0x63, 0x01, 0xC3, 0x65, 0xC4, - 0xE5, 0x01, 0xC3, 0x6F, 0xC4, 0xE5, 0x01, 0xC3, - 0x2D, 0xE2, 0xA0, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x30, 0x8B, + 0x5F, 0x5F, 0x38, 0x8C, 0x54, 0x65, 0x78, 0x74, + 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x39, + 0x86, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x33, 0xC4, + 0xE8, 0x01, 0xC4, 0xE8, 0x01, 0xC4, 0xDB, 0x01, + 0xC4, 0xCE, 0x01, 0xC4, 0xC1, 0x01, 0xC4, 0xA7, + 0x01, 0xC4, 0x9A, 0x01, 0xC4, 0x8D, 0x01, 0xC4, + 0x80, 0x01, 0xC4, 0x73, 0x01, 0xC4, 0x66, 0x01, + 0xC3, 0x66, 0xC4, 0xE8, 0x01, 0xC3, 0x70, 0xC4, + 0xE8, 0x01, 0xC3, 0x2E, 0xE5, 0xA0, 0x16, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x31, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x32, 0x8B, + 0x5F, 0x5F, 0x30, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x31, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x33, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x34, 0x8B, + 0x5F, 0x5F, 0x32, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x33, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x35, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x36, 0x8B, + 0x5F, 0x5F, 0x34, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x35, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x37, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x38, 0x8B, + 0x5F, 0x5F, 0x36, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x37, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, 0x6C, 0x75, - 0x65, 0x34, 0xC4, 0x93, 0x02, 0xC4, 0x93, 0x02, - 0xC4, 0x87, 0x02, 0xC4, 0x7B, 0x02, 0xC4, 0x6F, - 0x02, 0xC4, 0x57, 0x02, 0xC4, 0x4B, 0x02, 0xC4, - 0x3F, 0x02, 0xC4, 0x33, 0x02, 0xC4, 0x27, 0x02, - 0xC4, 0x1B, 0x02, 0x89, 0x70, 0x72, 0x6F, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x41, 0x86, 0x76, 0x61, - 0x6C, 0x75, 0x65, 0x41, 0xC4, 0xBB, 0x02, 0xC4, - 0xC5, 0x02 + 0x5F, 0x5F, 0x38, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x39, 0x86, + 0x76, 0x61, 0x6C, 0x75, 0x65, 0x34, 0xC4, 0x97, + 0x02, 0xC4, 0x97, 0x02, 0xC4, 0x8B, 0x02, 0xC4, + 0x7F, 0x02, 0xC4, 0x73, 0x02, 0xC4, 0x5B, 0x02, + 0xC4, 0x4F, 0x02, 0xC4, 0x43, 0x02, 0xC4, 0x37, + 0x02, 0xC4, 0x2B, 0x02, 0xC4, 0x1F, 0x02, 0x89, + 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x41, 0x86, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x41, + 0xC4, 0xBF, 0x02, 0xC4, 0xC9, 0x02 }; this.VerifyWriter(tokensToWrite, binaryPayload); @@ -1600,7 +1600,7 @@ public void ReferenceStringsTest() #endregion #region Array [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmptyArrayTest() { string expectedString = "[]"; @@ -1622,7 +1622,7 @@ public void EmptyArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void SingleItemArrayTest() { string expectedString = "[true]"; @@ -1646,7 +1646,7 @@ public void SingleItemArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void IntArrayTest() { string expectedString = "[-2,-1,0,1,2]"; @@ -1686,7 +1686,7 @@ public void IntArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberArrayTest() { string expectedString = "[15,22,0.1,-0.073,7.70001E+91]"; @@ -1726,7 +1726,7 @@ public void NumberArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void BooleanArrayTest() { string expectedString = "[true,false]"; @@ -1754,7 +1754,67 @@ public void BooleanArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] + public void BooleanLargeArrayTest() + { + string expectedString = "[true,false,true,false,true,false,false,false,true,false,true,false,true,true,true,false,true]"; + byte[] binaryOutput = + { + BinaryFormat, + JsonBinaryEncoding.TypeMarker.Array1ByteLengthAndCount, + // length + 17, + // count + 17, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + }; + + JsonToken[] tokensToWrite = + { + JsonToken.ArrayStart(), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(false), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(true), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.ArrayEnd(), + }; + + this.VerifyWriter(tokensToWrite, expectedString); + this.VerifyWriter(tokensToWrite, binaryOutput); + this.VerifyWriter(tokensToWrite, binaryOutput, null, false); + } + + [TestMethod] + [Owner("mayapainter")] public void StringArrayTest() { string expectedString = @"[""Hello"",""World"",""Bye""]"; @@ -1794,7 +1854,61 @@ public void StringArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] + public void StringLargeArrayTest() + { + int stringCount = 20; + + string expectedString = @"["; + for (int index = 0; index < stringCount; index++) + { + if (index == 0) + { + expectedString += @"""Hello0"""; + } + else + { + expectedString += @",""Hello" + index + @""""; + } + + } + expectedString += "]"; + + List binaryOutputBuilder = new List + { + new byte[] { BinaryFormat, JsonBinaryEncoding.TypeMarker.Array1ByteLengthAndCount } + }; + + List strings = new List(); + + for (int index = 0; index < stringCount; index++) + { + string value = "Hello" + index; + strings.Add(new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + value.Length) }); + strings.Add(Encoding.UTF8.GetBytes(value)); + } + byte[] stringBytes = strings.SelectMany(x => x).ToArray(); + + binaryOutputBuilder.Add(new byte[] { (byte)stringBytes.Length }); + binaryOutputBuilder.Add(new byte[] { (byte)stringCount }); + binaryOutputBuilder.Add(stringBytes); + byte[] binaryOutput = binaryOutputBuilder.SelectMany(x => x).ToArray(); + + JsonToken[] tokensToWrite = new JsonToken[stringCount + 2]; + tokensToWrite[0] = JsonToken.ArrayStart(); + for (int index = 1; index < stringCount + 1; index++) + { + tokensToWrite[index] = JsonToken.String("Hello" + (index - 1)); + } + tokensToWrite[stringCount + 1] = JsonToken.ArrayEnd(); + + this.VerifyWriter(tokensToWrite, expectedString); + this.VerifyWriter(tokensToWrite, binaryOutput); + this.VerifyWriter(tokensToWrite, binaryOutput, null, false); + } + + [TestMethod] + [Owner("mayapainter")] public void NullArrayTest() { string expectedString = "[null,null,null]"; @@ -1824,7 +1938,52 @@ public void NullArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] + public void NullLargeArrayTest() + { + int nullCount = 300; + + string expectedString = "["; + for (int index = 0; index < nullCount; index++) + { + expectedString += (index == 0) ? "null" : ",null"; + } + expectedString += "]"; + + List binaryOutputBuilder = new List + { + new byte[] { BinaryFormat, JsonBinaryEncoding.TypeMarker.Array2ByteLengthAndCount }, + // length + BitConverter.GetBytes((ushort)nullCount), + // count + BitConverter.GetBytes((ushort)nullCount), + }; + + byte[] elementsBytes = new byte[nullCount]; + + for (int index = 0; index < nullCount; index++) + { + elementsBytes[index] = JsonBinaryEncoding.TypeMarker.Null; + } + + binaryOutputBuilder.Add(elementsBytes); + byte[] binaryOutput = binaryOutputBuilder.SelectMany(x => x).ToArray(); + + JsonToken[] tokensToWrite = new JsonToken[nullCount + 2]; + tokensToWrite[0] = JsonToken.ArrayStart(); + for (int index = 1; index < nullCount + 1; index++) + { + tokensToWrite[index] = JsonToken.Null(); + } + tokensToWrite[nullCount + 1] = JsonToken.ArrayEnd(); + + this.VerifyWriter(tokensToWrite, expectedString); + this.VerifyWriter(tokensToWrite, binaryOutput); + this.VerifyWriter(tokensToWrite, binaryOutput, null, false); + } + + [TestMethod] + [Owner("mayapainter")] public void ObjectArrayTest() { string expectedString = "[{},{}]"; @@ -1854,7 +2013,7 @@ public void ObjectArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void AllPrimitiveArrayTest() { string expectedString = "[0,0,-1,-1.1,1,2,\"hello\",null,true,false]"; @@ -1905,7 +2064,7 @@ public void AllPrimitiveArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NestedArrayTest() { string expectedString = "[[],[]]"; @@ -1935,7 +2094,7 @@ public void NestedArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void StrangeNumberArrayTest() { string expectedString = @"[ @@ -1994,7 +2153,7 @@ public void StrangeNumberArrayTest() #endregion Array #region Escaping [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EscapeCharacterTest() { /// @@ -2026,7 +2185,7 @@ public void EscapeCharacterTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void UnicodeEscapeTest() { // You don't have to escape a regular unicode character @@ -2042,7 +2201,7 @@ public void UnicodeEscapeTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void TwoAdjacentUnicodeCharactersTest() { // 2 unicode escape characters that are not surrogate pairs @@ -2059,7 +2218,7 @@ public void TwoAdjacentUnicodeCharactersTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void UnicodeTest() { // You don't have to escape a regular unicode character @@ -2083,7 +2242,7 @@ public void UnicodeTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmojiUTF32Test() { // You don't have to escape a regular unicode character @@ -2107,7 +2266,7 @@ public void EmojiUTF32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ControlCharacterTests() { HashSet escapeCharacters = new HashSet { '\b', '\f', '\n', '\r', '\t', '\\', '"', '/' }; @@ -2132,7 +2291,7 @@ public void ControlCharacterTests() #endregion #region Objects [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmptyObjectTest() { string expectedString = "{}"; @@ -2154,7 +2313,7 @@ public void EmptyObjectTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void SimpleObjectTest() { string expectedString = "{\"GlossDiv\":10,\"title\": \"example glossary\" }"; @@ -2222,7 +2381,7 @@ public void SimpleObjectTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void AllPrimitivesObjectTest() { string expectedString = @"{ @@ -2425,7 +2584,7 @@ public void AllPrimitivesObjectTest() #endregion #region Exceptions [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ArrayNotStartedTest() { JsonToken[] tokensToWrite = @@ -2438,7 +2597,7 @@ public void ArrayNotStartedTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ObjectNotStartedTest() { JsonToken[] tokensToWrite = @@ -2451,7 +2610,7 @@ public void ObjectNotStartedTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void PropertyArrayOrObjectNotStartedTest() { JsonToken[] tokensToWrite = @@ -2466,7 +2625,7 @@ public void PropertyArrayOrObjectNotStartedTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void MissingPropertyTest() { JsonToken[] tokensToWrite = @@ -2481,7 +2640,7 @@ public void MissingPropertyTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void PropertyAlreadyAddedTest() { string duplicateFieldName = "This property is added twice"; @@ -2501,7 +2660,7 @@ public void PropertyAlreadyAddedTest() #endregion #region ExtendedTypes [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int8Test() { sbyte[] values = new sbyte[] { sbyte.MinValue, sbyte.MinValue + 1, -1, 0, 1, sbyte.MaxValue, sbyte.MaxValue - 1 }; @@ -2531,7 +2690,7 @@ public void Int8Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int16Test() { short[] values = new short[] { short.MinValue, short.MinValue + 1, -1, 0, 1, short.MaxValue, short.MaxValue - 1 }; @@ -2561,7 +2720,7 @@ public void Int16Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int32Test() { int[] values = new int[] { int.MinValue, int.MinValue + 1, -1, 0, 1, int.MaxValue, int.MaxValue - 1 }; @@ -2591,7 +2750,7 @@ public void Int32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int64Test() { long[] values = new long[] { long.MinValue, long.MinValue + 1, -1, 0, 1, long.MaxValue, long.MaxValue - 1 }; @@ -2621,7 +2780,7 @@ public void Int64Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void UInt32Test() { uint[] values = new uint[] { uint.MinValue, uint.MinValue + 1, 0, 1, uint.MaxValue, uint.MaxValue - 1 }; @@ -2651,7 +2810,7 @@ public void UInt32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Float32Test() { float[] values = new float[] { float.MinValue, float.MinValue + 1, 0, 1, float.MaxValue, float.MaxValue - 1 }; @@ -2681,7 +2840,7 @@ public void Float32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Float64Test() { double[] values = new double[] { double.MinValue, double.MinValue + 1, 0, 1, double.MaxValue, double.MaxValue - 1 }; @@ -2711,7 +2870,7 @@ public void Float64Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void GuidTest() { Guid[] values = new Guid[] { Guid.Empty, Guid.NewGuid() }; @@ -2741,7 +2900,7 @@ public void GuidTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void BinaryTest() { { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs index ceb4febfd0..8e50a21dd0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs @@ -7,7 +7,10 @@ namespace Microsoft.Azure.Cosmos.Linq using System; using System.Collections.Generic; using System.Globalization; + using System.IO; + using System.Linq; using System.Linq.Expressions; + using global::Azure.Core.Serialization; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -31,6 +34,104 @@ public void DateTimeKindIsPreservedTest() Assert.AreEqual("(a[\"StartDate\"] <= \"2022-05-26\")", sql); } + [TestMethod] + public void EnumIsPreservedAsINTest() + { + // Arrange + CosmosLinqSerializerOptions options = new() + { + //CustomCosmosSerializer = new TestCustomJsonSerializer() + }; + + // Act + TestEnum[] values = new[] { TestEnum.One, TestEnum.Two }; + Expression> expr = a => values.Contains(a.Value); + + string sql = SqlTranslator.TranslateExpression(expr.Body, options); + + // Assert + // Assert.AreEqual("(a[\"Value\"] IN (\"One\", \"Two\"))", sql); // <- TODO - Desired Behavior with CustomSerializer + Assert.AreEqual("(a[\"Value\"] IN (0, 1))", sql); // <- Actual behavior, with ability to set custom serializor reverted + } + + [TestMethod] + public void EnumIsPreservedAsEQUALSTest() + { + // Arrange + CosmosLinqSerializerOptions options = new() + { + // CustomCosmosSerializer = new TestCustomJsonSerializer() + }; + + // Act + TestEnum statusValue = TestEnum.One; + Expression> expr = a => a.Value == statusValue; + + string sql = SqlTranslator.TranslateExpression(expr.Body, options); + + // Assert + // Assert.AreEqual("(a[\"Value\"] = \"One\")", sql); // <- THIS is the correct value, if we are able to use the custom serializer + Assert.AreEqual("(a[\"Value\"] = 0)", sql); // <- THIS is the current mis-behavior of the SDK + } + + [TestMethod] + public void EnumIsPreservedAsEXPRESSIONTest() + { + // Arrange + CosmosLinqSerializerOptions options = new() + { + // CustomCosmosSerializer = new TestCustomJsonSerializer() + }; + + // Act + + // Get status constant + ConstantExpression status = Expression.Constant(TestEnum.One); + + // Get member access expression + ParameterExpression arg = Expression.Parameter(typeof(TestEnumNewtonsoftDocument), "a"); + + // Access the value property + MemberExpression docValueExpression = Expression.MakeMemberAccess( + arg, + typeof(TestEnumNewtonsoftDocument).GetProperty(nameof(TestEnumNewtonsoftDocument.Value))! + ); + + // Create comparison expression + BinaryExpression expression = Expression.Equal( + docValueExpression, + status + ); + + // Create lambda expression + Expression> lambda = + Expression.Lambda>(expression, arg); + + string sql = SqlTranslator.TranslateExpression(lambda.Body, options); + + // Assert + Assert.AreEqual("(a[\"Value\"] = \"One\")", sql); + } + + enum TestEnum + { + One, + Two, + Three, + } + + class TestEnumDocument + { + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] // TODO: Remove this once we have the ability to use custom serializer for LINQ queries + public TestEnum Value { get; set; } + } + + class TestEnumNewtonsoftDocument + { + [JsonConverter(typeof(StringEnumConverter))] + public TestEnum Value { get; set; } + } + class TestDocument { [JsonConverter(typeof(DateJsonConverter))] @@ -80,5 +181,54 @@ class DocumentWithExtensionData [System.Text.Json.Serialization.JsonExtensionData()] public Dictionary NetExtensionData { get; set; } } + + /// + // See: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/CosmosSystemTextJsonSerializer.cs + /// + class TestCustomJsonSerializer : CosmosSerializer + { + private readonly JsonObjectSerializer systemTextJsonSerializer; + + public static readonly System.Text.Json.JsonSerializerOptions JsonOptions = new() + { + DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + PropertyNameCaseInsensitive = true, + Converters = { + new System.Text.Json.Serialization.JsonStringEnumConverter(), + } + }; + + public TestCustomJsonSerializer() + { + this.systemTextJsonSerializer = new JsonObjectSerializer(JsonOptions); + } + + public override T FromStream(Stream stream) + { + using (stream) + { + if (stream.CanSeek && stream.Length == 0) + { + return default; + } + + if (typeof(Stream).IsAssignableFrom(typeof(T))) + { + return (T)(object)stream; + } + + return (T)this.systemTextJsonSerializer.Deserialize(stream, typeof(T), default); + } + } + + public override Stream ToStream(T input) + { + MemoryStream stream = new (); + + this.systemTextJsonSerializer.Serialize(stream, input, typeof(T), default); + stream.Position = 0; + return stream; + } + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 20de3f1f03..81c765adc4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -2,6 +2,7 @@ { using System; using System.Collections.Generic; + using System.Collections.Immutable; using System.Collections.ObjectModel; using System.IO; using System.Linq; @@ -80,19 +81,12 @@ public void PositiveOptimisticDirectExecutionOutput() // Below cases are Ode because they have a collection with a single physical partition. // Added emulator tests (TestPassingOptimisticDirectExecutionQueries()) to verify the negation of the below cases. CreateInput( - description: @"Null Partition Key Value", + description: @"Cosmos.PartitionKey.Null Partition Key Value", query: "SELECT * FROM c", expectedOptimisticDirectExecution: true, partitionKeyPath: @"/pk", partitionKeyValue: Cosmos.PartitionKey.Null), - CreateInput( - description: @"None Partition Key Value", - query: "SELECT * FROM c", - expectedOptimisticDirectExecution: true, - partitionKeyPath: @"/pk", - partitionKeyValue: Cosmos.PartitionKey.None), - CreateInput( description: @"C# Null Partition Key Value", query: "SELECT * FROM c", @@ -133,7 +127,7 @@ public void NegativeOptimisticDirectExecutionOutput() partitionKeyPath: @"/pk", partitionKeyValue: "a", continuationToken: CosmosArray.Create(new List() { ParallelContinuationToken.ToCosmosElement(parallelContinuationToken) })), - + CreateInput( description: @"Single Partition Key with OrderBy continuation token", query: "SELECT * FROM c ORDER BY c._ts", @@ -144,16 +138,21 @@ public void NegativeOptimisticDirectExecutionOutput() }; this.ExecuteTestSuite(testVariations); } - + // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done [TestMethod] public async Task TestDefaultQueryRequestOptionsSettings() { - QueryRequestOptions requestOptions = new QueryRequestOptions(); + bool odeExpectedValue = +#if PREVIEW + true; +#else + false; +#endif - Assert.AreEqual(requestOptions.EnableOptimisticDirectExecution, false); + Assert.AreEqual(odeExpectedValue, requestOptions.EnableOptimisticDirectExecution); } // test checks that the pipeline can take a query to the backend and returns its associated document(s). @@ -169,7 +168,6 @@ public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() partitionKeyValue: "a"); QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); - DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: false); IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); int documentCountInSinglePartition = 0; @@ -192,6 +190,145 @@ public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() Assert.AreEqual(100, documentCountInSinglePartition); } + [TestMethod] + public async Task TestQueriesWhichNeverRequireDistribution() + { + // requiresDist = false + int numItems = 100; + List singlePartitionContainerTestCases = new List() + { + new RequiresDistributionTestCase("SELECT * FROM r", 10, 100), + new RequiresDistributionTestCase("SELECT VALUE r.id FROM r", 0, 10), + new RequiresDistributionTestCase("SELECT * FROM r WHERE r.id > 5", 0, 0), + new RequiresDistributionTestCase("SELECT r.id FROM r JOIN id IN r.id",0, 0), + new RequiresDistributionTestCase("SELECT TOP 5 r.id FROM r ORDER BY r.id", 0, 5), + new RequiresDistributionTestCase("SELECT TOP 5 r.id FROM r WHERE r.id > 5 ORDER BY r.id", 0, 0), + new RequiresDistributionTestCase("SELECT * FROM r OFFSET 5 LIMIT 3", 1, 3), + new RequiresDistributionTestCase("SELECT * FROM r WHERE r.id > 5 OFFSET 5 LIMIT 3", 0, 0) + }; + + foreach (RequiresDistributionTestCase testCase in singlePartitionContainerTestCases) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Queries which will never require distribution", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, + expectedContinuationTokenCount: testCase.ExpectedContinuationTokenCount, + requiresDist: false); + + Assert.AreEqual(testCase.ExpectedDocumentCount, result); + } + } + + [TestMethod] + public async Task TestQueriesWhichWillAlwaysRequireDistribution() + { + // requiresDist = true + int numItems = 100; + List singlePartitionContainerTestCases = new List() + { + new RequiresDistributionTestCase("SELECT Sum(id) as sum_id FROM r JOIN id IN r.id", 0, 1), + new RequiresDistributionTestCase("SELECT DISTINCT TOP 5 r.id FROM r ORDER BY r.id", 0, 5), + new RequiresDistributionTestCase("SELECT DISTINCT r.id FROM r GROUP BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT DISTINCT r.id, Sum(r.id) as sum_a FROM r GROUP BY r.id",0, 10), + new RequiresDistributionTestCase("SELECT Count(1) FROM (SELECT DISTINCT r.id FROM root r)", 0, 1), + new RequiresDistributionTestCase("SELECT DISTINCT id FROM r JOIN id in r.id", 0, 0), + new RequiresDistributionTestCase("SELECT r.id, Count(1) AS count_a FROM r GROUP BY r.id ORDER BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT Count(1) as count FROM root r JOIN b IN r.id", 0, 1), + new RequiresDistributionTestCase("SELECT Avg(1) AS avg FROM root r", 0, 1), + new RequiresDistributionTestCase("SELECT r.id, Count(1) as count FROM r WHERE r.id > 0 GROUP BY r.id", 0, 0), + new RequiresDistributionTestCase("SELECT r.id FROM r WHERE r.id > 0 GROUP BY r.id ORDER BY r.id", 0, 0) + }; + + foreach (RequiresDistributionTestCase testCase in singlePartitionContainerTestCases) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Queries which will always require distribution", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, + expectedContinuationTokenCount: testCase.ExpectedContinuationTokenCount, + requiresDist: true); + + Assert.AreEqual(testCase.ExpectedDocumentCount, result); + } + } + + [TestMethod] + public async Task TestQueriesWhichCanSwitchDistribution() + { + // requiresDist = true/false + int numItems = 100; + bool[] requiresDistSet = { true, false }; + + List singlePartitionContainerTestCases = new List() + { + new RequiresDistributionTestCase("SELECT Count(r.id) AS count_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT DISTINCT r.id FROM r", 0, 10), + new RequiresDistributionTestCase("SELECT r.id, Count(1) AS count_a FROM r GROUP BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT Count(1) AS count FROM root r WHERE r.id < 2", 0, 1), + new RequiresDistributionTestCase("SELECT r.id, Count(r.id), Avg(r.id) FROM r WHERE r.id < 2 GROUP BY r.id", 0, 0), + new RequiresDistributionTestCase("SELECT TOP 5 Count(1) as count FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT TOP 5 Count(1) as count FROM r ORDER BY r.id", 0, 1), + new RequiresDistributionTestCase("SELECT r.id FROM r GROUP BY r.id OFFSET 5 LIMIT 3", 0, 3), + new RequiresDistributionTestCase("SELECT Count(1) as count FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.id) as sum_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Min(r.a) as min_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Max(r.a) as min_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Avg(r.a) as min_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0 OFFSET 0 LIMIT 5", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0 OFFSET 5 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r ORDER BY r.a", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r ORDER BY r.a OFFSET 5 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0 ORDER BY r.a OFFSET 5 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT DISTINCT VALUE r.id FROM r", 0, 10), + new RequiresDistributionTestCase("SELECT DISTINCT TOP 5 r.a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT s.id FROM (SELECT DISTINCT r.id FROM root r) as s", 0, 10), + new RequiresDistributionTestCase("SELECT DISTINCT r.a FROM r OFFSET 3 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT Count(r.id) AS count_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT r.id, Count(1) AS count_a FROM r GROUP BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT Count(1) AS count FROM root r WHERE r.id < 2", 0, 1), + new RequiresDistributionTestCase("SELECT TOP 5 Count(1) as count FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Count(1) AS count FROM root r WHERE r.id < 2", 0, 1), + }; + + foreach (RequiresDistributionTestCase testCase in singlePartitionContainerTestCases) + { + foreach (bool requiresDist in requiresDistSet) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Queries which can require distribution in certain cases", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, + expectedContinuationTokenCount: testCase.ExpectedContinuationTokenCount, + requiresDist: requiresDist); + + Assert.AreEqual(testCase.ExpectedDocumentCount, result); + } + } + } + // test checks that the pipeline can take a query to the backend and returns its associated document(s) + continuation token. [TestMethod] public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() @@ -269,7 +406,7 @@ private static async Task ExecuteGoneExceptionOnODEPipeline(bool isMultiPa { Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); } - else + else { Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); } @@ -345,18 +482,20 @@ private static async Task TestHandlingOfFailedFallbackPipeline(bool isMult return (mergeTest, queryPipelineStage); } - private async Task GetPipelineAndDrainAsync(OptimisticDirectExecutionTestInput input, int numItems, bool isMultiPartition, int expectedContinuationTokenCount) + private async Task GetPipelineAndDrainAsync(OptimisticDirectExecutionTestInput input, int numItems, bool isMultiPartition, int expectedContinuationTokenCount, bool requiresDist = false) { QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); - DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: isMultiPartition); + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: isMultiPartition, requiresDist: requiresDist); IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); - List documents = new List(); int continuationTokenCount = 0; while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) { - Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + if (!requiresDist) + { + Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + } TryCatch tryGetPage = queryPipelineStage.Current; tryGetPage.ThrowIfFailed(); @@ -420,6 +559,7 @@ private static async Task GetOdePipelineAsync(OptimisticDir private static async Task CreateDocumentContainerAsync( int numItems, bool multiPartition, + bool requiresDist = false, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() @@ -432,7 +572,9 @@ private static async Task CreateDocumentContainerAsync( Version = PartitionKeyDefinitionVersion.V2, }; - IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); + MockDocumentContainer mockContainer = new MockDocumentContainer(partitionKeyDefinition, requiresDist); + IMonadicDocumentContainer monadicDocumentContainer = mockContainer; + if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); @@ -523,7 +665,7 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect NoOpTrace.Singleton); bool result = queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton).AsTask().GetAwaiter().GetResult(); - + if (input.ExpectedOptimisticDirectExecution) { Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); @@ -546,11 +688,6 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect string sqlQuerySpecJsonString = streamReader.ReadToEnd(); PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = GetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, input.PartitionKeyDefinition); - if (input.PartitionKeyValue == default || input.PartitionKeyValue == Cosmos.PartitionKey.None) - { - input.PartitionKeyValue = Cosmos.PartitionKey.Null; - } - CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( sqlQuerySpec: new SqlQuerySpec(input.Query), initialUserContinuationToken: input.ContinuationToken, @@ -598,6 +735,68 @@ private static QueryRequestOptions GetQueryRequestOptions(bool enableOptimisticD }; } + internal readonly struct RequiresDistributionTestCase + { + public string Query { get; } + public int ExpectedContinuationTokenCount { get; } + public int ExpectedDocumentCount { get; } + + public RequiresDistributionTestCase( + string query, + int expectedContinuationTokenCount, + int expectedDocumentCount) + { + this.Query = query; + this.ExpectedContinuationTokenCount = expectedContinuationTokenCount; + this.ExpectedDocumentCount = expectedDocumentCount; + } + } + + private sealed class MockDocumentContainer : InMemoryContainer + { + private readonly bool requiresDistribution; + + public MockDocumentContainer( + PartitionKeyDefinition partitionKeyDefinition, + bool requiresDistribution) + : base(partitionKeyDefinition) + { + this.requiresDistribution = requiresDistribution; + } + + public override async Task> MonadicQueryAsync( + SqlQuerySpec sqlQuerySpec, + FeedRangeState feedRangeState, + QueryPaginationOptions queryPaginationOptions, + ITrace trace, + CancellationToken cancellationToken) + { + Task> queryPage = base.MonadicQueryAsync( + sqlQuerySpec, + feedRangeState, + queryPaginationOptions, + trace, + cancellationToken); + + ImmutableDictionary.Builder additionalHeaders = ImmutableDictionary.CreateBuilder(); + additionalHeaders.Add("x-ms-documentdb-partitionkeyrangeid", "0"); + additionalHeaders.Add("x-ms-test-header", "true"); + additionalHeaders.Add("x-ms-cosmos-query-requiresdistribution", this.requiresDistribution.ToString()); + + return await Task.FromResult( + TryCatch.FromResult( + new QueryPage( + queryPage.Result.Result.Documents, + requestCharge: 42, + activityId: Guid.NewGuid().ToString(), + responseLengthInBytes: 1337, + cosmosQueryExecutionInfo: default, + disallowContinuationTokenMessage: default, + additionalHeaders: additionalHeaders.ToImmutable(), + state: queryPage.Result.Result.State))); + } + } + private class MergeTestUtil { public int MoveNextCounter { get; private set; } @@ -626,7 +825,7 @@ public async Task ShouldReturnFailure() activityId: "0f8fad5b-d9cb-469f-a165-70867728950e", requestCharge: default); } - + if (this.IsFailedFallbackPipelineTest && this.GoneExceptionCreated && !this.TooManyRequestsFailureCreated) { this.TooManyRequestsFailureCreated = true; @@ -728,12 +927,12 @@ public override void SerializeAsXml(XmlWriter xmlWriter) } } } - + internal class TestCosmosQueryClient : CosmosQueryClient { public override Action OnExecuteScalarQueryCallback => throw new NotImplementedException(); - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return false; } @@ -743,7 +942,7 @@ public override void ClearSessionTokenCache(string collectionFullName) throw new NotImplementedException(); } - public override Task> ExecuteItemQueryAsync(string resourceUri, ResourceType resourceType, OperationType operationType, Guid clientQueryCorrelationId, Cosmos.FeedRange feedRange, QueryRequestOptions requestOptions, SqlQuerySpec sqlQuerySpec, string continuationToken, bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken) + public override Task> ExecuteItemQueryAsync(string resourceUri, ResourceType resourceType, OperationType operationType, Cosmos.FeedRange feedRange, QueryRequestOptions requestOptions, AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, int pageSize, ITrace trace, CancellationToken cancellationToken) { throw new NotImplementedException(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs new file mode 100644 index 0000000000..b0f5cd2ea0 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs @@ -0,0 +1,94 @@ +namespace Microsoft.Azure.Cosmos.Tests.Resource.Settings +{ + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class DedicatedGatewayRequestOptionsTests + { + [TestMethod] + public void BypassIntegratedCacheHeaderIsSetWhenTrue() + { + DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions + { + BypassIntegratedCache = true + }; + + ItemRequestOptions itemRequestOptions = new ItemRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + RequestMessage itemRequestMessage = new RequestMessage(); + RequestMessage queryRequestMessage = new RequestMessage(); + + itemRequestOptions.PopulateRequestOptions(itemRequestMessage); + queryRequestOptions.PopulateRequestOptions(queryRequestMessage); + + + Assert.IsNotNull(itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.IsNotNull(queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + + Assert.AreEqual("True", itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.AreEqual("True", queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + } + + [TestMethod] + public void BypassIntegratedCacheHeaderIsNotSetWhenFalse() + { + DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions + { + BypassIntegratedCache = false + }; + + ItemRequestOptions itemRequestOptions = new ItemRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + RequestMessage itemRequestMessage = new RequestMessage(); + RequestMessage queryRequestMessage = new RequestMessage(); + + itemRequestOptions.PopulateRequestOptions(itemRequestMessage); + queryRequestOptions.PopulateRequestOptions(queryRequestMessage); + + + Assert.IsNull(itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.IsNull(queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + } + + [TestMethod] + public void BypassIntegratedCacheHeaderIsNotSetWhenNotSet() + { + ItemRequestOptions itemRequestOptions = new ItemRequestOptions + { + DedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions() + }; + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + DedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions() + }; + + RequestMessage itemRequestMessage = new RequestMessage(); + RequestMessage queryRequestMessage = new RequestMessage(); + + itemRequestOptions.PopulateRequestOptions(itemRequestMessage); + queryRequestOptions.PopulateRequestOptions(queryRequestMessage); + + + Assert.IsNull(itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.IsNull(queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs index 35ffaa65bb..792621f54a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs @@ -19,6 +19,8 @@ namespace Microsoft.Azure.Cosmos.Tests.Routing using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; using System.Collections.ObjectModel; using System.Net; + using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Query.Core.Monads; /// /// Tests for class. @@ -246,6 +248,521 @@ public async Task TestGetPartitionRoutingInfo() } } } + [TestMethod] + public async Task TestRoutingForPrefixedPartitionKeyQueriesAsync() + { + PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() + { + Kind = PartitionKind.MultiHash, + Paths = new Collection() { "/path1", "/path2", "/path3" }, + Version = PartitionKeyDefinitionVersion.V2 + }; + + // Case 1: Query with 1 prefix path, split at 1st level. Should route to only one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //Seattle + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //Seattle + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"Microsoft\"", + epkRanges => + { + return epkRanges.Count == 1; //Routes to only one pkRange. + }, + partitionKeyRanges); + } + + //Case 2: Query with 1 prefix path value which is split at 2nd level. Should route to two partitions. + //Case 3: Query with 2 prefix path values which is split at 2nd level. Should route to one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[Seattle, Redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963",//[Seattle, Redmond] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" or (r.path1 = \"seattle\" and r.path2 = \"bellevue\")", + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 =\"redmond\"", + epkRanges => + { + return epkRanges.Count == 1; //Since data is split at pkey [seattle, redmond], this query should route to one pkRange + }, + partitionKeyRanges); + } + + //Case 4: Query with 2 prefix path values split at the 3rd level. Should route to 2 paritions. + //Case 5: Query with 1 prefix path value split at 3rd level. Should route to 2 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8",//[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 =\"redmond\"", + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond, 5.12312419050912359123], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 =\"redmond\" and r.path3=5.12312419050912359123", + epkRanges => + { + return epkRanges.Count == 1; + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\"", + epkRanges => + { + return epkRanges.Count == 2; + }, + partitionKeyRanges); + } + + //Case 6: Query with 1 prefix path value split succesively at 2nd and then at the 3rd level. Should route to 3 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963"//[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963",//[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8",//[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\"", + epkRanges => + { + return epkRanges.Count == 3; + }, + partitionKeyRanges); + } + + //Case 7: Query with 1 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 3 partitions. + //Case 8: Query with 2 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 2 partitions. + //Case 9: Query with fully specfied pkey, split succesively at 1st, 2nd and then at the 3rd level. Should route to 1 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //[seattle] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //[seattle] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "3", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8",//[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\"", + epkRanges => + { + return epkRanges.Count == 3; //Routes tp three pkRanges + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 = \"redmond\"", + epkRanges => + { + return epkRanges.Count == 2; //Routes to two pkRanges. + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 = \"redmond\" and r.path3 = \"98052\"", + epkRanges => + { + Assert.AreEqual(epkRanges.Count, 1); + + return epkRanges.Count == 1; //Routes to only one pkRanges. + }, + partitionKeyRanges); + } + } + + [TestMethod] + public async Task TestRoutingForPrefixedPartitionKeyChangeFeedAsync() + { + PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() + { + Kind = PartitionKind.MultiHash, + Paths = new Collection() { "/path1", "/path2", "/path3" }, + Version = PartitionKeyDefinitionVersion.V2 + }; + + // Case 1: ChangeFeed with 1 prefix path, split at 1st level. Should route to only one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //Seattle + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //Seattle + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("Microsoft").Build(), + epkRanges => + { + return epkRanges.Count == 1; //Routes to only one pkRange. + }, + partitionKeyRanges); + } + + //Case 2: ChangeFeed with 1 prefix path value which is split at 2nd level. Should route to two partitions. + //Case 3: ChangeFeed with 2 prefix path values which is split at 2nd level. Should route to one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[Seattle, Redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[Seattle, Redmond] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Build(), + epkRanges => + { + return epkRanges.Count == 1; //Since data is split at pkey [seattle, redmond], this query should route to one pkRange + }, + partitionKeyRanges); + } + + //Case 4: ChangeFeed with 2 prefix path values split at the 3rd level. Should route to 2 paritions. + //Case 5: ChangeFeed with 1 prefix path value split at 3rd level. Should route to 2 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8", //[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Build(), + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond, 5.12312419050912359123], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Add(5.12312419050912359123).Build(), + epkRanges => + { + return epkRanges.Count == 1; + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 2; + }, + partitionKeyRanges); + } + + //Case 6: ChangeFeed with 1 prefix path value split succesively at 2nd and then at the 3rd level. Should route to 3 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8" //[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8", //[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 3; + }, + partitionKeyRanges); + } + + //Case 7: ChangeFeed with 1 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 3 partitions. + //Case 8: ChangeFeed with 2 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 2 partitions. + //Case 9: ChangeFeed with fully specfied pkey, split succesively at 1st, 2nd and then at the 3rd level. Should route to 1 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //[seattle] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //[seattle] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "3", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8", //[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 3; //Routes tp three pkRanges + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Build(), + epkRanges => + { + return epkRanges.Count == 2; //Routes to two pkRanges. + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Add("98052").Build(), + epkRanges => + { + Assert.AreEqual(epkRanges.Count, 1); + + return epkRanges.Count == 1; //Routes to only one pkRanges. + }, + partitionKeyRanges); + } + } + + private static async Task PrefixPartitionKeyTestRunnerAsync( + PartitionKeyDefinition partitionKeyDefinition, + string queryText, + Predicate> validator, + List partitionKeyRanges) + { + IDictionary DefaultQueryengineConfiguration = new Dictionary() + { + {"maxSqlQueryInputLength", 30720}, + {"maxJoinsPerSqlQuery", 5}, + {"maxLogicalAndPerSqlQuery", 200}, + {"maxLogicalOrPerSqlQuery", 200}, + {"maxUdfRefPerSqlQuery", 2}, + {"maxInExpressionItemsCount", 8000}, + {"queryMaxInMemorySortDocumentCount", 500}, + {"maxQueryRequestTimeoutFraction", 0.90}, + {"sqlAllowNonFiniteNumbers", false}, + {"sqlAllowAggregateFunctions", true}, + {"sqlAllowSubQuery", true}, + {"sqlAllowScalarSubQuery", false}, + {"allowNewKeywords", true}, + {"sqlAllowLike", true}, + {"sqlAllowGroupByClause", false}, + {"queryEnableMongoNativeRegex", true}, + {"maxSpatialQueryCells", 12}, + {"spatialMaxGeometryPointCount", 256}, + {"sqlDisableOptimizationFlags", 0}, + {"sqlEnableParameterExpansionCheck", true} + }; + + QueryPartitionProvider QueryPartitionProvider = new QueryPartitionProvider(DefaultQueryengineConfiguration); + + IEnumerable> rangesAndServiceIdentity = partitionKeyRanges + .Select(range => Tuple.Create(range, (ServiceIdentity)null)); + string collectionRid = string.Empty; + CollectionRoutingMap routingMap = + CollectionRoutingMap.TryCreateCompleteRoutingMap( + rangesAndServiceIdentity, + collectionRid); + + RoutingMapProvider routingMapProvider = new RoutingMapProvider(routingMap); + TryCatch tryGetQueryPlan = + QueryPartitionProvider.TryGetPartitionedQueryExecutionInfo( + querySpecJsonString: JsonConvert.SerializeObject(new SqlQuerySpec(queryText)), + partitionKeyDefinition: partitionKeyDefinition, + requireFormattableOrderByQuery: true, + isContinuationExpected: true, + allowNonValueAggregateQuery: false, + hasLogicalPartitionKey: false, + allowDCount: true, + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); + + HashSet resolvedPKRanges = new HashSet(); + foreach (Range range in tryGetQueryPlan.Result.QueryRanges) + { + resolvedPKRanges.UnionWith(await routingMapProvider.TryGetOverlappingRangesAsync( + collectionRid, + range, + NoOpTrace.Singleton)); + } + + Assert.IsTrue(validator(resolvedPKRanges)); + } + + private static async Task PrefixPartitionKeyChangeFeedTestRunnerAsync( + PartitionKeyDefinition partitionKeyDefinition, + Cosmos.PartitionKey partitionKey, + Predicate> validator, + List partitionKeyRanges) + { + IEnumerable> rangesAndServiceIdentity = partitionKeyRanges + .Select(range => Tuple.Create(range, (ServiceIdentity)null)); + string collectionRid = string.Empty; + CollectionRoutingMap routingMap = + CollectionRoutingMap.TryCreateCompleteRoutingMap( + rangesAndServiceIdentity, + collectionRid); + + RoutingMapProvider routingMapProvider = new RoutingMapProvider(routingMap); + + HashSet resolvedPKRanges = new HashSet(); + FeedRangePartitionKey feedRangePartitionKey = new FeedRangePartitionKey(partitionKey); + List> effectiveRanges = await feedRangePartitionKey.GetEffectiveRangesAsync(routingMapProvider, null, partitionKeyDefinition, null); + foreach (Range range in effectiveRanges) + { + resolvedPKRanges.UnionWith(await routingMapProvider.TryGetOverlappingRangesAsync( + collectionRid, + range, + NoOpTrace.Singleton)); + + } + + Assert.IsTrue(validator(resolvedPKRanges)); + } [TestMethod] public void TestCrossPartitionAggregateQueries() diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs index 239de170de..2e8df92318 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs @@ -339,7 +339,7 @@ public void AccountPropertiesDeserializeWithAdditionalDataTest() [TestMethod] public void ContainerPropertiesDeserializeWithAdditionalDataTest() { - string cosmosSerialized = "{\"indexingPolicy\":{\"automatic\":true,\"indexingMode\":\"Consistent\",\"additionalIndexPolicy\":\"indexpolicyvalue\",\"includedPaths\":[{\"path\":\"/included/path\",\"additionalIncludedPath\":\"includedPathValue\",\"indexes\":[]}],\"excludedPaths\":[{\"path\":\"/excluded/path\",\"additionalExcludedPath\":\"excludedPathValue\"}],\"compositeIndexes\":[[{\"path\":\"/composite/path\",\"additionalCompositeIndex\":\"compositeIndexValue\",\"order\":\"ascending\"}]],\"spatialIndexes\":[{\"path\":\"/spatial/path\",\"additionalSpatialIndexes\":\"spatialIndexValue\",\"types\":[]}]},\"geospatialConfig\":{\"type\":\"Geography\",\"additionalGeospatialConfig\":\"geospatialConfigValue\"},\"uniqueKeyPolicy\":{\"additionalUniqueKeyPolicy\":\"uniqueKeyPolicyValue\",\"uniqueKeys\":[{\"paths\":[\"/unique/key/path/1\",\"/unique/key/path/2\"]}]},\"conflictResolutionPolicy\":{\"mode\":\"LastWriterWins\",\"additionalConflictResolutionPolicy\":\"conflictResolutionValue\"},\"clientEncryptionPolicy\":{\"includedPaths\":[{\"path\":\"/path\",\"clientEncryptionKeyId\":\"clientEncryptionKeyId\",\"encryptionType\":\"Randomized\",\"additionalIncludedPath\":\"includedPathValue\",\"encryptionAlgorithm\":\"AEAD_AES_256_CBC_HMAC_SHA256\"}],\"policyFormatVersion\":1,\"additionalEncryptionPolicy\":\"clientEncryptionpolicyValue\"},\"id\":\"2a9f501b-6948-4795-8fd1-797defb5c466\",\"partitionKey\":{\"paths\":[],\"kind\":\"Hash\"}}"; + string cosmosSerialized = "{\"indexingPolicy\":{\"automatic\":true,\"indexingMode\":\"Consistent\",\"additionalIndexPolicy\":\"indexpolicyvalue\",\"includedPaths\":[{\"path\":\"/included/path\",\"additionalIncludedPath\":\"includedPathValue\",\"indexes\":[]}],\"excludedPaths\":[{\"path\":\"/excluded/path\",\"additionalExcludedPath\":\"excludedPathValue\"}],\"compositeIndexes\":[[{\"path\":\"/composite/path\",\"additionalCompositeIndex\":\"compositeIndexValue\",\"order\":\"ascending\"}]],\"spatialIndexes\":[{\"path\":\"/spatial/path\",\"additionalSpatialIndexes\":\"spatialIndexValue\",\"types\":[]}]},\"computedProperties\":[{\"name\":\"lowerName\",\"query\":\"SELECT VALUE LOWER(c.name) FROM c\"},{\"name\":\"estimatedTax\",\"query\":\"SELECT VALUE c.salary * 0.2 FROM c\"}],\"geospatialConfig\":{\"type\":\"Geography\",\"additionalGeospatialConfig\":\"geospatialConfigValue\"},\"uniqueKeyPolicy\":{\"additionalUniqueKeyPolicy\":\"uniqueKeyPolicyValue\",\"uniqueKeys\":[{\"paths\":[\"/unique/key/path/1\",\"/unique/key/path/2\"]}]},\"conflictResolutionPolicy\":{\"mode\":\"LastWriterWins\",\"additionalConflictResolutionPolicy\":\"conflictResolutionValue\"},\"clientEncryptionPolicy\":{\"includedPaths\":[{\"path\":\"/path\",\"clientEncryptionKeyId\":\"clientEncryptionKeyId\",\"encryptionType\":\"Randomized\",\"additionalIncludedPath\":\"includedPathValue\",\"encryptionAlgorithm\":\"AEAD_AES_256_CBC_HMAC_SHA256\"}],\"policyFormatVersion\":1,\"additionalEncryptionPolicy\":\"clientEncryptionpolicyValue\"},\"id\":\"2a9f501b-6948-4795-8fd1-797defb5c466\",\"partitionKey\":{\"paths\":[],\"kind\":\"Hash\"}}"; JObject complexObject = JObject.FromObject(new { id = 1, name = new { fname = "fname", lname = "lname" } }); @@ -351,43 +351,49 @@ public void ContainerPropertiesDeserializeWithAdditionalDataTest() // Serialized string cosmosSerialized = SettingsContractTests.CosmosSerialize(jobject); - ContainerProperties containerDeserSettings = SettingsContractTests.CosmosDeserialize(cosmosSerialized); + ContainerProperties containerProperties = SettingsContractTests.CosmosDeserialize(cosmosSerialized); - Assert.AreEqual("2a9f501b-6948-4795-8fd1-797defb5c466", containerDeserSettings.Id); + Assert.AreEqual("2a9f501b-6948-4795-8fd1-797defb5c466", containerProperties.Id); - Assert.AreEqual(2, containerDeserSettings.AdditionalProperties.Count); - Assert.AreEqual("policy value", (string)containerDeserSettings.AdditionalProperties["simple string"]); - Assert.AreEqual(complexObject.ToString(), JObject.FromObject(containerDeserSettings.AdditionalProperties["complex object"]).ToString()); + Assert.AreEqual(2, containerProperties.AdditionalProperties.Count); + Assert.AreEqual("policy value", (string)containerProperties.AdditionalProperties["simple string"]); + Assert.AreEqual(complexObject.ToString(), JObject.FromObject(containerProperties.AdditionalProperties["complex object"]).ToString()); + + Assert.AreEqual(1, containerProperties.IndexingPolicy.AdditionalProperties.Count); + Assert.AreEqual("indexpolicyvalue", containerProperties.IndexingPolicy.AdditionalProperties["additionalIndexPolicy"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.AdditionalProperties.Count); - Assert.AreEqual("indexpolicyvalue", containerDeserSettings.IndexingPolicy.AdditionalProperties["additionalIndexPolicy"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.SpatialIndexes[0].AdditionalProperties.Count); + Assert.AreEqual("spatialIndexValue", containerProperties.IndexingPolicy.SpatialIndexes[0].AdditionalProperties["additionalSpatialIndexes"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.SpatialIndexes[0].AdditionalProperties.Count); - Assert.AreEqual("spatialIndexValue", containerDeserSettings.IndexingPolicy.SpatialIndexes[0].AdditionalProperties["additionalSpatialIndexes"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties.Count); + Assert.AreEqual("compositeIndexValue", containerProperties.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties["additionalCompositeIndex"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties.Count); - Assert.AreEqual("compositeIndexValue", containerDeserSettings.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties["additionalCompositeIndex"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.IncludedPaths[0].AdditionalProperties.Count); + Assert.AreEqual("includedPathValue", containerProperties.IndexingPolicy.IncludedPaths[0].AdditionalProperties["additionalIncludedPath"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.IncludedPaths[0].AdditionalProperties.Count); - Assert.AreEqual("includedPathValue", containerDeserSettings.IndexingPolicy.IncludedPaths[0].AdditionalProperties["additionalIncludedPath"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.ExcludedPaths[0].AdditionalProperties.Count); + Assert.AreEqual("excludedPathValue", containerProperties.IndexingPolicy.ExcludedPaths[0].AdditionalProperties["additionalExcludedPath"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.ExcludedPaths[0].AdditionalProperties.Count); - Assert.AreEqual("excludedPathValue", containerDeserSettings.IndexingPolicy.ExcludedPaths[0].AdditionalProperties["additionalExcludedPath"]); + Assert.AreEqual(1, containerProperties.GeospatialConfig.AdditionalProperties.Count); + Assert.AreEqual("geospatialConfigValue", containerProperties.GeospatialConfig.AdditionalProperties["additionalGeospatialConfig"]); - Assert.AreEqual(1, containerDeserSettings.GeospatialConfig.AdditionalProperties.Count); - Assert.AreEqual("geospatialConfigValue", containerDeserSettings.GeospatialConfig.AdditionalProperties["additionalGeospatialConfig"]); + Assert.AreEqual(1, containerProperties.UniqueKeyPolicy.AdditionalProperties.Count); + Assert.AreEqual("uniqueKeyPolicyValue", containerProperties.UniqueKeyPolicy.AdditionalProperties["additionalUniqueKeyPolicy"]); - Assert.AreEqual(1, containerDeserSettings.UniqueKeyPolicy.AdditionalProperties.Count); - Assert.AreEqual("uniqueKeyPolicyValue", containerDeserSettings.UniqueKeyPolicy.AdditionalProperties["additionalUniqueKeyPolicy"]); + Assert.AreEqual(1, containerProperties.ConflictResolutionPolicy.AdditionalProperties.Count); + Assert.AreEqual("conflictResolutionValue", containerProperties.ConflictResolutionPolicy.AdditionalProperties["additionalConflictResolutionPolicy"]); - Assert.AreEqual(1, containerDeserSettings.ConflictResolutionPolicy.AdditionalProperties.Count); - Assert.AreEqual("conflictResolutionValue", containerDeserSettings.ConflictResolutionPolicy.AdditionalProperties["additionalConflictResolutionPolicy"]); + Assert.AreEqual(1, containerProperties.ClientEncryptionPolicy.AdditionalProperties.Count); + Assert.AreEqual("clientEncryptionpolicyValue", containerProperties.ClientEncryptionPolicy.AdditionalProperties["additionalEncryptionPolicy"]); - Assert.AreEqual(1, containerDeserSettings.ClientEncryptionPolicy.AdditionalProperties.Count); - Assert.AreEqual("clientEncryptionpolicyValue", containerDeserSettings.ClientEncryptionPolicy.AdditionalProperties["additionalEncryptionPolicy"]); + Assert.AreEqual(1, containerProperties.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties.Count); + Assert.AreEqual("includedPathValue", containerProperties.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties["additionalIncludedPath"]); - Assert.AreEqual(1, containerDeserSettings.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties.Count); - Assert.AreEqual("includedPathValue", containerDeserSettings.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties["additionalIncludedPath"]); + Assert.AreEqual(2, containerProperties.ComputedProperties.Count); + Assert.AreEqual("lowerName", containerProperties.ComputedProperties[0].Name); + Assert.AreEqual("SELECT VALUE LOWER(c.name) FROM c", containerProperties.ComputedProperties[0].Query); + Assert.AreEqual("estimatedTax", containerProperties.ComputedProperties[1].Name); + Assert.AreEqual("SELECT VALUE c.salary * 0.2 FROM c", containerProperties.ComputedProperties[1].Query); } [TestMethod] @@ -724,6 +730,7 @@ public void ContainerSettingsDefaults() "TimeToLivePropertyPath", "PartitionKeyPath", "PartitionKeyDefinitionVersion", + "ComputedProperties", "ConflictResolutionPolicy", "ChangeFeedPolicy", "ClientEncryptionPolicy", @@ -762,6 +769,10 @@ public void ContainerSettingsDefaults() Assert.IsNotNull(cosmosContainerSettings.IndexingPolicy.IncludedPaths); Assert.IsTrue(object.ReferenceEquals(cosmosContainerSettings.IndexingPolicy.IncludedPaths, cosmosContainerSettings.IndexingPolicy.IncludedPaths)); + Assert.IsNotNull(cosmosContainerSettings.ComputedProperties); + Assert.AreEqual(0, cosmosContainerSettings.ComputedProperties.Count); + Assert.IsTrue(object.ReferenceEquals(cosmosContainerSettings.ComputedProperties, cosmosContainerSettings.ComputedProperties)); + Cosmos.IncludedPath ip = new Cosmos.IncludedPath(); Assert.IsNotNull(ip.Indexes); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs index 2ec6e9db62..a28300d82f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs @@ -48,7 +48,7 @@ public async Task ConcurrentUpdateHttpResponseStatisticsListTests() [TestMethod] public void DuplicateContactedReplicasTests() { - ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(DuplicateContactedReplicasTests))); clientSideRequestStatisticsTraceDatum.ContactedReplicas.Add(new TransportAddressUri(new Uri("http://storephysicaladdress1.com"))); clientSideRequestStatisticsTraceDatum.ContactedReplicas.Add(new TransportAddressUri(new Uri("http://storephysicaladdress2.com"))); clientSideRequestStatisticsTraceDatum.ContactedReplicas.Add(new TransportAddressUri(new Uri("http://storephysicaladdress2.com"))); @@ -89,7 +89,7 @@ public async Task ConcurrentUpdateStoreResponseStatisticsListTests() [TestMethod] public void VerifyIClientSideRequestStatisticsNullTests() { - IClientSideRequestStatistics clientSideRequestStatistics = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new Cosmos.Tracing.TraceSummary()); + IClientSideRequestStatistics clientSideRequestStatistics = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(VerifyIClientSideRequestStatisticsNullTests))); Assert.IsNotNull(clientSideRequestStatistics.ContactedReplicas); Assert.IsNotNull(clientSideRequestStatistics.FailedReplicas); Assert.IsNotNull(clientSideRequestStatistics.RegionsContacted); @@ -101,7 +101,7 @@ private async Task ConcurrentUpdateTestHelper( { using CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new Cosmos.Tracing.TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(ConcurrentUpdateTestHelper))); Task backgroundTask = Task.Run(() => backgroundUpdater(datum, cancellationTokenSource.Token)); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs index 6f6a84cbe2..53a04e5228 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs @@ -54,7 +54,7 @@ private ITrace CreateTestTraceTree() private TraceDatum GetDatumObject(string regionName1, string regionName2 = null) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(ContactedRegionsTests))); Uri uri1 = new Uri("http://someUri1.com"); datum.RegionsContacted.Add((regionName1, uri1)); if (regionName2 != null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs index ff27842308..7c0cca1f95 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs @@ -97,7 +97,7 @@ public void ValidateStoreResultSerialization() HashSet storeResultProperties = typeof(StoreResult).GetProperties(BindingFlags.Public | BindingFlags.Instance).Select(x => x.Name).ToHashSet(); string datumKey = "ClientStats"; Trace trace = Trace.GetRootTrace("Test"); - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); trace.AddDatum(datumKey, datum); ReferenceCountedDisposable storeResult = StoreResult.CreateForTesting(storeResponse: new StoreResponse()); @@ -125,8 +125,6 @@ public void ValidateStoreResultSerialization() storeResultProperties.Remove(nameof(storeResult.Target.Exception)); storeResultProperties.Add("transportRequestTimeline"); storeResultProperties.Remove(nameof(storeResult.Target.TransportRequestStats)); - storeResultProperties.Add("ReplicaHealthStatuses"); - storeResultProperties.Remove(nameof(storeResult.Target.ReplicaHealthStatuses)); foreach (string key in jsonPropertyNames) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs index 67bafdbf56..fe3dc7054f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs @@ -336,7 +336,7 @@ public void TraceData() TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TransportAddressUri uri1 = new TransportAddressUri(new Uri("http://someUri1.com")); TransportAddressUri uri2 = new TransportAddressUri(new Uri("http://someUri2.com")); @@ -382,7 +382,7 @@ public void TraceData() TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); datum.ContactedReplicas.Add(default); TraceWriterBaselineTests.GetPrivateField>(datum, "endpointToAddressResolutionStats").Add("asdf", default); @@ -416,7 +416,7 @@ public void TraceData() TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TraceWriterBaselineTests.SetEndRequestTime(datum,DateTime.MaxValue); HttpResponseStatistics httpResponseStatistics = new HttpResponseStatistics( diff --git a/changelog.md b/changelog.md index 709a4bfccf..bd5c29c32c 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,52 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 + +### Added +- [3836](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3836) Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions +- [3909](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3909) Query: Adds EnableOptimisticDirectExecution in QueryRequestOptions enabled by default + +### [3.35.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0) - 2023-06-19 + +#### Fixed +- [3864](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3864) NugetPackage: Removes ThirdPartyNotice.txt from content and contentFiles folders +- [3866](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3866) CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 +- [3879](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3879) Subpartitioning: Fixes handling of split physical partitions +- [3907](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3907) Query: Fixes empty property name parsing exception + +#### Added +- [3860](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3860) Documentation: Adds see also link to Container.CreateTransactionalBatch +- [3852](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3852) Query: Adds type-markers with count and length for large arrays +- [3838](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3838) Benchmarking: Adds use of ARM Templates for benchmarking +- [3877](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3877) Regions: Adds Malaysia South, Isreal Central, and Italy North +- [3887](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3887) Distributed Tracing: Setting DisplayName for an operation level activity as `` +- [3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 +- [3891](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3891) Documentation: Adds additional remarks to CosmosClient +- [3902](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3902) ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds +- [3910](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3910) Documentations: Adds links to PatchItems docs +- [3918](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3918) Regions: Adds Israel Central +- [3918](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3918) CosmosClient: Fixes SynchronizationLockException when disposing client with requests in-flight. + +### [3.34.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0-preview) - 2023-05-17 + +### Added +- [3761](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3761) Query: Adds Computed Property SDK Support + +#### Fixed +- [3845](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3845) AI Integration: Fixes Operation Name in the activity and end to end Tests. + +### [3.34.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0) - 2023-05-17 + +#### Fixed +- [3847](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3847) PackageLicense: Replaces PackageLicenseUrl with PackageLicenseFile since PackageLicenseUrl is deprecated +- [3832](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3832) Query: Fixes format exception when using culture and partitionKey, difference between Windows and Linux + +#### Added +- [3854](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3854) Change Feed: Adds LatestVersion to ChangeFeedMode +- [3833](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3833) Query: Adds TRIM string system function support in LINQ +- [3826](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3826) Query: Adds support for Lambda expression reuse in LINQ +- [3724](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3724) Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions. Thanks @onionhammer. ### [3.33.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview) - 2023-04-21 diff --git a/docs/observability.md b/docs/observability.md new file mode 100644 index 0000000000..50ce14d33c --- /dev/null +++ b/docs/observability.md @@ -0,0 +1,107 @@ +# .NET SDK Observability Feature Design + +## Distributed Tracing (Preview) + +**Source to capture operation level activities**: _Azure.Cosmos.Operation_\ +**Source to capture event with request diagnostics** : _Azure-Cosmos-Operation-Request-Diagnostics_ + +For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet) + +```mermaid +flowchart TD + classDef orange fill:#f96 + classDef blue fill:#6fa8dc + subgraph ClientContextCore + OpenTelemetryRecorderFactory --> CheckFeatureFlag{isDistributedTracing Enabled?} + CheckFeatureFlag --> |Yes| CreateActivity(Start an Activity or Child activity
with preloaded attributes) + CreateActivity --> HandlerPipeline{Handler Pipeline} + GetResponse --> TriggerDispose(Trigger Dispose of Diagnostic Scope) + subgraph Dispose + TriggerDispose --> CheckLatencyThreshold{Is high latency/errored response?} + CheckLatencyThreshold -- Yes --> GenerateEvent(Generate Warning or Error Event With Request Diagnostics) --> StopActivity + CheckLatencyThreshold -- No --> StopActivity + end + StopActivity --> SendResponse(Send Response to Caller):::blue + end + OperationRequest[Operation Request]:::blue --> ClientContextCore + subgraph Application + OperationCall(User Application):::orange + end + OperationCall(User Application):::orange --> OperationRequest + CheckFeatureFlag --> |No| HandlerPipeline + HandlerPipeline --> OtherLogic(Goes through TCP/HTTP calls
based on Connection Mode):::blue + OtherLogic --> GetResponse(Get Response for the request) + SendResponse --> OperationCall + +``` + +## Send telemetry from SDK to service (Private Preview) + +### Introduction +When opted-in CosmosDB SDK collects below aggregated telemetry data every 10 minutes to Azure CosmosDB service. +1. Operation(Point, Stream, Batch and Query APIs) Latencies and Request Units (RUs). +2. Metadata caches (ex: CollectionCache) miss statistics +3. Host Resource Usage: (during an operation) : + * CPU usage + * Memory Usage + * Thread Starvation + * Network Connections Opened (only TCP Connections) +4. TOP 10 slowest network interactions per endpoint + +> Note: We don't collect any PII data as part of this feature. + +### Benefits +Enabling this feature provides numerous benefits. The telemetry data collected will allow us to identify and address potential issues. This results in a superior support experience and ensures that some issues can even be resolved before they impact your application. In short, customers with this feature enabled can expect a smoother and more reliable support experience. + +### Impact of this feature enabled +* _Latency_: Customer should not see any impact on latency. +* _Total RPS_: It depends on the infrastructure the application using SDK is hosted on among other factors but the impact should not exceed 10%. +* _Any other impact_: Collector needs around 18MB of in-memory storage to hold the data and this storage is always constant (it means it doesn't grow, no matter how much data we have) +* Benchmark Numbers: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json + +### Components + +**Telemetry Job:** Background task which collects the data and sends it to a Azure CosmosDB service every 10 minutes. + +**Collectors:** In-memory storage which keeps the telemetry data collected during an operation. There are 3 types of collectors including: +* _Operational Data Collector_: It keeps operation level latencies and request units. +* _Network Data Collector_: It keeps all the metrics related to network or TCP calls. It has its own Sampler which sample-in only slowest TCP calls for a particular replica. +* _Cache Data Collector_: It keeps all the cache call latencies. Right now, only collection cache is covered. + +**Get VM Information**: + +- Azure VM: [Azure Instance Metadata](https://learn.microsoft.com/azure/virtual-machines/instance-metadata-service?tabs=windows) call. +- Non-Azure VM: We don't collect any other information except VMID which will a Guid or Hashed Machine Name. + +**Processor**: Its responsibility is to get all the data and divide it into small chunks (<2MB) and send each chunk to the Azure CosmosDB service. + +```mermaid +flowchart TD + subgraph TelemetryJob[Telemetry Background Job] + subgraph Storage[In Memory Storage or Collectors] + subgraph NetworkDataCollector[Network Data Collector] + TcpDatapoint(Network Request Datapoint) --> NetworkHistogram[(Histogram)] + DataSampler(Sampler) + end + subgraph DataCollector[Operational Data Collector] + OpsDatapoint(Operation Datapoint) --> OperationHistogram[(Histogram)] + end + subgraph CacheCollector[Cache Data Collector] + CacheDatapoint(Cache Request Datapoint) --> CacheHistogram[(Histogram)] + end + end + subgraph TelemetryTask[Telemetry Task Every 10 min] + CacheAccountInfo(Cached Account Properties) --> VMInfo + VMInfo(Get VM Information) --> CollectSystemUsage + CollectSystemUsage(Record System Usage Information) --> GetDataFromCollector + end + subgraph Processor + GetDataFromCollector(Fetch Data from Collectors) --> Serializer + Serializer(Serialize and divide the Payload) --> SendCTOverHTTP(Send Data over HTTP to Service) + end + Storage --> |Get Aggregated data|GetDataFromCollector + end +``` + +### Limitations +1. AAD Support is not available. \ No newline at end of file