From 8586467a4d1c82f955964400540407d505c1a9da Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 16 Aug 2024 16:08:53 +0530 Subject: [PATCH 01/22] Changed Operation name according to open telemetry convention --- Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs | 23 +- .../src/Batch/ItemBatchOperation.cs | 12 +- .../src/Batch/TransactionalBatchInternal.cs | 6 +- .../src/ChangeFeed/ChangeFeedIteratorCore.cs | 3 +- ...geFeedPartitionKeyResultSetIteratorCore.cs | 3 +- .../ChangeFeedEstimatorIterator.cs | 3 +- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 13 +- .../src/Resource/ClientContextCore.cs | 2 + .../ClientEncryptionKeyInlineCore.cs | 5 +- .../Resource/Conflict/ConflictsInlineCore.cs | 5 +- .../Resource/Container/ContainerInlineCore.cs | 61 +-- .../Resource/Database/DatabaseInlineCore.cs | 39 +- .../FeedIterators/FeedIteratorInlineCore.cs | 3 +- .../FeedIteratorInlineCore{T}.cs | 3 +- .../Permission/PermissionInlineCore.cs | 7 +- .../src/Resource/Scripts/ScriptsInlineCore.cs | 31 +- .../src/Resource/User/UserInlineCore.cs | 11 +- .../OpenTelemetry/OpenTelemetryAttributes.cs | 23 - .../OpenTelemetry/OpenTelemetryConstants.cs | 137 ++++++ .../OpenTelemetryCoreRecorder.cs | 7 - .../OpenTelemetry/OpenTelemetryResponse.cs | 9 +- ...iterBaselineTests.BatchOperationsAsync.xml | 18 +- ...riterBaselineTests.BulkOperationsAsync.xml | 448 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 156 +++--- ...eWriterBaselineTests.MiscellanousAsync.xml | 24 +- ...neTests.PointOperationsExceptionsAsync.xml | 48 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 224 ++++----- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 128 ++--- ...selineTests.StreamPointOperationsAsync.xml | 32 +- ...aselineTests.TypedPointOperationsAsync.xml | 32 +- ...ndexUtilizationClientSideExistenceTest.xml | 64 +-- ...eTest.IndexUtilizationHeaderLengthTest.xml | 8 +- ...rserBaselineTest.IndexUtilizationParse.xml | 22 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 9 +- .../ClientTelemetryTestsBase.cs | 3 +- .../Batch/BatchAsyncBatcherTests.cs | 5 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 2 + .../Batch/BatchAsyncOperationContextTests.cs | 31 +- .../Batch/BatchAsyncStreamerTests.cs | 7 +- .../Batch/BatchRequestPayloadReader.cs | 2 + .../Batch/BatchSchemaTests.cs | 8 +- .../Batch/PartitionKeyBatchResponseTests.cs | 5 +- ...titionKeyRangeBatchExecutionResultTests.cs | 5 +- ...artitionKeyRangeServerBatchRequestTests.cs | 5 +- .../Telemetry/OpenTelemetryRecorderTests.cs | 7 +- 45 files changed, 930 insertions(+), 769 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index cecf1fd778..c0d831faf4 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos using System.Linq; using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; internal class BatchCore : TransactionalBatchInternal @@ -41,6 +42,7 @@ public override TransactionalBatch CreateItem( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: this.operations.Count, resource: item, @@ -60,6 +62,7 @@ public override TransactionalBatch CreateItemStream( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItemStream, operationType: OperationType.Create, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -79,6 +82,7 @@ public override TransactionalBatch ReadItem( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.ReadItem, operationType: OperationType.Read, operationIndex: this.operations.Count, id: id, @@ -98,6 +102,7 @@ public override TransactionalBatch UpsertItem( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.UpsertItem, operationType: OperationType.Upsert, operationIndex: this.operations.Count, resource: item, @@ -117,6 +122,7 @@ public override TransactionalBatch UpsertItemStream( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.UpsertItemStream, operationType: OperationType.Upsert, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -142,6 +148,7 @@ public override TransactionalBatch ReplaceItem( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.ReplaceItem, operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -168,6 +175,7 @@ public override TransactionalBatch ReplaceItemStream( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.ReplaceItemStream, operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -188,6 +196,7 @@ public override TransactionalBatch DeleteItem( } this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.DeleteItem, operationType: OperationType.Delete, operationIndex: this.operations.Count, id: id, @@ -215,8 +224,14 @@ public override Task ExecuteAsync( TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken = default) { + string operationName = OpenTelemetryConstants.Operations.ExecuteBatch; + if (this.isHomogenousOperations) + { + operationName = OpenTelemetryConstants.Operations.ExecuteBatchPrefix + this.homogenousOperation; + } + return this.container.ClientContext.OperationHelperAsync( - operationName: nameof(ExecuteAsync), + operationName: operationName, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Batch, @@ -233,9 +248,7 @@ public override Task ExecuteAsync( return executor.ExecuteAsync(trace, cancellationToken); }, openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response, - isHomogenousOperations: this.isHomogenousOperations, - batchOperation: this.homogenousOperation)); + responseMessage: response)); } /// @@ -251,6 +264,7 @@ public virtual TransactionalBatch PatchItemStream( TransactionalBatchPatchItemRequestOptions requestOptions = null) { this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.PatchItemStream, operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, @@ -287,6 +301,7 @@ public override TransactionalBatch PatchItem( PatchSpec patchSpec = new PatchSpec(patchOperations, requestOptions); this.AddOperation(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, diff --git a/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs b/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs index 768b8f7762..eb1f7438cf 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs @@ -28,6 +28,7 @@ internal class ItemBatchOperation : IDisposable private bool isDisposed; public ItemBatchOperation( + string operationName, OperationType operationType, int operationIndex, PartitionKey partitionKey, @@ -43,9 +44,11 @@ public ItemBatchOperation( this.ResourceStream = resourceStream; this.RequestOptions = requestOptions; this.ClientContext = cosmosClientContext; + this.OperationName = operationName; } public ItemBatchOperation( + string operationName, OperationType operationType, int operationIndex, ContainerInternal containerCore, @@ -53,6 +56,7 @@ public ItemBatchOperation( Stream resourceStream = null, TransactionalBatchItemRequestOptions requestOptions = null) { + this.OperationName = operationName; this.OperationType = operationType; this.OperationIndex = operationIndex; this.ContainerInternal = containerCore; @@ -62,6 +66,8 @@ public ItemBatchOperation( this.ClientContext = containerCore.ClientContext; } + public string OperationName { get; internal set; } + public PartitionKey? PartitionKey { get; internal set; } public string Id { get; } @@ -304,6 +310,7 @@ internal class ItemBatchOperation : ItemBatchOperation #pragma warning restore SA1402 // File may only contain a single type { public ItemBatchOperation( + string operationName, OperationType operationType, int operationIndex, PartitionKey partitionKey, @@ -311,19 +318,20 @@ public ItemBatchOperation( string id = null, TransactionalBatchItemRequestOptions requestOptions = null, CosmosClientContext cosmosClientContext = null) - : base(operationType, operationIndex, partitionKey: partitionKey, id: id, requestOptions: requestOptions, cosmosClientContext: cosmosClientContext) + : base(operationName, operationType, operationIndex, partitionKey: partitionKey, id: id, requestOptions: requestOptions, cosmosClientContext: cosmosClientContext) { this.Resource = resource; } public ItemBatchOperation( + string operationName, OperationType operationType, int operationIndex, T resource, ContainerInternal containerCore, string id = null, TransactionalBatchItemRequestOptions requestOptions = null) - : base(operationType, operationIndex, containerCore: containerCore, id: id, requestOptions: requestOptions) + : base(operationName, operationType, operationIndex, containerCore: containerCore, id: id, requestOptions: requestOptions) { this.Resource = resource; } diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs index aa6c72189b..c5d8cfc338 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs @@ -36,7 +36,7 @@ public TransactionalBatchInternal() /// /// Stores the operation type if all operations in the batch are of the same type; otherwise, null. /// - internal OperationType? homogenousOperation = null; + internal string homogenousOperation = null; /// /// Adds an operation to the batch. @@ -52,8 +52,8 @@ protected void AddOperation(ItemBatchOperation itemBatchOperation) { if (this.isHomogenousOperations && this.operations.Count > 0) { - this.isHomogenousOperations = this.operations.First().OperationType == itemBatchOperation.OperationType; - this.homogenousOperation = this.isHomogenousOperations ? itemBatchOperation.OperationType : null; + this.isHomogenousOperations = this.operations.First().OperationName == itemBatchOperation.OperationName; + this.homogenousOperation = this.isHomogenousOperations ? itemBatchOperation.OperationName : null; } this.operations.Add(itemBatchOperation); } diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs index 637186a7c1..0c6bc862a0 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using Microsoft.Azure.Cosmos.Pagination; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Query.Core.Monads; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -220,7 +221,7 @@ public ChangeFeedIteratorCore( public override async Task ReadNextAsync(CancellationToken cancellationToken = default) { - return await this.clientContext.OperationHelperAsync("Change Feed Iterator Read Next Async", + return await this.clientContext.OperationHelperAsync(OpenTelemetryConstants.Operations.QueryChangeFeed, containerName: this.container?.Id, databaseName: this.container?.Database?.Id ?? this.databaseName, operationType: OperationType.ReadFeed, diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs index 0456fc1d87..e532fe5565 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -93,7 +94,7 @@ private ChangeFeedPartitionKeyResultSetIteratorCore( public override Task ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: "Change Feed Processor Read Next Async", + operationName: OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange, containerName: this.container?.Id, databaseName: this.container?.Database?.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs index 4d1fc6fd4a..c3a8ceeafc 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Query.Core.Monads; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Newtonsoft.Json.Linq; @@ -113,7 +114,7 @@ private ChangeFeedEstimatorIterator( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { return this.monitoredContainer.ClientContext.OperationHelperAsync( - operationName: "Change Feed Estimator Read Next Async", + operationName: OpenTelemetryConstants.Operations.QueryChangeFeedEstimator, containerName: this.monitoredContainer?.Id, databaseName: this.monitoredContainer?.Database?.Id, operationType: Documents.OperationType.ReadFeed, diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index 89c628635f..640899a974 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Handlers; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; @@ -650,7 +651,7 @@ internal CosmosClient( public virtual Task ReadAccountAsync() { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadAccountAsync), + operationName: OpenTelemetryConstants.Operations.ReadAccount, containerName: null, databaseName: null, operationType: OperationType.Read, @@ -739,7 +740,7 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseAsync), + operationName: OpenTelemetryConstants.Operations.CreateDatabase, containerName: null, databaseName: id, operationType: OperationType.Create, @@ -789,7 +790,7 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseAsync), + operationName: OpenTelemetryConstants.Operations.CreateDatabase, containerName: null, databaseName: id, operationType: OperationType.Create, @@ -848,7 +849,7 @@ public virtual Task CreateDatabaseIfNotExistsAsync( return string.IsNullOrEmpty(id) ? throw new ArgumentNullException(nameof(id)) : this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseIfNotExistsAsync), + operationName: OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, containerName: null, databaseName: id, operationType: OperationType.Create, @@ -1190,7 +1191,7 @@ public virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseStreamAsync), + operationName: OpenTelemetryConstants.Operations.CreateDatabaseStream, containerName: null, databaseName: databaseProperties.Id, operationType: OperationType.Create, @@ -1288,7 +1289,7 @@ internal virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseIfNotExistsAsync), + operationName: OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, containerName: null, databaseName: databaseProperties.Id, operationType: OperationType.Create, diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index a8cc0d59dc..1a0b7232c2 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -564,6 +565,7 @@ private async Task ProcessResourceOperationAsBulkStreamAsync( ItemRequestOptions itemRequestOptions = requestOptions as ItemRequestOptions; TransactionalBatchItemRequestOptions batchItemRequestOptions = TransactionalBatchItemRequestOptions.FromItemRequestOptions(itemRequestOptions); ItemBatchOperation itemBatchOperation = new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.ExecuteBatch, operationType: operationType, operationIndex: 0, partitionKey: partitionKey, diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs index 6d6305e30b..5553d3957b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; /// /// This class acts as a wrapper over for environments that use SynchronizationContext. @@ -29,7 +30,7 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadAsync), + operationName: OpenTelemetryConstants.Operations.ReadClientEncryptionKey, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -44,7 +45,7 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceClientEncryptionKey, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs index 17caba406e..8f219107da 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; // This class acts as a wrapper for environments that use SynchronizationContext. internal sealed class ConflictsInlineCore : ConflictsCore @@ -25,7 +26,7 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteAsync), + operationName: OpenTelemetryConstants.Operations.DeleteConflict, containerName: null, databaseName: null, operationType: Documents.OperationType.Delete, @@ -88,7 +89,7 @@ public override Task> ReadCurrentAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadCurrentAsync), + operationName: OpenTelemetryConstants.Operations.ReadConflict, containerName: null, databaseName: null, operationType: Documents.OperationType.Read, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index f3153a33cf..bfb97e3a22 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.QueryClient; using Microsoft.Azure.Cosmos.ReadFeed; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; // This class acts as a wrapper for environments that use SynchronizationContext. @@ -36,7 +37,7 @@ public override Task ReadContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadContainerAsync), + operationName: OpenTelemetryConstants.Operations.ReadContainer, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -50,7 +51,7 @@ public override Task ReadContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadContainerStreamAsync), + operationName: OpenTelemetryConstants.Operations.ReadContainerStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -65,7 +66,7 @@ public override Task ReplaceContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceContainerAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceContainer, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -80,7 +81,7 @@ public override Task ReplaceContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceContainerStreamAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceContainerStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -94,7 +95,7 @@ public override Task DeleteContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteContainerAsync), + operationName: OpenTelemetryConstants.Operations.DeleteContainer, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -108,7 +109,7 @@ public override Task DeleteContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteContainerStreamAsync), + operationName: OpenTelemetryConstants.Operations.DeleteContainerStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -120,7 +121,7 @@ public override Task DeleteContainerStreamAsync( public override Task ReadThroughputAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReadThroughput, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -133,7 +134,7 @@ public override Task ReadThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReadThroughput, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -148,7 +149,7 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -163,7 +164,7 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -175,7 +176,7 @@ public override Task ReplaceThroughputAsync( public override Task ReadThroughputIfExistsAsync(RequestOptions requestOptions, CancellationToken cancellationToken) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadThroughputIfExistsAsync), + operationName: OpenTelemetryConstants.Operations.ReadThroughputIfExists, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -187,7 +188,7 @@ public override Task ReadThroughputIfExistsAsync(RequestOpti public override Task ReplaceThroughputIfExistsAsync(ThroughputProperties throughput, RequestOptions requestOptions, CancellationToken cancellationToken) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceThroughputIfExistsAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceThroughputIfExists, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -213,7 +214,7 @@ Task func(ITrace trace) } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.CreateItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, @@ -228,7 +229,7 @@ public override Task> CreateItemAsync(T item, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateItemAsync), + operationName: OpenTelemetryConstants.Operations.CreateItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, @@ -244,7 +245,7 @@ public override Task ReadItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.ReadItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -260,7 +261,7 @@ public override Task> ReadItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadItemAsync), + operationName: OpenTelemetryConstants.Operations.ReadItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -276,7 +277,7 @@ public override Task UpsertItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(UpsertItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.UpsertItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, @@ -292,7 +293,7 @@ public override Task> UpsertItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(UpsertItemAsync), + operationName: OpenTelemetryConstants.Operations.UpsertItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, @@ -309,7 +310,7 @@ public override Task ReplaceItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -326,7 +327,7 @@ public override Task> ReplaceItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceItemAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -342,7 +343,7 @@ public override Task DeleteItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.DeleteItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -358,7 +359,7 @@ public override Task> DeleteItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteItemAsync), + operationName: OpenTelemetryConstants.Operations.DeleteItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -375,7 +376,7 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(PatchItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.PatchItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, @@ -392,7 +393,7 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(PatchItemStreamAsync), + operationName: OpenTelemetryConstants.Operations.PatchItemStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, @@ -409,7 +410,7 @@ public override Task> PatchItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(PatchItemAsync), + operationName: OpenTelemetryConstants.Operations.PatchItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, @@ -424,7 +425,7 @@ public override Task ReadManyItemsStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadManyItemsStreamAsync), + operationName: OpenTelemetryConstants.Operations.ReadManyItemsStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -439,7 +440,7 @@ public override Task> ReadManyItemsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadManyItemsAsync), + operationName: OpenTelemetryConstants.Operations.ReadManyItems, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -564,7 +565,7 @@ public override TransactionalBatch CreateTransactionalBatch(PartitionKey partiti public override Task> GetFeedRangesAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(GetFeedRangesAsync), + operationName: OpenTelemetryConstants.Operations.ReadFeedRanges, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.ReadFeed, @@ -596,7 +597,7 @@ public override Task> GetPartitionKeyRangesAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(GetPartitionKeyRangesAsync), + operationName: OpenTelemetryConstants.Operations.ReadPartitionKeyRanges, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -652,7 +653,7 @@ public override Task DeleteAllItemsByPartitionKeyStreamAsync( CancellationToken cancellationToken = default(CancellationToken)) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteAllItemsByPartitionKeyStreamAsync), + operationName: OpenTelemetryConstants.Operations.DeleteAllItemsByPartitionKeyStream, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs index fb25ef4190..0ba7fc2162 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Fluent; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; // This class acts as a wrapper for environments that use SynchronizationContext. internal sealed class DatabaseInlineCore : DatabaseCore @@ -27,7 +28,7 @@ public override Task CreateContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainer, containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -43,7 +44,7 @@ public override Task CreateContainerAsync(string id, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainer, containerName: id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -59,7 +60,7 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerIfNotExistsAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainerIfNotExists, containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -76,7 +77,7 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerIfNotExistsAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainerIfNotExists, containerName: id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -92,7 +93,7 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerStreamAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainerStream, containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -106,7 +107,7 @@ public override Task CreateUserAsync(string id, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateUserAsync), + operationName: OpenTelemetryConstants.Operations.CreateUser, containerName: id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -127,7 +128,7 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteAsync), + operationName: OpenTelemetryConstants.Operations.DeleteDatabase, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, @@ -141,7 +142,7 @@ public override Task DeleteStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteStreamAsync), + operationName: OpenTelemetryConstants.Operations.DeleteDatabaseStream, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, @@ -235,7 +236,7 @@ public override Task ReadAsync(RequestOptions requestOptions = CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadAsync), + operationName: OpenTelemetryConstants.Operations.ReadDatabase, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -249,7 +250,7 @@ public override Task ReadStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadStreamAsync), + operationName: OpenTelemetryConstants.Operations.ReadDatabaseStream, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -261,7 +262,7 @@ public override Task ReadStreamAsync( public override Task ReadThroughputAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReadThroughput, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -274,7 +275,7 @@ public override Task ReadThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReadThroughput, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -289,7 +290,7 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Replace, @@ -304,7 +305,7 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceThroughputAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Replace, @@ -320,7 +321,7 @@ public override Task CreateContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainer, containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -336,7 +337,7 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerIfNotExistsAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainerIfNotExists, containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -352,7 +353,7 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateContainerStreamAsync), + operationName: OpenTelemetryConstants.Operations.CreateContainerStream, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -367,7 +368,7 @@ public override Task UpsertUserAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(UpsertUserAsync), + operationName: OpenTelemetryConstants.Operations.UpsertUser, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Upsert, @@ -395,7 +396,7 @@ public override Task CreateClientEncryptionKeyAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateClientEncryptionKeyAsync), + operationName: OpenTelemetryConstants.Operations.CreateClientEncryptionKey, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Create, diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs index 87d0de1ef5..bfac96b351 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; internal sealed class FeedIteratorInlineCore : FeedIteratorInternal @@ -47,7 +48,7 @@ internal FeedIteratorInlineCore( public override Task ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: "FeedIterator ReadNextAsync", + operationName: OpenTelemetryConstants.Operations.QueryItems, containerName: this.container?.Id, databaseName: this.container?.Database?.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs index 010dc6569a..8e787bf241 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; internal sealed class FeedIteratorInlineCore : FeedIteratorInternal @@ -47,7 +48,7 @@ internal FeedIteratorInlineCore( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: "Typed FeedIterator ReadNextAsync", + operationName: OpenTelemetryConstants.Operations.TypedQueryItems, containerName: this.container?.Id, databaseName: this.container?.Database.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs index ecf8e36d95..a75adbfa0c 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; // This class acts as a wrapper for environments that use SynchronizationContext. internal sealed class PermissionInlineCore : PermissionCore @@ -27,7 +28,7 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadAsync), + operationName: OpenTelemetryConstants.Operations.ReadPermission, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -43,7 +44,7 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceAsync), + operationName: OpenTelemetryConstants.Operations.ReplacePermission, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Replace, @@ -57,7 +58,7 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteAsync), + operationName: OpenTelemetryConstants.Operations.DeletePermission, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs index 15059c1def..adbc3699a0 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.Scripts using System.IO; using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; // This class acts as a wrapper for environments that use SynchronizationContext. @@ -27,7 +28,7 @@ public override Task CreateStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateStoredProcedureAsync), + operationName: OpenTelemetryConstants.Operations.CreateStoredProcedure, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Create, @@ -90,7 +91,7 @@ public override Task ReadStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadStoredProcedureAsync), + operationName: OpenTelemetryConstants.Operations.ReadStoredProcedure, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Read, @@ -105,7 +106,7 @@ public override Task ReplaceStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceStoredProcedureAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceStoredProcedure, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Replace, @@ -120,7 +121,7 @@ public override Task DeleteStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteStoredProcedureAsync), + operationName: OpenTelemetryConstants.Operations.DeleteStoreProcedure, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Delete, @@ -137,7 +138,7 @@ public override Task> ExecuteStoredProce CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ExecuteStoredProcedureAsync), + operationName: OpenTelemetryConstants.Operations.ExecuteStoredProcedure, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Execute, @@ -154,7 +155,7 @@ public override Task ExecuteStoredProcedureStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ExecuteStoredProcedureStreamAsync), + operationName: OpenTelemetryConstants.Operations.ExecuteStoredProcedureStream, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Execute, @@ -171,7 +172,7 @@ public override Task ExecuteStoredProcedureStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ExecuteStoredProcedureStreamAsync), + operationName: OpenTelemetryConstants.Operations.ExecuteStoredProcedureStream, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Execute, @@ -186,7 +187,7 @@ public override Task CreateTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateTriggerAsync), + operationName: OpenTelemetryConstants.Operations.CreateTrigger, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Create, @@ -249,7 +250,7 @@ public override Task ReadTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadTriggerAsync), + operationName: OpenTelemetryConstants.Operations.ReadTrigger, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Read, @@ -264,7 +265,7 @@ public override Task ReplaceTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceTriggerAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceTrigger, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Replace, @@ -279,7 +280,7 @@ public override Task DeleteTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteTriggerAsync), + operationName: OpenTelemetryConstants.Operations.DeleteTrigger, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Delete, @@ -294,7 +295,7 @@ public override Task CreateUserDefinedFunctionAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateUserDefinedFunctionAsync), + operationName: OpenTelemetryConstants.Operations.CreateUserDefinedFunction, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Create, @@ -357,7 +358,7 @@ public override Task ReadUserDefinedFunctionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadUserDefinedFunctionAsync), + operationName: OpenTelemetryConstants.Operations.ReadUserDefinedFunction, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Read, @@ -372,7 +373,7 @@ public override Task ReplaceUserDefinedFunctionAsyn CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceUserDefinedFunctionAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceUserDefinedFunctions, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Replace, @@ -387,7 +388,7 @@ public override Task DeleteUserDefinedFunctionAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteUserDefinedFunctionAsync), + operationName: OpenTelemetryConstants.Operations.DeleteUserDefinedFunctions, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Delete, diff --git a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs index c50ab7ff22..8fe038007d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; // This class acts as a wrapper for environments that use SynchronizationContext. internal sealed class UserInlineCore : UserCore @@ -26,7 +27,7 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReadAsync), + operationName: OpenTelemetryConstants.Operations.ReadUser, containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -41,7 +42,7 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceAsync), + operationName: OpenTelemetryConstants.Operations.ReplaceUser, containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -55,7 +56,7 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteAsync), + operationName: OpenTelemetryConstants.Operations.DeleteUser, containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -76,7 +77,7 @@ public override Task CreatePermissionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreatePermissionAsync), + operationName: OpenTelemetryConstants.Operations.CreatePermission, containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, @@ -92,7 +93,7 @@ public override Task UpsertPermissionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(UpsertPermissionAsync), + operationName: OpenTelemetryConstants.Operations.UpsertPermission, containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 7dbf7aab51..d4a5edf2a4 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -74,28 +74,5 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage) /// Batch Size /// internal int? BatchSize { get; set; } - - /// - /// Gets or sets the operation type for batch operations. - /// Will have a value for homogeneous batch operations and will be null for heterogeneous batch operations. - /// - /// Operation name should be prepended with BATCH for homogeneous operations, or be just BATCH for heterogeneous operations. - /// - /// - /// For example, if you have a batch of homogeneous operations like Read: - /// - /// var recorder = new OpenTelemetryCoreRecorder(); - /// recorder.BatchOperationName = Documents.OperationType.Read; // Homogeneous batch - /// string operationName = "BATCH." + recorder.BatchOperationName; // Results in "BATCH.Read" - /// - /// - /// For a batch of heterogeneous operations: - /// - /// var recorder = new OpenTelemetryCoreRecorder(); - /// recorder.BatchOperationName = null; // Heterogeneous batch - /// string operationName = "BATCH"; // No specific operation type - /// - /// - internal Documents.OperationType? BatchOperationName { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs new file mode 100644 index 0000000000..0362fc8bcf --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -0,0 +1,137 @@ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry +{ + internal class OpenTelemetryConstants + { + public static class Operations + { + // Batch/Bulk Operations + public const string ExecuteBatch = "execute_batch"; + public const string ExecuteBatchPrefix = "batch_"; + public const string ExecuteBulk = "execute_bulk"; + public const string ExecuteBulkPrefix = "bulk_"; + + // Change feed operations + public const string QueryChangeFeed = "query_change_feed"; + public const string QueryChangeFeedForPartitionKeyRange = "query_change_feed_for_partition_key_range"; + public const string QueryChangeFeedEstimator = "query_change_feed_estimator"; + + // Account Operations + public const string ReadAccount = "read_account"; + + // Conflict Operations + public const string DeleteConflict = "delete_conflict"; + public const string QueryConflicts = "query_conflicts"; + //public const string ReadAllConflicts = "read_all_conflicts"; + public const string ReadConflict = "read_conflict"; + + //Container Operations + public const string CreateContainer = "create_container"; + public const string CreateContainerStream = "create_container_stream"; + public const string CreateContainerIfNotExists = "create_container_if_not_exists"; + public const string DeleteContainer = "delete_container"; + public const string DeleteContainerStream = "delete_container_stream"; + /* public const string QueryContainers = "query_containers"; + public const string ReadAllContainers = "read_all_containers";*/ + public const string ReadContainer = "read_container"; + public const string ReadContainerStream = "read_container_stream"; + public const string ReplaceContainer = "replace_container"; + public const string ReplaceContainerStream = "replace_container_stream"; + public const string ReadFeedRanges = "read_feed_ranges"; + public const string ReadPartitionKeyRanges = "read_partition_key_ranges"; + + // Database Operations + public const string CreateDatabase = "create_database"; + public const string CreateDatabaseStream = "create_database_stream"; + public const string CreateDatabaseIfNotExists = "create_database_if_not_exists"; + public const string DeleteDatabase = "delete_database"; + public const string DeleteDatabaseStream = "delete_database_stream"; + //public const string QueryDatabases = "query_databases"; + public const string ReadDatabase = "read_database"; + public const string ReadDatabaseStream = "read_database_stream"; + //public const string ReadAllDatabases = "read_all_databases"; + + // Item Operations + public const string CreateItem = "create_item"; + public const string CreateItemStream = "create_item_stream"; + public const string DeleteAllItemsByPartitionKeyStream = "delete_all_items_by_partition_key_stream"; + public const string DeleteItem = "delete_item"; + public const string DeleteItemStream = "delete_item_stream"; + public const string PatchItem = "patch_item"; + public const string PatchItemStream = "patch_item_stream"; + public const string QueryItems = "query_items"; + public const string TypedQueryItems = "typed_query_items"; + /* public const string ReadAllItems = "read_all_items"; + public const string ReadAllItemsOfLogicalPartition = "read_all_items_of_logical_partition";*/ + public const string ReadManyItems = "read_many_items"; + public const string ReadManyItemsStream = "read_many_items_stream"; + public const string ReadItem = "read_item"; + public const string ReadItemStream = "read_item_stream"; + public const string ReplaceItem = "replace_item"; + public const string ReplaceItemStream = "replace_item_stream"; + public const string UpsertItem = "upsert_item"; + public const string UpsertItemStream = "upsert_item_stream"; + + // Permission operations + public const string CreatePermission = "create_permission"; + public const string DeletePermission = "delete_permission"; + /* public const string QueryPermissions = "query_permissions"; + public const string ReadAllPermissions = "read_all_permissions";*/ + public const string ReadPermission = "read_permission"; + public const string ReplacePermission = "replace_permission"; + public const string UpsertPermission = "upsert_permission"; + + // Stored procedure operations + public const string CreateStoredProcedure = "create_stored_procedure"; + public const string DeleteStoreProcedure = "delete_stored_procedure"; + public const string ExecuteStoredProcedure = "execute_stored_procedure"; + public const string ExecuteStoredProcedureStream = "execute_stored_procedure_stream"; +/* public const string QueryStoredProcedures = "query_stored_procedures"; + public const string ReadAllStoredProcedures = "read_all_stored_procedures";*/ + public const string ReadStoredProcedure = "read_stored_procedure"; + public const string ReplaceStoredProcedure = "replace_stored_procedure"; + + // Throughput operations + public const string ReadThroughput = "read_throughput"; + public const string ReadThroughputIfExists = "read_throughput_if_exists"; + public const string ReplaceThroughput = "replace_throughput"; + public const string ReplaceThroughputIfExists = "replace_throughput_if_exists"; + + // Trigger operations + public const string CreateTrigger = "create_trigger"; + public const string DeleteTrigger = "delete_trigger"; +/* public const string QueryTriggers = "query_triggers"; + public const string ReadAllTriggers = "read_all_triggers";*/ + public const string ReadTrigger = "read_trigger"; + public const string ReplaceTrigger = "replace_trigger"; + + // User operations + public const string CreateUser = "create_user"; + public const string DeleteUser = "delete_user"; + /*public const string QueryUsers = "query_users"; + public const string ReadAllUsers = "read_all_users";*/ + public const string ReadUser = "read_user"; + public const string ReplaceUser = "replace_user"; + public const string UpsertUser = "upsert_user"; + + // User-defined function operations + public const string CreateUserDefinedFunction = "create_user_defined_function"; + public const string DeleteUserDefinedFunctions = "delete_user_defined_function"; + public const string ReplaceUserDefinedFunctions = "replace_user_defined_function"; + // public const string QueryUserDefinedFunctions = "query_user_defined_functions"; + public const string ReadAllUserDefinedFunctions = "read_all_user_defined_functions"; + public const string ReadUserDefinedFunction = "read_user_defined_function"; + + // Encryption Key operations + public const string CreateClientEncryptionKey = "create_client_encryption_key"; + /* public const string QueryEncryptionKeys = "query_encryption_keys"; + public const string ReadAllEncryptionKeys = "read_all_encryption_keys";*/ + public const string ReadClientEncryptionKey = "read_client_encryption_key"; + public const string ReplaceClientEncryptionKey = "replace_client_encryption_key"; + + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index 522e4817e0..ff35a94054 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -232,13 +232,6 @@ OperationType operationType if (this.response != null) { - if (this.response.BatchOperationName != null) - { - string batchOpsName = Enum.GetName(typeof(OperationType), this.response.BatchOperationName); - operationName = $"{operationName}.{batchOpsName}"; - } - this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationName); - if (this.response.BatchSize is not null) { this.scope.AddIntegerAttribute(OpenTelemetryAttributeKeys.BatchSize, (int)this.response.BatchSize); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 5dba699773..5b685d3d5c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Cosmos internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes { - internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage, bool isHomogenousOperations, OperationType? batchOperation) + internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage) : this( statusCode: responseMessage.StatusCode, requestCharge: OpenTelemetryResponse.GetHeader(responseMessage)?.RequestCharge, @@ -24,8 +24,7 @@ internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage, bool subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - batchSize: responseMessage.GetBatchSize(), - batchOperationName: isHomogenousOperations ? batchOperation : null ) + batchSize: responseMessage.GetBatchSize() ) { } @@ -56,8 +55,7 @@ private OpenTelemetryResponse( string activityId, string correlationId, Documents.OperationType operationType = Documents.OperationType.Invalid, - int? batchSize = null, - Documents.OperationType? batchOperationName = null) + int? batchSize = null) : base(requestMessage) { this.StatusCode = statusCode; @@ -70,7 +68,6 @@ private OpenTelemetryResponse( this.CorrelatedActivityId = correlationId; this.OperationType = operationType; this.BatchSize = batchSize; - this.BatchOperationName = batchOperationName; } private static string GetPayloadSize(ResponseMessage response) 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 fb5d0761ee..38731ad9f8 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 @@ -34,7 +34,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ExecuteAsync + execute_batch databaseName containerName cosmosdb @@ -187,7 +187,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ExecuteAsync + batch_create_item databaseName containerName cosmosdb @@ -304,7 +304,7 @@ Some Value Some Value Direct - Batch.Create + Batch 50 Some Value Some Value 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 a510f47077..79c7d4ba4b 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 @@ -31,7 +31,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -181,10 +181,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -199,10 +199,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -217,10 +217,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -235,10 +235,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -253,10 +253,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -271,10 +271,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -289,10 +289,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -307,10 +307,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -325,10 +325,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -387,7 +387,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -518,10 +518,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -536,10 +536,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -554,10 +554,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -572,10 +572,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -590,10 +590,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -608,10 +608,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -626,10 +626,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -644,10 +644,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -662,10 +662,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -724,7 +724,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -855,10 +855,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -873,10 +873,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -891,10 +891,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -909,10 +909,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -927,10 +927,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -945,10 +945,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -963,10 +963,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -981,10 +981,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -999,10 +999,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1061,7 +1061,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1192,10 +1192,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1210,10 +1210,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1228,10 +1228,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1246,10 +1246,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1264,10 +1264,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1282,10 +1282,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1300,10 +1300,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1318,10 +1318,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1336,10 +1336,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1398,7 +1398,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1529,10 +1529,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1547,10 +1547,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1565,10 +1565,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1583,10 +1583,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1601,10 +1601,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1619,10 +1619,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1637,10 +1637,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1655,10 +1655,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1673,10 +1673,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1735,7 +1735,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1866,10 +1866,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1884,10 +1884,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1902,10 +1902,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1920,10 +1920,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1938,10 +1938,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1956,10 +1956,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1974,10 +1974,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1992,10 +1992,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2010,10 +2010,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2072,7 +2072,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2203,10 +2203,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2221,10 +2221,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2239,10 +2239,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2257,10 +2257,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2275,10 +2275,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2293,10 +2293,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2311,10 +2311,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2329,10 +2329,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2347,10 +2347,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2409,7 +2409,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2540,10 +2540,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2558,10 +2558,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2576,10 +2576,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2594,10 +2594,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2612,10 +2612,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2630,10 +2630,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2648,10 +2648,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2666,10 +2666,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2684,10 +2684,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2746,7 +2746,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2877,10 +2877,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2895,10 +2895,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2913,10 +2913,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2931,10 +2931,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2949,10 +2949,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2967,10 +2967,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -2985,10 +2985,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3003,10 +3003,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3021,10 +3021,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3083,7 +3083,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3214,10 +3214,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3232,10 +3232,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3250,10 +3250,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3268,10 +3268,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3286,10 +3286,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3304,10 +3304,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3322,10 +3322,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3340,10 +3340,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3358,10 +3358,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -3441,7 +3441,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb 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 4bf97b7cf5..b698159be3 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 @@ -26,7 +26,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1042,10 +1042,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1061,10 +1061,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1080,10 +1080,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1099,10 +1099,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1153,7 +1153,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1788,10 +1788,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1807,10 +1807,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1826,10 +1826,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1845,10 +1845,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1900,7 +1900,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2515,10 +2515,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2534,10 +2534,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2553,10 +2553,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2572,10 +2572,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2627,7 +2627,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3262,10 +3262,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3281,10 +3281,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3300,10 +3300,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3319,10 +3319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3369,7 +3369,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Estimator Read Next Async + query_change_feed_estimator databaseName containerName cosmosdb 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 58d4a538ea..e5a8ecb1a7 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 @@ -16,7 +16,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - DeleteAsync + delete_database miscdbcustonhandler cosmosdb Some Value @@ -134,10 +134,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateDatabaseAsync + create_database miscdbcustonhandler cosmosdb Some Value @@ -169,7 +169,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - DeleteAsync + delete_database miscdbdataplane cosmosdb Some Value @@ -275,10 +275,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateDatabaseAsync + create_database miscdbdataplane cosmosdb Some Value 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 3d79320575..441ac59832 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 @@ -33,7 +33,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -235,7 +235,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -533,7 +533,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -788,7 +788,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1075,7 +1075,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1387,7 +1387,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb 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 ed00529984..d7e0cc8749 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 @@ -21,7 +21,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -631,10 +631,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -652,10 +652,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -673,10 +673,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -722,7 +722,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1352,10 +1352,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1373,10 +1373,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1394,10 +1394,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1444,7 +1444,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -2054,10 +2054,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -2075,10 +2075,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -2096,10 +2096,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -2146,7 +2146,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2776,10 +2776,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2797,10 +2797,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2818,10 +2818,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2871,7 +2871,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3572,10 +3572,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3593,10 +3593,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3614,10 +3614,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -3666,7 +3666,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -4283,10 +4283,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -4304,10 +4304,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -4325,10 +4325,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -4377,7 +4377,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -5014,10 +5014,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -5035,10 +5035,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -5056,10 +5056,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb 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 b3c304847f..97cddae63b 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 @@ -20,7 +20,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -596,10 +596,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -616,10 +616,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -636,10 +636,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -683,7 +683,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1279,10 +1279,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1299,10 +1299,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1319,10 +1319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -1367,7 +1367,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1943,10 +1943,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1963,10 +1963,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1983,10 +1983,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -2031,7 +2031,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2627,10 +2627,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2647,10 +2647,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb @@ -2667,10 +2667,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + typed_query_items databaseName containerName cosmosdb 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 854845fbee..7b3c8645f0 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 @@ -18,7 +18,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemStreamAsync + create_item_stream databaseName containerName cosmosdb @@ -134,7 +134,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadItemStreamAsync + read_item_stream databaseName containerName cosmosdb @@ -258,7 +258,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReplaceItemStreamAsync + replace_item_stream databaseName containerName cosmosdb @@ -377,7 +377,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - DeleteItemStreamAsync + delete_item_stream databaseName containerName cosmosdb 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 fe0b560a05..da534cc3a2 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 @@ -16,7 +16,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -154,7 +154,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadItemAsync + read_item databaseName containerName cosmosdb @@ -283,7 +283,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReplaceItemAsync + replace_item databaseName containerName cosmosdb @@ -411,7 +411,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - DeleteItemAsync + delete_item databaseName containerName cosmosdb diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml index 19ee94a35b..4f12c7312b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + @@ -23,7 +23,7 @@ "Abc"]]> - + @@ -32,7 +32,7 @@ "1" and c.name > "Abc"]]> - + @@ -41,7 +41,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -59,7 +59,7 @@ "Abc"]]> - + @@ -68,7 +68,7 @@ "1" and c.name > "Abc"]]> - + @@ -77,7 +77,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -95,7 +95,7 @@ "Abc"]]> - + @@ -104,7 +104,7 @@ "1" and c.name > "Abc"]]> - + @@ -113,7 +113,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -131,7 +131,7 @@ "Abc" ORDER BY c.id ASC]]> - + @@ -140,7 +140,7 @@ "1" and c.name > "Abc" ORDER BY c.id ASC]]> - + @@ -149,7 +149,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -167,7 +167,7 @@ "Abc" GROUP BY c.id]]> - + @@ -176,7 +176,7 @@ "1" and c.name > "Abc" GROUP BY c.id]]> - + @@ -185,7 +185,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -203,7 +203,7 @@ "Abc" GROUP BY c.id, c.name]]> - + @@ -212,7 +212,7 @@ "1" and c.name > "Abc" GROUP BY c.id, c.name]]> - + @@ -221,7 +221,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -239,7 +239,7 @@ "Abc"]]> - + @@ -248,7 +248,7 @@ "1" and c.name > "Abc"]]> - + @@ -257,7 +257,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -275,7 +275,7 @@ "Abc" GROUP BY c.id, c.name]]> - + @@ -284,7 +284,7 @@ "1" and c.name > "Abc" GROUP BY c.id, c.name]]> - + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml index 4e2d3b1ade..90bb023e23 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ 0 AND r.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > 0]]> - + @@ -23,7 +23,7 @@ 0]]> - + @@ -32,7 +32,7 @@ 0 AND r.cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc > 0]]> - + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml index c1d041160a..414ce6838f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml @@ -7,7 +7,7 @@ FROM c WHERE STARTSWITH(c.statement, 'The quick brown fox jumps over the lazy dog', false)]]> - + @@ -18,7 +18,7 @@ FROM c WHERE STARTSWITH(c['Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο ÏƑκυλί'], 's', false)]]> - + @@ -27,7 +27,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -36,7 +36,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -45,7 +45,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ?:"{}|ßÁŒÆ12ếàưỏốởặ'], 's', true) FROM root r]]> - ?:\\\"{}|ßÁŒÆ12ếàưỏốởặ\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]> + ?:\\\"{}|ßÁŒÆ12ếàưỏốởặ\"\/?","FilterPreciseSet":true,"IndexPreciseSet":true,"IndexImpactScore":"High"}],"PotentialSingleIndexes":[],"UtilizedCompositeIndexes":[],"PotentialCompositeIndexes":[]}]]> @@ -54,7 +54,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -63,7 +63,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -72,7 +72,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -81,7 +81,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -90,7 +90,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -99,7 +99,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs index 86ea3cab79..b8ecaaa880 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Collections.Generic; using System.Net; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -79,19 +80,19 @@ public async Task ValidateInvalidRequestOptionsAsync() string id = Guid.NewGuid().ToString(); MyDocument myDocument = new MyDocument() { id = id, Status = id }; - await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync(new ItemBatchOperation(OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { SessionToken = "something" })); + await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync(new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { SessionToken = "something" })); await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync( - new ItemBatchOperation(OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), + new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { Properties = new Dictionary() { { "test", "test" } } })); await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync( - new ItemBatchOperation(OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), + new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { DedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions { MaxIntegratedCacheStaleness = TimeSpan.FromMinutes(3) } })); } private static ItemBatchOperation CreateItem(string id) { MyDocument myDocument = new MyDocument() { id = id, Status = id }; - return new ItemBatchOperation(OperationType.Create, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)); + return new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)); } private class MyDocument diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index 85e3496731..5f3e2949f3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -22,6 +22,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Linq; using Cosmos.Util; using Microsoft.Azure.Cosmos.Telemetry.Models; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; public abstract class ClientTelemetryTestsBase : BaseCosmosClientHelper { @@ -1018,7 +1019,7 @@ private static void AssertCacheRefreshInfoInformation( private static ItemBatchOperation CreateItem(string itemId) { var testItem = new { id = itemId, Status = itemId }; - return new ItemBatchOperation(Documents.OperationType.Create, 0, new Cosmos.PartitionKey(itemId), itemId, TestCommon.SerializerCore.ToStream(testItem)); + return new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, Documents.OperationType.Create, 0, new Cosmos.PartitionKey(itemId), itemId, TestCommon.SerializerCore.ToStream(testItem)); } private async Task CreateClientAndContainer(ConnectionMode mode, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index acc83d3ff4..0fe8593f1a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -27,6 +28,7 @@ public class BatchAsyncBatcherTests private ItemBatchOperation CreateItemBatchOperation(bool withContext = false) { ItemBatchOperation operation = new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: 0, partitionKey: Cosmos.PartitionKey.Null, @@ -457,6 +459,7 @@ public async Task DispatchProcessInOrderAsync() for (int i = 0; i < 10; i++) { ItemBatchOperation operation = new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: i, partitionKey: new Cosmos.PartitionKey(i.ToString()), @@ -487,7 +490,7 @@ public async Task DispatchWithLessResponses() List operations = new List(10); for (int i = 0; i < 10; i++) { - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); + ItemBatchOperation operation = new ItemBatchOperation(OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); ItemBatchOperationContext context = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(context); operations.Add(operation); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index c6bca20950..c7a07a89e7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; @@ -333,6 +334,7 @@ private static ItemBatchOperation CreateItem(string id) { MyDocument myDocument = new MyDocument() { id = id, Status = id }; return new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: 0, partitionKey: new Cosmos.PartitionKey(id), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs index 8e3c6bcbc3..4bc8506e3e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -28,7 +29,7 @@ public async Task TraceIsJoinedOnCompletionWithRetry() Trace rootTrace = Trace.GetRootTrace(name: "RootTrace"); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); // Start with the base trace ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(Guid.NewGuid().ToString(), rootTrace, retryPolicy); @@ -69,7 +70,7 @@ public async Task TraceIsJoinedOnCompletionWithoutRetry() Trace rootTrace = Trace.GetRootTrace(name: "RootTrace"); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); // Start with the base trace ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(Guid.NewGuid().ToString(), rootTrace, retryPolicy); @@ -103,7 +104,7 @@ public async Task TraceIsJoinedOnCompletionWithoutRetry() public void PartitionKeyRangeIdIsSetOnInitialization() { string expectedPkRangeId = Guid.NewGuid().ToString(); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(expectedPkRangeId, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -116,7 +117,7 @@ public void PartitionKeyRangeIdIsSetOnInitialization() [TestMethod] public void TaskIsCreatedOnInitialization() { - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -128,7 +129,7 @@ public void TaskIsCreatedOnInitialization() [TestMethod] public async Task TaskResultIsSetOnCompleteAsync() { - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -144,7 +145,7 @@ public async Task TaskResultIsSetOnCompleteAsync() public async Task ExceptionIsSetOnFailAsync() { Exception failure = new Exception("It failed"); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -158,7 +159,7 @@ public async Task ExceptionIsSetOnFailAsync() [TestMethod] public void CannotAttachMoreThanOnce() { - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton)); Assert.ThrowsException(() => operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton))); } @@ -167,7 +168,7 @@ public void CannotAttachMoreThanOnce() public async Task ShouldRetry_NoPolicy() { TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.OK); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsFalse(shouldRetryResult.ShouldRetry); @@ -181,7 +182,7 @@ public async Task ShouldRetry_WithPolicy_OnSuccess() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.OK); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsFalse(shouldRetryResult.ShouldRetry); @@ -195,7 +196,7 @@ public async Task ShouldRetry_WithPolicy_On429() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult((HttpStatusCode)StatusCodes.TooManyRequests); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -209,7 +210,7 @@ public async Task ShouldRetry_WithPolicy_On413_3402() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.RequestEntityTooLarge) { SubStatusCode = (SubStatusCodes)3402 }; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -223,7 +224,7 @@ public async Task ShouldRetry_WithPolicy_On413_0() OperationType.Create, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.RequestEntityTooLarge); - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsFalse(shouldRetryResult.ShouldRetry); @@ -237,7 +238,7 @@ public async Task ShouldRetry_WithPolicy_OnSplit() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.Gone) { SubStatusCode = SubStatusCodes.PartitionKeyRangeGone }; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -251,7 +252,7 @@ public async Task ShouldRetry_WithPolicy_OnCompletingSplit() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.Gone) { SubStatusCode = SubStatusCodes.CompletingSplit }; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -265,7 +266,7 @@ public async Task ShouldRetry_WithPolicy_OnCompletingPartitionMigration() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.Gone) { SubStatusCode = SubStatusCodes.CompletingPartitionMigration }; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index 896eb0fade..a35fab1160 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -22,7 +23,7 @@ public class BatchAsyncStreamerTests private const int MaxBatchByteSize = 100000; private const int defaultMaxDegreeOfConcurrency = 10; private static readonly Exception expectedException = new Exception(); - private readonly ItemBatchOperation ItemBatchOperation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null, "0"); + private readonly ItemBatchOperation ItemBatchOperation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null, "0"); private readonly TimerWheel TimerWheel = TimerWheel.CreateTimerWheel(TimeSpan.FromMilliseconds(50), 20); private readonly SemaphoreSlim limiter = new SemaphoreSlim(1, defaultMaxDegreeOfConcurrency); @@ -141,7 +142,7 @@ public async Task ValidatesCongestionControlAsync() List> contexts = new List>(100); for (int i = 0; i < 600; i++) { - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); ItemBatchOperationContext context = AttachContext(operation); batchAsyncStreamer.Add(operation); contexts.Add(context.OperationTask); @@ -172,7 +173,7 @@ public async Task DispatchesAsync() List> contexts = new List>(10); for (int i = 0; i < 10; i++) { - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); ItemBatchOperationContext context = AttachContext(operation); batchAsyncStreamer.Add(operation); contexts.Add(context.OperationTask); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs index 74beb6d626..d919f64700 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.Tests using Microsoft.Azure.Cosmos.Serialization.HybridRow; using Microsoft.Azure.Cosmos.Serialization.HybridRow.IO; using Microsoft.Azure.Cosmos.Serialization.HybridRow.RecordIO; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -237,6 +238,7 @@ private static Result ReadOperation(ref RowReader reader, int operationIndex, ou } operation = new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: operationType, operationIndex: operationIndex, partitionKey: Cosmos.PartitionKey.Null, // ParsedPartitionKey is used for validation diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs index 9fce10c298..4710760684 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.Tests using Microsoft.Azure.Cosmos.Core.Utf8; using Microsoft.Azure.Cosmos.Serialization.HybridRow; using Microsoft.Azure.Cosmos.Serialization.HybridRow.IO; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -32,6 +33,7 @@ public async Task BatchRequestSerializationAsync() ItemBatchOperation[] operations = new ItemBatchOperation[] { new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: 0, containerCore:containerCore) @@ -39,6 +41,7 @@ public async Task BatchRequestSerializationAsync() ResourceBody = new byte[] { 0x41, 0x42 } }, new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.ReplaceItem, id: "id2", operationType: OperationType.Replace, operationIndex: 1, @@ -87,6 +90,7 @@ public void TestWriteOperationWithBinaryIdByteArray() TransactionalBatchItemRequestOptions transactionalBatchItemRequestOptions = TransactionalBatchItemRequestOptions.FromItemRequestOptions(requestOptions); ItemBatchOperation operation = new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: 0, partitionKey: Cosmos.PartitionKey.Null, @@ -142,8 +146,8 @@ public async Task BatchResponseDeserializationAsync() operations: new ArraySegment( new ItemBatchOperation[] { - new ItemBatchOperation(OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore), - new ItemBatchOperation(OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore) + new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem,OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore), + new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem,OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore) }), serializerCore: MockCosmosUtil.Serializer, trace: NoOpTrace.Singleton, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs index c081377f2c..6be964b526 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Diagnostics; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; @@ -27,7 +28,7 @@ public async Task StatusCodesAreSetThroughResponseAsync() List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) @@ -65,7 +66,7 @@ public async Task DiagnosticsAreSetThroughResponseAsync() List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs index 1e8c1488b4..0c4d080940 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Net.Http; using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; @@ -40,7 +41,7 @@ public async Task StatusCodesAreSetThroughResponseAsync() List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) @@ -127,7 +128,7 @@ private async Task ConstainsSplitIsTrueInternal(HttpStatusCode statusCode, List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs index e2ddfd3e13..151ac948ed 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Linq; using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -18,7 +19,7 @@ public class PartitionKeyRangeServerBatchRequestTests { private static ItemBatchOperation CreateItemBatchOperation(string id = "") { - return new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null, id, new MemoryStream(new byte[] { 0x41, 0x42 }, index: 0, count: 2, writable: false, publiclyVisible: true)); + return new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null, id, new MemoryStream(new byte[] { 0x41, 0x42 }, index: 0, count: 2, writable: false, publiclyVisible: true)); } [TestMethod] @@ -167,7 +168,7 @@ private static async Task GetTransactionalBatchRespo if(arrayOperations == null) { arrayOperations = new ItemBatchOperation[1]; - arrayOperations[0] = new ItemBatchOperation(Documents.OperationType.Read, 0, new PartitionKey("0")); + arrayOperations[0] = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, Documents.OperationType.Read, 0, new PartitionKey("0")); } SinglePartitionKeyServerBatchRequest batchRequest = await SinglePartitionKeyServerBatchRequest.CreateAsync( @@ -244,7 +245,7 @@ private static async Task GetPartitionKeyRangeBa { ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - arrayOperations[0] = new ItemBatchOperation(Documents.OperationType.Read, 0, new PartitionKey("0")); + arrayOperations[0] = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, Documents.OperationType.Read, 0, new PartitionKey("0")); PartitionKeyRangeBatchResponse partitionKeyRangeBatchResponse = new PartitionKeyRangeBatchResponse( arrayOperations.Length, await OpenTelemetryRecorderTests.GetTransactionalBatchResponse(arrayOperations), From 1ab196cb4cf9808ab82613a3542063426309ce20 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 23 Aug 2024 07:36:12 +0530 Subject: [PATCH 02/22] fix tests --- .../src/Batch/TransactionalBatchInternal.cs | 2 +- .../Tracing/EndToEndTraceWriterBaselineTests.cs | 7 ++++--- .../ChangeFeed/ChangeFeedEstimatorIteratorTests.cs | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs index c5d8cfc338..e5605c1b6c 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs @@ -52,7 +52,7 @@ protected void AddOperation(ItemBatchOperation itemBatchOperation) { if (this.isHomogenousOperations && this.operations.Count > 0) { - this.isHomogenousOperations = this.operations.First().OperationName == itemBatchOperation.OperationName; + this.isHomogenousOperations = this.operations.First()?.OperationName == itemBatchOperation.OperationName; this.homogenousOperation = this.isHomogenousOperations ? itemBatchOperation.OperationName : null; } this.operations.Add(itemBatchOperation); 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 53689de374..2bf652a5aa 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 @@ -20,6 +20,7 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.SDK.EmulatorTests; using Microsoft.Azure.Cosmos.Services.Management.Tests.BaselineTest; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -1621,13 +1622,13 @@ private static JObject FindChild( private static void AssertTraceProperites(ITrace trace) { - if (trace.Name == "ReadManyItemsStreamAsync" || - trace.Name == "ReadManyItemsAsync") + if (trace.Name == OpenTelemetryConstants.Operations.ReadManyItemsStream || + trace.Name == OpenTelemetryConstants.Operations.ReadManyItems) { return; // skip test for read many as the queries are done in parallel } - if (trace.Name == "Change Feed Estimator Read Next Async") + if (trace.Name == OpenTelemetryConstants.Operations.QueryChangeFeedEstimator) { return; // Change Feed Estimator issues parallel requests } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs index 8589a5e049..39b8c00bd3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -384,7 +385,7 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti Mock mockedContext = new Mock(MockBehavior.Strict); mockedContext.Setup(c => c.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); mockedContext.Setup(x => x.OperationHelperAsync>( - It.Is(str => str.Contains("Change Feed Estimator")), + It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedEstimator)), It.IsAny(), It.IsAny(), It.IsAny(), @@ -495,7 +496,7 @@ private static ContainerInternal GetMockedContainer() containerMock.Setup(c => c.Database.Id).Returns("databaseId"); mockContext.Setup(x => x.OperationHelperAsync>( - It.Is(str => str.Contains("Change Feed Estimator")), + It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedEstimator)), It.IsAny(), It.IsAny(), It.IsAny(), From bc85fb041549a6e5ed56935e0f7f770a3842af0e Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 23 Aug 2024 07:42:48 +0530 Subject: [PATCH 03/22] updated baseline --- ...EndTraceWriterBaselineTests.ReadManyAsync.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 e2203da4aa..78ac6e98c7 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 @@ -12,7 +12,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadManyItemsStreamAsync + read_many_items_stream databaseName containerName cosmosdb @@ -582,7 +582,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadManyItemsAsync + read_many_items databaseName containerName cosmosdb From f0f393bde5159404114d8c03d405aea755ba59d9 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Mon, 26 Aug 2024 08:02:55 +0530 Subject: [PATCH 04/22] fix tests --- .../OpenTelemetry/OpenTelemetryConstants.cs | 18 ------ ...ndexUtilizationClientSideExistenceTest.xml | 64 +++++++++---------- ...eTest.IndexUtilizationHeaderLengthTest.xml | 8 +-- ...rserBaselineTest.IndexUtilizationParse.xml | 22 +++---- .../CFP/AllVersionsAndDeletes/BuilderTests.cs | 3 +- .../BuilderWithCustomSerializerTests.cs | 3 +- .../ChangeFeed/DynamicStreamTests.cs | 3 +- .../ChangeFeed/DynamicTests.cs | 3 +- .../CosmosDatabaseTests.cs | 3 +- .../CosmosNullReferenceExceptionTests.cs | 7 +- ...dPartitionKeyResultSetIteratorCoreTests.cs | 9 +-- 11 files changed, 66 insertions(+), 77 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs index 0362fc8bcf..5add1e4997 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -34,8 +34,6 @@ public static class Operations public const string CreateContainerIfNotExists = "create_container_if_not_exists"; public const string DeleteContainer = "delete_container"; public const string DeleteContainerStream = "delete_container_stream"; - /* public const string QueryContainers = "query_containers"; - public const string ReadAllContainers = "read_all_containers";*/ public const string ReadContainer = "read_container"; public const string ReadContainerStream = "read_container_stream"; public const string ReplaceContainer = "replace_container"; @@ -49,10 +47,8 @@ public static class Operations public const string CreateDatabaseIfNotExists = "create_database_if_not_exists"; public const string DeleteDatabase = "delete_database"; public const string DeleteDatabaseStream = "delete_database_stream"; - //public const string QueryDatabases = "query_databases"; public const string ReadDatabase = "read_database"; public const string ReadDatabaseStream = "read_database_stream"; - //public const string ReadAllDatabases = "read_all_databases"; // Item Operations public const string CreateItem = "create_item"; @@ -64,8 +60,6 @@ public static class Operations public const string PatchItemStream = "patch_item_stream"; public const string QueryItems = "query_items"; public const string TypedQueryItems = "typed_query_items"; - /* public const string ReadAllItems = "read_all_items"; - public const string ReadAllItemsOfLogicalPartition = "read_all_items_of_logical_partition";*/ public const string ReadManyItems = "read_many_items"; public const string ReadManyItemsStream = "read_many_items_stream"; public const string ReadItem = "read_item"; @@ -78,8 +72,6 @@ public static class Operations // Permission operations public const string CreatePermission = "create_permission"; public const string DeletePermission = "delete_permission"; - /* public const string QueryPermissions = "query_permissions"; - public const string ReadAllPermissions = "read_all_permissions";*/ public const string ReadPermission = "read_permission"; public const string ReplacePermission = "replace_permission"; public const string UpsertPermission = "upsert_permission"; @@ -89,8 +81,6 @@ public static class Operations public const string DeleteStoreProcedure = "delete_stored_procedure"; public const string ExecuteStoredProcedure = "execute_stored_procedure"; public const string ExecuteStoredProcedureStream = "execute_stored_procedure_stream"; -/* public const string QueryStoredProcedures = "query_stored_procedures"; - public const string ReadAllStoredProcedures = "read_all_stored_procedures";*/ public const string ReadStoredProcedure = "read_stored_procedure"; public const string ReplaceStoredProcedure = "replace_stored_procedure"; @@ -103,16 +93,12 @@ public static class Operations // Trigger operations public const string CreateTrigger = "create_trigger"; public const string DeleteTrigger = "delete_trigger"; -/* public const string QueryTriggers = "query_triggers"; - public const string ReadAllTriggers = "read_all_triggers";*/ public const string ReadTrigger = "read_trigger"; public const string ReplaceTrigger = "replace_trigger"; // User operations public const string CreateUser = "create_user"; public const string DeleteUser = "delete_user"; - /*public const string QueryUsers = "query_users"; - public const string ReadAllUsers = "read_all_users";*/ public const string ReadUser = "read_user"; public const string ReplaceUser = "replace_user"; public const string UpsertUser = "upsert_user"; @@ -121,17 +107,13 @@ public static class Operations public const string CreateUserDefinedFunction = "create_user_defined_function"; public const string DeleteUserDefinedFunctions = "delete_user_defined_function"; public const string ReplaceUserDefinedFunctions = "replace_user_defined_function"; - // public const string QueryUserDefinedFunctions = "query_user_defined_functions"; public const string ReadAllUserDefinedFunctions = "read_all_user_defined_functions"; public const string ReadUserDefinedFunction = "read_user_defined_function"; // Encryption Key operations public const string CreateClientEncryptionKey = "create_client_encryption_key"; - /* public const string QueryEncryptionKeys = "query_encryption_keys"; - public const string ReadAllEncryptionKeys = "read_all_encryption_keys";*/ public const string ReadClientEncryptionKey = "read_client_encryption_key"; public const string ReplaceClientEncryptionKey = "replace_client_encryption_key"; - } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml index 4f12c7312b..19ee94a35b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationClientSideExistenceTest.xml @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + @@ -23,7 +23,7 @@ "Abc"]]> - + @@ -32,7 +32,7 @@ "1" and c.name > "Abc"]]> - + @@ -41,7 +41,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -59,7 +59,7 @@ "Abc"]]> - + @@ -68,7 +68,7 @@ "1" and c.name > "Abc"]]> - + @@ -77,7 +77,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -95,7 +95,7 @@ "Abc"]]> - + @@ -104,7 +104,7 @@ "1" and c.name > "Abc"]]> - + @@ -113,7 +113,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -131,7 +131,7 @@ "Abc" ORDER BY c.id ASC]]> - + @@ -140,7 +140,7 @@ "1" and c.name > "Abc" ORDER BY c.id ASC]]> - + @@ -149,7 +149,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -167,7 +167,7 @@ "Abc" GROUP BY c.id]]> - + @@ -176,7 +176,7 @@ "1" and c.name > "Abc" GROUP BY c.id]]> - + @@ -185,7 +185,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -203,7 +203,7 @@ "Abc" GROUP BY c.id, c.name]]> - + @@ -212,7 +212,7 @@ "1" and c.name > "Abc" GROUP BY c.id, c.name]]> - + @@ -221,7 +221,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -239,7 +239,7 @@ "Abc"]]> - + @@ -248,7 +248,7 @@ "1" and c.name > "Abc"]]> - + @@ -257,7 +257,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -275,7 +275,7 @@ "Abc" GROUP BY c.id, c.name]]> - + @@ -284,7 +284,7 @@ "1" and c.name > "Abc" GROUP BY c.id, c.name]]> - + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml index 90bb023e23..4e2d3b1ade 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ 0 AND r.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > 0]]> - + @@ -23,7 +23,7 @@ 0]]> - + @@ -32,7 +32,7 @@ 0 AND r.cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc > 0]]> - + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml index 414ce6838f..c1d041160a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml @@ -7,7 +7,7 @@ FROM c WHERE STARTSWITH(c.statement, 'The quick brown fox jumps over the lazy dog', false)]]> - + @@ -18,7 +18,7 @@ FROM c WHERE STARTSWITH(c['Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο ÏƑκυλί'], 's', false)]]> - + @@ -27,7 +27,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -36,7 +36,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -45,7 +45,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ?:"{}|ßÁŒÆ12ếàưỏốởặ'], 's', true) FROM root r]]> - ?:\\\"{}|ßÁŒÆ12ếàưỏốởặ\"\/?","FilterPreciseSet":true,"IndexPreciseSet":true,"IndexImpactScore":"High"}],"PotentialSingleIndexes":[],"UtilizedCompositeIndexes":[],"PotentialCompositeIndexes":[]}]]> + ?:\\\"{}|ßÁŒÆ12ếàưỏốởặ\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]> @@ -54,7 +54,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -63,7 +63,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -72,7 +72,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -81,7 +81,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -90,7 +90,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + @@ -99,7 +99,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αΠ- + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs index 669c6bd194..a610e75b7f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.CFP.AllVersionsAndDeletes using Microsoft.Azure.Cosmos.ChangeFeed.Utils; using Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed; using Microsoft.Azure.Cosmos.Services.Management.Tests; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -188,7 +189,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync() Assert.IsNotNull(context.Headers); Assert.IsNotNull(context.Headers.Session); Assert.IsTrue(context.Headers.RequestCharge > 0); - Assert.IsTrue(context.Diagnostics.ToString().Contains("Change Feed Processor Read Next Async")); + Assert.IsTrue(context.Diagnostics.ToString().Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); Assert.AreEqual(expected: 3, actual: docs.Count); ChangeFeedItem createChange = docs.ElementAt(0); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs index a6780e4409..4f68205673 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.CFP.AllVersionsAndDeletes using Microsoft.Azure.Cosmos.ChangeFeed.Utils; using Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed; using Microsoft.Azure.Cosmos.Services.Management.Tests; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -539,7 +540,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync(bool pr Assert.IsNotNull(context.Headers); Assert.IsNotNull(context.Headers.Session); Assert.IsTrue(context.Headers.RequestCharge > 0); - Assert.IsTrue(context.Diagnostics.ToString().Contains("Change Feed Processor Read Next Async")); + Assert.IsTrue(context.Diagnostics.ToString().Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); Assert.AreEqual(expected: 3, actual: docs.Count); ChangeFeedItem createChange = docs.ElementAt(0); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs index f63ef4dbda..b187a4a4a2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Scripts; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -319,7 +320,7 @@ private void ValidateContext(ChangeFeedProcessorContext changeFeedProcessorConte Assert.IsNotNull(changeFeedProcessorContext.Headers.Session); Assert.IsTrue(changeFeedProcessorContext.Headers.RequestCharge > 0); string diagnosticsAsString = changeFeedProcessorContext.Diagnostics.ToString(); - Assert.IsTrue(diagnosticsAsString.Contains("Change Feed Processor Read Next Async")); + Assert.IsTrue(diagnosticsAsString.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs index 02d2faac54..ccb17311b3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Scripts; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; @@ -377,7 +378,7 @@ private async Task ValidateContextAsync(ChangeFeedProcessorContext changeFeedPro Assert.IsNotNull(changeFeedProcessorContext.Headers.Session); Assert.IsTrue(changeFeedProcessorContext.Headers.RequestCharge > 0); string diagnosticsAsString = changeFeedProcessorContext.Diagnostics.ToString(); - Assert.IsTrue(diagnosticsAsString.Contains("Change Feed Processor Read Next Async")); + Assert.IsTrue(diagnosticsAsString.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); await this.ValidateFeedRangeAsync(changeFeedProcessorContext.FeedRange); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs index ba6d33d55e..7452554a9d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -217,7 +218,7 @@ public async Task CreateIfNotExists() Assert.IsNotNull(createExistingResponse.Diagnostics); string diagnostics = createExistingResponse.Diagnostics.ToString(); Assert.IsFalse(string.IsNullOrEmpty(diagnostics)); - Assert.IsTrue(diagnostics.Contains("CreateDatabaseIfNotExistsAsync")); + Assert.IsTrue(diagnostics.Contains(OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists)); bool conflictReturned = false; requestHandlerHelper.CallBackOnResponse = (request, response) => diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs index b91b43fd64..6550805ba4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Diagnostics; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -57,7 +58,7 @@ public async Task CosmosEndToEndNullReferenceExceptionTestAsync() catch(NullReferenceException nre) { Assert.AreEqual(typeof(CosmosNullReferenceException), nre.GetType()); - Assert.IsTrue(nre.Message.Contains("CreateItemAsync")); + Assert.IsTrue(nre.Message.Contains(OpenTelemetryConstants.Operations.CreateItem)); string cosmosToString = nre.ToString(); Assert.IsFalse(cosmosToString.Contains("Microsoft.Azure.Cosmos.CosmosNullReferenceException"), $"The internal wrapper exception should not be exposed to users. {cosmosToString}"); Assert.IsTrue(cosmosToString.Contains(errorMessage)); @@ -73,11 +74,11 @@ public async Task CosmosEndToEndNullReferenceExceptionTestAsync() catch (NullReferenceException nre) { Assert.AreEqual(typeof(CosmosNullReferenceException), nre.GetType()); - Assert.IsTrue(nre.Message.Contains("Typed FeedIterator ReadNextAsync")); + Assert.IsTrue(nre.Message.Contains(OpenTelemetryConstants.Operations.TypedQueryItems)); string cosmosToString = nre.ToString(); Assert.IsFalse(cosmosToString.Contains("Microsoft.Azure.Cosmos.CosmosNullReferenceException"), $"The internal wrapper exception should not be exposed to users. {cosmosToString}"); Assert.IsTrue(cosmosToString.Contains(errorMessage)); - Assert.IsTrue(cosmosToString.Contains("Typed FeedIterator ReadNextAsync")); + Assert.IsTrue(cosmosToString.Contains(OpenTelemetryConstants.Operations.TypedQueryItems)); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs index 08baba746b..1d98dc81b1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -40,7 +41,7 @@ public async Task EtagPassesContinuation() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains("Change Feed Processor")), + It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), It.IsAny(), It.IsAny(), It.IsAny(), @@ -120,7 +121,7 @@ public async Task NextReadHasUpdatedContinuation() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains("Change Feed Processor")), + It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), It.IsAny(), It.IsAny(), It.IsAny(), @@ -190,7 +191,7 @@ public async Task ShouldSetFeedRangePartitionKeyRange() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains("Change Feed Processor")), + It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), It.IsAny(), It.IsAny(), It.IsAny(), @@ -272,7 +273,7 @@ public async Task ShouldUseFeedRangeEpk() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains("Change Feed Processor")), + It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), It.IsAny(), It.IsAny(), It.IsAny(), From 578718fcb93dfa4fa06c5d054ec5c0ddd6c0f683 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 29 Aug 2024 10:57:47 +0530 Subject: [PATCH 05/22] renamed ops name --- Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs | 43 +++--- .../src/Batch/TransactionalBatchInternal.cs | 44 ------ Microsoft.Azure.Cosmos/src/CosmosClient.cs | 2 +- .../Resource/Container/ContainerInlineCore.cs | 22 +-- .../Resource/Database/DatabaseInlineCore.cs | 8 +- .../FeedIteratorInlineCore{T}.cs | 2 +- .../OpenTelemetry/OpenTelemetryConstants.cs | 17 --- ...iterBaselineTests.BatchOperationsAsync.xml | 8 +- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 72 +++++----- ...EndTraceWriterBaselineTests.QueryAsync.xml | 128 +++++++++--------- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 64 ++++----- ...TraceWriterBaselineTests.ReadManyAsync.xml | 8 +- ...selineTests.StreamPointOperationsAsync.xml | 32 ++--- .../CosmosNullReferenceExceptionTests.cs | 4 +- .../EndToEndTraceWriterBaselineTests.cs | 24 +--- 15 files changed, 204 insertions(+), 274 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index c0d831faf4..259cbbeafd 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs @@ -19,6 +19,11 @@ internal class BatchCore : TransactionalBatchInternal private readonly ContainerInternal container; + /// + /// The list of operations in the batch. + /// + protected List operations; + /// /// Initializes a new instance of the class. /// @@ -30,6 +35,8 @@ internal BatchCore( { this.container = container; this.partitionKey = partitionKey; + + this.operations = new List(); } public override TransactionalBatch CreateItem( @@ -41,7 +48,7 @@ public override TransactionalBatch CreateItem( throw new ArgumentNullException(nameof(item)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: this.operations.Count, @@ -61,8 +68,8 @@ public override TransactionalBatch CreateItemStream( throw new ArgumentNullException(nameof(streamPayload)); } - this.AddOperation(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItemStream, + this.operations.Add(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -81,7 +88,7 @@ public override TransactionalBatch ReadItem( throw new ArgumentNullException(nameof(id)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationName: OpenTelemetryConstants.Operations.ReadItem, operationType: OperationType.Read, operationIndex: this.operations.Count, @@ -101,7 +108,7 @@ public override TransactionalBatch UpsertItem( throw new ArgumentNullException(nameof(item)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationName: OpenTelemetryConstants.Operations.UpsertItem, operationType: OperationType.Upsert, operationIndex: this.operations.Count, @@ -121,8 +128,8 @@ public override TransactionalBatch UpsertItemStream( throw new ArgumentNullException(nameof(streamPayload)); } - this.AddOperation(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.UpsertItemStream, + this.operations.Add(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.UpsertItem, operationType: OperationType.Upsert, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -147,7 +154,7 @@ public override TransactionalBatch ReplaceItem( throw new ArgumentNullException(nameof(item)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationName: OpenTelemetryConstants.Operations.ReplaceItem, operationType: OperationType.Replace, operationIndex: this.operations.Count, @@ -174,8 +181,8 @@ public override TransactionalBatch ReplaceItemStream( throw new ArgumentNullException(nameof(streamPayload)); } - this.AddOperation(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.ReplaceItemStream, + this.operations.Add(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.ReplaceItem, operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -195,7 +202,7 @@ public override TransactionalBatch DeleteItem( throw new ArgumentNullException(nameof(id)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationName: OpenTelemetryConstants.Operations.DeleteItem, operationType: OperationType.Delete, operationIndex: this.operations.Count, @@ -224,14 +231,8 @@ public override Task ExecuteAsync( TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken = default) { - string operationName = OpenTelemetryConstants.Operations.ExecuteBatch; - if (this.isHomogenousOperations) - { - operationName = OpenTelemetryConstants.Operations.ExecuteBatchPrefix + this.homogenousOperation; - } - return this.container.ClientContext.OperationHelperAsync( - operationName: operationName, + operationName: OpenTelemetryConstants.Operations.ExecuteBatch, containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Batch, @@ -263,8 +264,8 @@ public virtual TransactionalBatch PatchItemStream( Stream patchStream, TransactionalBatchPatchItemRequestOptions requestOptions = null) { - this.AddOperation(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.PatchItemStream, + this.operations.Add(new ItemBatchOperation( + operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, @@ -300,7 +301,7 @@ public override TransactionalBatch PatchItem( PatchSpec patchSpec = new PatchSpec(patchOperations, requestOptions); - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: this.operations.Count, diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs index e5605c1b6c..e5120ddf5a 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs @@ -5,8 +5,6 @@ namespace Microsoft.Azure.Cosmos { using System.Collections.Generic; - using System.Linq; - using Microsoft.Azure.Documents; /// /// Represents an internal abstract class for handling transactional batches of operations. @@ -15,47 +13,5 @@ namespace Microsoft.Azure.Cosmos /// internal abstract class TransactionalBatchInternal : TransactionalBatch { - /// - /// The list of operations in the batch. - /// - protected List operations; - - /// - /// Initializes a new instance of the class. - /// - public TransactionalBatchInternal() - { - this.operations = new List(); - } - - /// - /// Indicates whether all operations in the batch are of the same type. - /// - internal bool isHomogenousOperations = true; - - /// - /// Stores the operation type if all operations in the batch are of the same type; otherwise, null. - /// - internal string homogenousOperation = null; - - /// - /// Adds an operation to the batch. - /// - /// The operation to add to the batch. - /// - /// This method performs the following actions: - /// 1. Checks if the batch is homogeneous (all operations of the same type) and if the new operation's type matches the type of the existing operations. - /// 2. Updates the flag and the property based on the check. - /// 3. Adds the operation to the list of operations. - /// - protected void AddOperation(ItemBatchOperation itemBatchOperation) - { - if (this.isHomogenousOperations && this.operations.Count > 0) - { - this.isHomogenousOperations = this.operations.First()?.OperationName == itemBatchOperation.OperationName; - this.homogenousOperation = this.isHomogenousOperations ? itemBatchOperation.OperationName : null; - } - this.operations.Add(itemBatchOperation); - } } } diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index 640899a974..47499b6989 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -1191,7 +1191,7 @@ public virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateDatabaseStream, + operationName: OpenTelemetryConstants.Operations.CreateDatabase, containerName: null, databaseName: databaseProperties.Id, operationType: OperationType.Create, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index bfb97e3a22..acb5cf2602 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -51,7 +51,7 @@ public override Task ReadContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadContainerStream, + operationName: OpenTelemetryConstants.Operations.ReadContainer, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -81,7 +81,7 @@ public override Task ReplaceContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceContainerStream, + operationName: OpenTelemetryConstants.Operations.ReplaceContainer, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -109,7 +109,7 @@ public override Task DeleteContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteContainerStream, + operationName: OpenTelemetryConstants.Operations.DeleteContainer, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -214,7 +214,7 @@ Task func(ITrace trace) } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateItemStream, + operationName: OpenTelemetryConstants.Operations.CreateItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, @@ -245,7 +245,7 @@ public override Task ReadItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadItemStream, + operationName: OpenTelemetryConstants.Operations.ReadItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -277,7 +277,7 @@ public override Task UpsertItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.UpsertItemStream, + operationName: OpenTelemetryConstants.Operations.UpsertItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, @@ -310,7 +310,7 @@ public override Task ReplaceItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceItemStream, + operationName: OpenTelemetryConstants.Operations.ReplaceItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, @@ -343,7 +343,7 @@ public override Task DeleteItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteItemStream, + operationName: OpenTelemetryConstants.Operations.DeleteItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -376,7 +376,7 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.PatchItemStream, + operationName: OpenTelemetryConstants.Operations.PatchItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, @@ -393,7 +393,7 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.PatchItemStream, + operationName: OpenTelemetryConstants.Operations.PatchItem, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, @@ -425,7 +425,7 @@ public override Task ReadManyItemsStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadManyItemsStream, + operationName: OpenTelemetryConstants.Operations.ReadManyItems, containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs index 0ba7fc2162..aaa2261234 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs @@ -93,7 +93,7 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainerStream, + operationName: OpenTelemetryConstants.Operations.CreateContainer, containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, @@ -142,7 +142,7 @@ public override Task DeleteStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteDatabaseStream, + operationName: OpenTelemetryConstants.Operations.DeleteDatabase, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, @@ -250,7 +250,7 @@ public override Task ReadStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadDatabaseStream, + operationName: OpenTelemetryConstants.Operations.ReadDatabase, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -353,7 +353,7 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainerStream, + operationName: OpenTelemetryConstants.Operations.CreateContainer, containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Create, diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs index 8e787bf241..a19f59a068 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs @@ -48,7 +48,7 @@ internal FeedIteratorInlineCore( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.TypedQueryItems, + operationName: OpenTelemetryConstants.Operations.QueryItems, containerName: this.container?.Id, databaseName: this.container?.Database.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs index 5add1e4997..84405130cf 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -10,8 +10,6 @@ public static class Operations { // Batch/Bulk Operations public const string ExecuteBatch = "execute_batch"; - public const string ExecuteBatchPrefix = "batch_"; - public const string ExecuteBulk = "execute_bulk"; public const string ExecuteBulkPrefix = "bulk_"; // Change feed operations @@ -30,44 +28,29 @@ public static class Operations //Container Operations public const string CreateContainer = "create_container"; - public const string CreateContainerStream = "create_container_stream"; public const string CreateContainerIfNotExists = "create_container_if_not_exists"; public const string DeleteContainer = "delete_container"; - public const string DeleteContainerStream = "delete_container_stream"; public const string ReadContainer = "read_container"; - public const string ReadContainerStream = "read_container_stream"; public const string ReplaceContainer = "replace_container"; - public const string ReplaceContainerStream = "replace_container_stream"; public const string ReadFeedRanges = "read_feed_ranges"; public const string ReadPartitionKeyRanges = "read_partition_key_ranges"; // Database Operations public const string CreateDatabase = "create_database"; - public const string CreateDatabaseStream = "create_database_stream"; public const string CreateDatabaseIfNotExists = "create_database_if_not_exists"; public const string DeleteDatabase = "delete_database"; - public const string DeleteDatabaseStream = "delete_database_stream"; public const string ReadDatabase = "read_database"; - public const string ReadDatabaseStream = "read_database_stream"; // Item Operations public const string CreateItem = "create_item"; - public const string CreateItemStream = "create_item_stream"; public const string DeleteAllItemsByPartitionKeyStream = "delete_all_items_by_partition_key_stream"; public const string DeleteItem = "delete_item"; - public const string DeleteItemStream = "delete_item_stream"; public const string PatchItem = "patch_item"; - public const string PatchItemStream = "patch_item_stream"; public const string QueryItems = "query_items"; - public const string TypedQueryItems = "typed_query_items"; public const string ReadManyItems = "read_many_items"; - public const string ReadManyItemsStream = "read_many_items_stream"; public const string ReadItem = "read_item"; - public const string ReadItemStream = "read_item_stream"; public const string ReplaceItem = "replace_item"; - public const string ReplaceItemStream = "replace_item_stream"; public const string UpsertItem = "upsert_item"; - public const string UpsertItemStream = "upsert_item_stream"; // Permission operations public const string CreatePermission = "create_permission"; 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 38731ad9f8..0aa023efeb 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 @@ -187,7 +187,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - batch_create_item + execute_batch databaseName containerName cosmosdb 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 b698159be3..1ffc916779 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 @@ -1153,7 +1153,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1788,10 +1788,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1807,10 +1807,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1826,10 +1826,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1845,10 +1845,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2627,7 +2627,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3262,10 +3262,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3281,10 +3281,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3300,10 +3300,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3319,10 +3319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb 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 d7e0cc8749..2b182e75be 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 @@ -722,7 +722,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1352,10 +1352,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1373,10 +1373,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1394,10 +1394,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2146,7 +2146,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2776,10 +2776,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2797,10 +2797,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2818,10 +2818,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2871,7 +2871,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3572,10 +3572,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3593,10 +3593,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -3614,10 +3614,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -4377,7 +4377,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -5014,10 +5014,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -5035,10 +5035,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -5056,10 +5056,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb 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 97cddae63b..c023163156 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 @@ -683,7 +683,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1279,10 +1279,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1299,10 +1299,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -1319,10 +1319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2031,7 +2031,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2627,10 +2627,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2647,10 +2647,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb @@ -2667,10 +2667,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - typed_query_items + query_items databaseName containerName cosmosdb 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 78ac6e98c7..7e8bcd1f8b 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 @@ -12,7 +12,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_many_items_stream + read_many_items databaseName containerName cosmosdb 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 7b3c8645f0..60b4ab3f92 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 @@ -18,7 +18,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item_stream + create_item databaseName containerName cosmosdb @@ -134,7 +134,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_item_stream + read_item databaseName containerName cosmosdb @@ -258,7 +258,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - replace_item_stream + replace_item databaseName containerName cosmosdb @@ -377,7 +377,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - delete_item_stream + delete_item databaseName containerName cosmosdb diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs index 6550805ba4..db1e4669ee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs @@ -74,11 +74,11 @@ public async Task CosmosEndToEndNullReferenceExceptionTestAsync() catch (NullReferenceException nre) { Assert.AreEqual(typeof(CosmosNullReferenceException), nre.GetType()); - Assert.IsTrue(nre.Message.Contains(OpenTelemetryConstants.Operations.TypedQueryItems)); + Assert.IsTrue(nre.Message.Contains(OpenTelemetryConstants.Operations.QueryItems)); string cosmosToString = nre.ToString(); Assert.IsFalse(cosmosToString.Contains("Microsoft.Azure.Cosmos.CosmosNullReferenceException"), $"The internal wrapper exception should not be exposed to users. {cosmosToString}"); Assert.IsTrue(cosmosToString.Contains(errorMessage)); - Assert.IsTrue(cosmosToString.Contains(OpenTelemetryConstants.Operations.TypedQueryItems)); + Assert.IsTrue(cosmosToString.Contains(OpenTelemetryConstants.Operations.QueryItems)); } } } 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 2bf652a5aa..9639de4e39 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 @@ -1531,7 +1531,7 @@ public override Output ExecuteTest(Input input) oTelActivitiesString.Append(""); } - AssertTraceProperites(input.Trace); + AssertTraceProperties(input.Trace); Assert.IsTrue(text.Contains("Client Side Request Stats"), $"All diagnostics should have request stats: {text}"); Assert.IsTrue(json.Contains("Client Side Request Stats"), $"All diagnostics should have request stats: {json}"); Assert.IsTrue(text.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {text}"); @@ -1620,23 +1620,13 @@ private static JObject FindChild( } - private static void AssertTraceProperites(ITrace trace) + private static void AssertTraceProperties(ITrace trace) { - if (trace.Name == OpenTelemetryConstants.Operations.ReadManyItemsStream || - trace.Name == OpenTelemetryConstants.Operations.ReadManyItems) + if (trace.Name == OpenTelemetryConstants.Operations.ReadManyItems || // skip test for read many as the queries are done in parallel + trace.Name == OpenTelemetryConstants.Operations.QueryChangeFeedEstimator || // Change Feed Estimator issues parallel requests + trace.Children.Count == 0) // Base case { - return; // skip test for read many as the queries are done in parallel - } - - if (trace.Name == OpenTelemetryConstants.Operations.QueryChangeFeedEstimator) - { - return; // Change Feed Estimator issues parallel requests - } - - if (trace.Children.Count == 0) - { - // Base case - return; + return; } // Trace stopwatch should be greater than the sum of all children's stop watches @@ -1645,7 +1635,7 @@ private static void AssertTraceProperites(ITrace trace) foreach (ITrace child in trace.Children) { sumOfChildrenTimeSpan += child.Duration; - AssertTraceProperites(child); + AssertTraceProperties(child); } if (rootTimeSpan < sumOfChildrenTimeSpan) From a3ea4991e85629032588c45dc01c62a581fc6da5 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 30 Aug 2024 14:18:03 +0530 Subject: [PATCH 06/22] fixed operatio name --- Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs | 10 - .../src/Batch/ItemBatchOperation.cs | 12 +- .../src/Resource/ClientContextCore.cs | 8 +- .../OpenTelemetry/OpenTelemetryAttributes.cs | 5 + .../OpenTelemetryCoreRecorder.cs | 21 +- .../OpenTelemetry/OpenTelemetryResponse.cs | 5 +- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 18 +- ...iterBaselineTests.BatchOperationsAsync.xml | 4 +- ...riterBaselineTests.BulkOperationsAsync.xml | 201 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 42 ++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 6 - ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 ++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 4 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 8 +- .../ClientTelemetryTestsBase.cs | 2 +- .../Batch/BatchAsyncBatcherTests.cs | 4 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 1 - .../Batch/BatchAsyncOperationContextTests.cs | 30 +-- .../Batch/BatchAsyncStreamerTests.cs | 6 +- .../Batch/BatchRequestPayloadReader.cs | 1 - .../Batch/BatchSchemaTests.cs | 7 +- .../Batch/PartitionKeyBatchResponseTests.cs | 4 +- ...titionKeyRangeBatchExecutionResultTests.cs | 4 +- ...artitionKeyRangeServerBatchRequestTests.cs | 4 +- .../Telemetry/OpenTelemetryRecorderTests.cs | 4 +- 29 files changed, 261 insertions(+), 262 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index 259cbbeafd..be2a26207d 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs @@ -49,7 +49,6 @@ public override TransactionalBatch CreateItem( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: this.operations.Count, resource: item, @@ -69,7 +68,6 @@ public override TransactionalBatch CreateItemStream( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -89,7 +87,6 @@ public override TransactionalBatch ReadItem( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.ReadItem, operationType: OperationType.Read, operationIndex: this.operations.Count, id: id, @@ -109,7 +106,6 @@ public override TransactionalBatch UpsertItem( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.UpsertItem, operationType: OperationType.Upsert, operationIndex: this.operations.Count, resource: item, @@ -129,7 +125,6 @@ public override TransactionalBatch UpsertItemStream( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.UpsertItem, operationType: OperationType.Upsert, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -155,7 +150,6 @@ public override TransactionalBatch ReplaceItem( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.ReplaceItem, operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -182,7 +176,6 @@ public override TransactionalBatch ReplaceItemStream( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.ReplaceItem, operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -203,7 +196,6 @@ public override TransactionalBatch DeleteItem( } this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.DeleteItem, operationType: OperationType.Delete, operationIndex: this.operations.Count, id: id, @@ -265,7 +257,6 @@ public virtual TransactionalBatch PatchItemStream( TransactionalBatchPatchItemRequestOptions requestOptions = null) { this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, @@ -302,7 +293,6 @@ public override TransactionalBatch PatchItem( PatchSpec patchSpec = new PatchSpec(patchOperations, requestOptions); this.operations.Add(new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, diff --git a/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs b/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs index eb1f7438cf..768b8f7762 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/ItemBatchOperation.cs @@ -28,7 +28,6 @@ internal class ItemBatchOperation : IDisposable private bool isDisposed; public ItemBatchOperation( - string operationName, OperationType operationType, int operationIndex, PartitionKey partitionKey, @@ -44,11 +43,9 @@ public ItemBatchOperation( this.ResourceStream = resourceStream; this.RequestOptions = requestOptions; this.ClientContext = cosmosClientContext; - this.OperationName = operationName; } public ItemBatchOperation( - string operationName, OperationType operationType, int operationIndex, ContainerInternal containerCore, @@ -56,7 +53,6 @@ public ItemBatchOperation( Stream resourceStream = null, TransactionalBatchItemRequestOptions requestOptions = null) { - this.OperationName = operationName; this.OperationType = operationType; this.OperationIndex = operationIndex; this.ContainerInternal = containerCore; @@ -66,8 +62,6 @@ public ItemBatchOperation( this.ClientContext = containerCore.ClientContext; } - public string OperationName { get; internal set; } - public PartitionKey? PartitionKey { get; internal set; } public string Id { get; } @@ -310,7 +304,6 @@ internal class ItemBatchOperation : ItemBatchOperation #pragma warning restore SA1402 // File may only contain a single type { public ItemBatchOperation( - string operationName, OperationType operationType, int operationIndex, PartitionKey partitionKey, @@ -318,20 +311,19 @@ public ItemBatchOperation( string id = null, TransactionalBatchItemRequestOptions requestOptions = null, CosmosClientContext cosmosClientContext = null) - : base(operationName, operationType, operationIndex, partitionKey: partitionKey, id: id, requestOptions: requestOptions, cosmosClientContext: cosmosClientContext) + : base(operationType, operationIndex, partitionKey: partitionKey, id: id, requestOptions: requestOptions, cosmosClientContext: cosmosClientContext) { this.Resource = resource; } public ItemBatchOperation( - string operationName, OperationType operationType, int operationIndex, T resource, ContainerInternal containerCore, string id = null, TransactionalBatchItemRequestOptions requestOptions = null) - : base(operationName, operationType, operationIndex, containerCore: containerCore, id: id, requestOptions: requestOptions) + : base(operationType, operationIndex, containerCore: containerCore, id: id, requestOptions: requestOptions) { this.Resource = resource; } diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 1a0b7232c2..2c5a1aefaa 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -565,7 +565,6 @@ private async Task ProcessResourceOperationAsBulkStreamAsync( ItemRequestOptions itemRequestOptions = requestOptions as ItemRequestOptions; TransactionalBatchItemRequestOptions batchItemRequestOptions = TransactionalBatchItemRequestOptions.FromItemRequestOptions(itemRequestOptions); ItemBatchOperation itemBatchOperation = new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.ExecuteBatch, operationType: operationType, operationIndex: 0, partitionKey: partitionKey, @@ -588,7 +587,12 @@ private bool IsBulkOperationSupported( OperationType operationType) { this.ThrowIfDisposed(); - if (!this.ClientOptions.AllowBulkExecution) + return IsBulk(this.ClientOptions.AllowBulkExecution, resourceType, operationType); + } + + public static bool IsBulk(bool isBulkConfigured, ResourceType resourceType, OperationType operationType) + { + if (!isBulkConfigured) { return false; } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index d4a5edf2a4..3dd7ae877e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -70,6 +70,11 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage) /// internal Documents.OperationType OperationType { get; set; } + /// + /// ResourceType + /// + internal Documents.ResourceType? ResourceType { get; set; } + /// /// Batch Size /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index ff35a94054..325c6feffa 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System.Diagnostics; using global::Azure.Core; using Microsoft.Azure.Cosmos.Telemetry.Diagnostics; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; /// @@ -26,8 +27,12 @@ internal struct OpenTelemetryCoreRecorder : IDisposable private readonly OperationType operationType = OperationType.Invalid; private readonly string connectionModeCache = null; + private readonly bool isBulkEnabled = false; + private OpenTelemetryAttributes response = null; + private string operationName = null; + /// /// Maps exception types to actions that record their OpenTelemetry attributes. /// @@ -64,15 +69,16 @@ private OpenTelemetryCoreRecorder( this.scope = scope; this.config = config; + this.operationName = operationName; this.operationType = operationType; this.connectionModeCache = Enum.GetName(typeof(ConnectionMode), clientContext.ClientOptions.ConnectionMode); + this.isBulkEnabled = clientContext.ClientOptions.AllowBulkExecution; if (scope.IsEnabled) { this.scope.Start(); this.Record( - operationName: operationName, containerName: containerName, databaseName: databaseName, clientContext: clientContext); @@ -132,19 +138,16 @@ public void Record(string key, string value) /// /// Recording information /// - /// /// /// /// public void Record( - string operationName, string containerName, string databaseName, CosmosClientContext clientContext) { if (this.IsEnabled) { - this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbOperation, operationName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbName, databaseName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ContainerName, containerName); @@ -227,11 +230,17 @@ public void Dispose() OperationType operationType = (this.response == null || this.response?.OperationType == OperationType.Invalid) ? this.operationType : this.response.OperationType; - string operationName = Enum.GetName(typeof(OperationType), operationType); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationName); + string operationTypeName = Enum.GetName(typeof(OperationType), operationType); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationTypeName); if (this.response != null) { + if (this.response.ResourceType is not null && ClientContextCore.IsBulk(this.isBulkEnabled, this.response.ResourceType.Value, this.operationType)) + { + this.operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + this.operationName; + } + this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbOperation, this.operationName); + if (this.response.BatchSize is not null) { this.scope.AddIntegerAttribute(OpenTelemetryAttributeKeys.BatchSize, (int)this.response.BatchSize); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 5b685d3d5c..5166940883 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -24,7 +24,7 @@ internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage) subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - batchSize: responseMessage.GetBatchSize() ) + batchSize: responseMessage.GetBatchSize()) { } @@ -39,8 +39,7 @@ internal OpenTelemetryResponse(ResponseMessage responseMessage) subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid - ) + operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) { } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 976b68173a..692a0aa552 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos using System; using System.Net; using Microsoft.Azure.Cosmos.Core.Trace; + using Microsoft.Azure.Documents; using Telemetry; internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes @@ -37,10 +38,21 @@ internal OpenTelemetryResponse(Response responseMessage) subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) + operationType: GetOperationType(responseMessage), + resourceType: GetResourceType(responseMessage)) { } + private static OperationType GetOperationType(Response responseMessage) + { + return responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid; + } + + private static ResourceType? GetResourceType(Response responseMessage) + { + return responseMessage is ItemResponse ? Documents.ResourceType.Document : null; + } + private OpenTelemetryResponse( HttpStatusCode statusCode, double? requestCharge, @@ -51,7 +63,8 @@ private OpenTelemetryResponse( Documents.SubStatusCodes? subStatusCode, string activityId, string correlatedActivityId, - Documents.OperationType operationType) + Documents.OperationType operationType, + Documents.ResourceType? resourceType = null) : base(requestMessage) { this.StatusCode = statusCode; @@ -63,6 +76,7 @@ private OpenTelemetryResponse( this.ActivityId = activityId; this.CorrelatedActivityId = correlatedActivityId; this.OperationType = operationType; + this.ResourceType = resourceType; } private static Headers GetHeader(FeedResponse responseMessage) 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 0aa023efeb..8d8fc72372 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 @@ -142,7 +142,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - execute_batch databaseName containerName cosmosdb @@ -152,6 +151,7 @@ Some Value Direct Batch + execute_batch 90 Some Value Some Value @@ -295,7 +295,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - execute_batch databaseName containerName cosmosdb @@ -305,6 +304,7 @@ Some Value Direct Batch + execute_batch 50 Some Value Some Value 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 79c7d4ba4b..9db11f83f8 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 @@ -166,7 +166,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -176,6 +175,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -184,7 +184,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -194,6 +193,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -202,7 +202,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -212,6 +211,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -220,7 +220,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -230,6 +229,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -238,7 +238,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -248,6 +247,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -256,7 +256,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -266,6 +265,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -274,7 +274,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -284,6 +283,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -292,7 +292,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -302,6 +301,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -310,7 +310,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -320,6 +319,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -328,7 +328,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -338,6 +337,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -503,7 +503,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -513,6 +512,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -521,7 +521,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -531,6 +530,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -539,7 +539,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -549,6 +548,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -557,7 +557,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -567,6 +566,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -575,7 +575,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -585,6 +584,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -593,7 +593,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -603,6 +602,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -611,7 +611,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -621,6 +620,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -629,7 +629,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -639,6 +638,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -647,7 +647,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -657,6 +656,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -665,7 +665,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -675,6 +674,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -840,7 +840,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -850,6 +849,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -858,7 +858,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -868,6 +867,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -876,7 +876,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -886,6 +885,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -894,7 +894,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -904,6 +903,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -912,7 +912,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -922,6 +921,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -930,7 +930,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -940,6 +939,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -948,7 +948,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -958,6 +957,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -966,7 +966,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -976,6 +975,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -984,7 +984,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -994,6 +993,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1002,7 +1002,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1012,6 +1011,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1177,7 +1177,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1187,6 +1186,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1195,7 +1195,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1205,6 +1204,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1213,7 +1213,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1223,6 +1222,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1231,7 +1231,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1241,6 +1240,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1249,7 +1249,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1259,6 +1258,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1267,7 +1267,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1277,6 +1276,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1285,7 +1285,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1295,6 +1294,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1303,7 +1303,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1313,6 +1312,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1321,7 +1321,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1331,6 +1330,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1339,7 +1339,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1349,6 +1348,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1514,7 +1514,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1524,6 +1523,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1532,7 +1532,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1542,6 +1541,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1550,7 +1550,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1560,6 +1559,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1568,7 +1568,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1578,6 +1577,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1586,7 +1586,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1596,6 +1595,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1604,7 +1604,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1614,6 +1613,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1622,7 +1622,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1632,6 +1631,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1640,7 +1640,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1650,6 +1649,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1658,7 +1658,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1668,6 +1667,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1676,7 +1676,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1686,6 +1685,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1851,7 +1851,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1861,6 +1860,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1869,7 +1869,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1879,6 +1878,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1887,7 +1887,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1897,6 +1896,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1905,7 +1905,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1915,6 +1914,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1923,7 +1923,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1933,6 +1932,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1941,7 +1941,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1951,6 +1950,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1959,7 +1959,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1969,6 +1968,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1977,7 +1977,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1987,6 +1986,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -1995,7 +1995,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2005,6 +2004,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2013,7 +2013,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2023,6 +2022,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2188,7 +2188,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2198,6 +2197,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2206,7 +2206,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2216,6 +2215,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2224,7 +2224,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2234,6 +2233,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2242,7 +2242,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2252,6 +2251,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2260,7 +2260,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2270,6 +2269,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2278,7 +2278,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2288,6 +2287,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2296,7 +2296,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2306,6 +2305,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2314,7 +2314,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2324,6 +2323,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2332,7 +2332,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2342,6 +2341,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2350,7 +2350,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2360,6 +2359,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2525,7 +2525,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2535,6 +2534,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2543,7 +2543,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2553,6 +2552,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2561,7 +2561,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2571,6 +2570,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2579,7 +2579,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2589,6 +2588,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2597,7 +2597,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2607,6 +2606,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2615,7 +2615,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2625,6 +2624,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2633,7 +2633,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2643,6 +2642,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2651,7 +2651,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2661,6 +2660,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2669,7 +2669,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2679,6 +2678,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2687,7 +2687,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2697,6 +2696,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2862,7 +2862,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2872,6 +2871,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2880,7 +2880,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2890,6 +2889,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2898,7 +2898,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2908,6 +2907,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2916,7 +2916,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2926,6 +2925,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2934,7 +2934,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2944,6 +2943,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2952,7 +2952,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2962,6 +2961,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2970,7 +2970,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2980,6 +2979,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -2988,7 +2988,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -2998,6 +2997,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3006,7 +3006,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3016,6 +3015,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3024,7 +3024,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3034,6 +3033,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3199,7 +3199,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3209,6 +3208,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3217,7 +3217,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3227,6 +3226,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3235,7 +3235,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3245,6 +3244,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3253,7 +3253,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3263,6 +3262,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3271,7 +3271,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3281,6 +3280,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3289,7 +3289,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3299,6 +3298,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3307,7 +3307,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3317,6 +3316,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3325,7 +3325,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3335,6 +3334,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3343,7 +3343,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3353,6 +3352,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -3361,7 +3361,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -3371,6 +3370,7 @@ Some Value Direct Create + bulk_create_item Some Value Some Value Some Value @@ -4153,7 +4153,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb 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 1ffc916779..37a610dbba 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 @@ -1026,7 +1026,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -1036,6 +1035,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -1045,7 +1045,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -1055,6 +1054,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -1064,7 +1064,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -1074,6 +1073,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -1083,7 +1083,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -1093,6 +1092,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -1102,7 +1102,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -1112,6 +1111,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -1772,7 +1772,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1782,6 +1781,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1791,7 +1791,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1801,6 +1800,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1810,7 +1810,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1820,6 +1819,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1829,7 +1829,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1839,6 +1838,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1848,7 +1848,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1858,6 +1857,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -2499,7 +2499,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -2509,6 +2508,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -2518,7 +2518,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -2528,6 +2527,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -2537,7 +2537,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -2547,6 +2546,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -2556,7 +2556,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -2566,6 +2565,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -2575,7 +2575,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed databaseName containerName cosmosdb @@ -2585,6 +2584,7 @@ Some Value Direct ReadFeed + query_change_feed Some Value Some Value Some Value @@ -3246,7 +3246,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3256,6 +3255,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -3265,7 +3265,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3275,6 +3274,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -3284,7 +3284,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3294,6 +3293,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -3303,7 +3303,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3313,6 +3312,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -3322,7 +3322,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3332,6 +3331,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -3647,7 +3647,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed_estimator databaseName containerName cosmosdb @@ -3657,6 +3656,7 @@ Some Value Direct ReadFeed + query_change_feed_estimator Some Value Some Value Some Value 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 e5a8ecb1a7..a01be81919 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 @@ -120,7 +120,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - delete_database miscdbcustonhandler cosmosdb Some Value @@ -129,6 +128,7 @@ Some Value Direct Delete + delete_database Some Value Some Value Some Value @@ -137,7 +137,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_database miscdbcustonhandler cosmosdb Some Value @@ -146,6 +145,7 @@ Some Value Direct Create + create_database Some Value Some Value Some Value @@ -261,7 +261,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - delete_database miscdbdataplane cosmosdb Some Value @@ -270,6 +269,7 @@ Some Value Direct Delete + delete_database Some Value Some Value Some Value @@ -278,7 +278,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_database miscdbdataplane cosmosdb Some Value @@ -287,6 +286,7 @@ Some Value Direct Create + create_database Some Value Some Value Some Value 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 441ac59832..1724944558 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 @@ -161,7 +161,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -438,7 +437,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -693,7 +691,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -980,7 +977,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1331,7 +1327,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -1515,7 +1510,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb 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 2b182e75be..d7164c03d4 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 @@ -613,7 +613,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -623,6 +622,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -634,7 +634,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -644,6 +643,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -655,7 +655,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -665,6 +664,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -676,7 +676,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -686,6 +685,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -1334,7 +1334,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1344,6 +1343,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -1355,7 +1355,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1365,6 +1364,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -1376,7 +1376,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1386,6 +1385,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -1397,7 +1397,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1407,6 +1406,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2036,7 +2036,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2046,6 +2045,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2057,7 +2057,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2067,6 +2066,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2078,7 +2078,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2088,6 +2087,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2099,7 +2099,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2109,6 +2108,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2758,7 +2758,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2768,6 +2767,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2779,7 +2779,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2789,6 +2788,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2800,7 +2800,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2810,6 +2809,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -2821,7 +2821,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2831,6 +2830,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -3554,7 +3554,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3564,6 +3563,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -3575,7 +3575,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3585,6 +3584,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -3596,7 +3596,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3606,6 +3605,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -3617,7 +3617,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -3627,6 +3626,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -4265,7 +4265,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -4275,6 +4274,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -4286,7 +4286,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -4296,6 +4295,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -4307,7 +4307,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -4317,6 +4316,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -4328,7 +4328,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -4338,6 +4337,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -4996,7 +4996,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -5006,6 +5005,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -5017,7 +5017,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -5027,6 +5026,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -5038,7 +5038,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -5048,6 +5047,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value @@ -5059,7 +5059,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -5069,6 +5068,7 @@ Some Value Direct Query + query_items Some Value Some Value Some Value 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 c023163156..36150430b6 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 @@ -579,7 +579,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -589,6 +588,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -599,7 +599,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -609,6 +608,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -619,7 +619,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -629,6 +628,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -639,7 +639,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -649,6 +648,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1262,7 +1262,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1272,6 +1271,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1282,7 +1282,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1292,6 +1291,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1302,7 +1302,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1312,6 +1311,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1322,7 +1322,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1332,6 +1331,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1926,7 +1926,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1936,6 +1935,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1946,7 +1946,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1956,6 +1955,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1966,7 +1966,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1976,6 +1975,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -1986,7 +1986,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -1996,6 +1995,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -2610,7 +2610,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2620,6 +2619,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -2630,7 +2630,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2640,6 +2639,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -2650,7 +2650,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2660,6 +2659,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value @@ -2670,7 +2670,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items databaseName containerName cosmosdb @@ -2680,6 +2679,7 @@ Some Value Direct ReadFeed + query_items Some Value Some Value Some Value 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 7e8bcd1f8b..6ad86dc458 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 @@ -554,7 +554,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_many_items databaseName containerName cosmosdb @@ -564,6 +563,7 @@ Some Value Direct Read + read_many_items Some Value Some Value Some Value @@ -1139,7 +1139,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_many_items databaseName containerName cosmosdb @@ -1149,6 +1148,7 @@ Some Value Direct Read + read_many_items Some Value Some Value Some Value 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 60b4ab3f92..18de70d8fd 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 @@ -102,7 +102,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -112,6 +111,7 @@ Some Value Direct Create + create_item Some Value Some Value Some Value @@ -218,7 +218,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_item databaseName containerName cosmosdb @@ -228,6 +227,7 @@ Some Value Direct Read + read_item Some Value Some Value Some Value @@ -342,7 +342,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - replace_item databaseName containerName cosmosdb @@ -352,6 +351,7 @@ Some Value Direct Replace + replace_item Some Value Some Value Some Value @@ -461,7 +461,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - delete_item databaseName containerName cosmosdb @@ -471,6 +470,7 @@ Some Value Direct Delete + delete_item Some Value Some Value Some Value 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 da534cc3a2..c9cd9016f8 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 @@ -122,7 +122,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item databaseName containerName cosmosdb @@ -132,6 +131,7 @@ Some Value Direct Create + create_item Some Value Some Value Some Value @@ -243,7 +243,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_item databaseName containerName cosmosdb @@ -253,6 +252,7 @@ Some Value Direct Read + read_item Some Value Some Value Some Value @@ -377,7 +377,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - replace_item databaseName containerName cosmosdb @@ -387,6 +386,7 @@ Some Value Direct Replace + replace_item Some Value Some Value Some Value @@ -500,7 +500,6 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - delete_item databaseName containerName cosmosdb @@ -510,6 +509,7 @@ Some Value Direct Delete + delete_item Some Value Some Value Some Value diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs index b8ecaaa880..ac63d2bff7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs @@ -80,19 +80,19 @@ public async Task ValidateInvalidRequestOptionsAsync() string id = Guid.NewGuid().ToString(); MyDocument myDocument = new MyDocument() { id = id, Status = id }; - await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync(new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { SessionToken = "something" })); + await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync(new ItemBatchOperation(OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { SessionToken = "something" })); await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync( - new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), + new ItemBatchOperation(OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { Properties = new Dictionary() { { "test", "test" } } })); await Assert.ThrowsExceptionAsync(() => executor.ValidateOperationAsync( - new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), + new ItemBatchOperation(OperationType.Replace, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)), new ItemRequestOptions() { DedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions { MaxIntegratedCacheStaleness = TimeSpan.FromMinutes(3) } })); } private static ItemBatchOperation CreateItem(string id) { MyDocument myDocument = new MyDocument() { id = id, Status = id }; - return new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)); + return new ItemBatchOperation(OperationType.Create, 0, new Cosmos.PartitionKey(id), id, cosmosDefaultJsonSerializer.ToStream(myDocument)); } private class MyDocument diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index 5f3e2949f3..41fa6302d4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -1019,7 +1019,7 @@ private static void AssertCacheRefreshInfoInformation( private static ItemBatchOperation CreateItem(string itemId) { var testItem = new { id = itemId, Status = itemId }; - return new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, Documents.OperationType.Create, 0, new Cosmos.PartitionKey(itemId), itemId, TestCommon.SerializerCore.ToStream(testItem)); + return new ItemBatchOperation(Documents.OperationType.Create, 0, new Cosmos.PartitionKey(itemId), itemId, TestCommon.SerializerCore.ToStream(testItem)); } private async Task CreateClientAndContainer(ConnectionMode mode, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index 0fe8593f1a..700d8a48d5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -28,7 +28,6 @@ public class BatchAsyncBatcherTests private ItemBatchOperation CreateItemBatchOperation(bool withContext = false) { ItemBatchOperation operation = new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: 0, partitionKey: Cosmos.PartitionKey.Null, @@ -459,7 +458,6 @@ public async Task DispatchProcessInOrderAsync() for (int i = 0; i < 10; i++) { ItemBatchOperation operation = new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: i, partitionKey: new Cosmos.PartitionKey(i.ToString()), @@ -490,7 +488,7 @@ public async Task DispatchWithLessResponses() List operations = new List(10); for (int i = 0; i < 10; i++) { - ItemBatchOperation operation = new ItemBatchOperation(OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); ItemBatchOperationContext context = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(context); operations.Add(operation); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index c7a07a89e7..176425608b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -334,7 +334,6 @@ private static ItemBatchOperation CreateItem(string id) { MyDocument myDocument = new MyDocument() { id = id, Status = id }; return new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: 0, partitionKey: new Cosmos.PartitionKey(id), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs index 4bc8506e3e..7227da8f88 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs @@ -29,7 +29,7 @@ public async Task TraceIsJoinedOnCompletionWithRetry() Trace rootTrace = Trace.GetRootTrace(name: "RootTrace"); - ItemBatchOperation operation = new ItemBatchOperation(OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); // Start with the base trace ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(Guid.NewGuid().ToString(), rootTrace, retryPolicy); @@ -70,7 +70,7 @@ public async Task TraceIsJoinedOnCompletionWithoutRetry() Trace rootTrace = Trace.GetRootTrace(name: "RootTrace"); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); // Start with the base trace ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(Guid.NewGuid().ToString(), rootTrace, retryPolicy); @@ -104,7 +104,7 @@ public async Task TraceIsJoinedOnCompletionWithoutRetry() public void PartitionKeyRangeIdIsSetOnInitialization() { string expectedPkRangeId = Guid.NewGuid().ToString(); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(expectedPkRangeId, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -117,7 +117,7 @@ public void PartitionKeyRangeIdIsSetOnInitialization() [TestMethod] public void TaskIsCreatedOnInitialization() { - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -129,7 +129,7 @@ public void TaskIsCreatedOnInitialization() [TestMethod] public async Task TaskResultIsSetOnCompleteAsync() { - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -145,7 +145,7 @@ public async Task TaskResultIsSetOnCompleteAsync() public async Task ExceptionIsSetOnFailAsync() { Exception failure = new Exception("It failed"); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); ItemBatchOperationContext batchAsyncOperationContext = new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton); operation.AttachContext(batchAsyncOperationContext); @@ -159,7 +159,7 @@ public async Task ExceptionIsSetOnFailAsync() [TestMethod] public void CannotAttachMoreThanOnce() { - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton)); Assert.ThrowsException(() => operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton))); } @@ -168,7 +168,7 @@ public void CannotAttachMoreThanOnce() public async Task ShouldRetry_NoPolicy() { TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.OK); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsFalse(shouldRetryResult.ShouldRetry); @@ -182,7 +182,7 @@ public async Task ShouldRetry_WithPolicy_OnSuccess() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.OK); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsFalse(shouldRetryResult.ShouldRetry); @@ -196,7 +196,7 @@ public async Task ShouldRetry_WithPolicy_On429() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult((HttpStatusCode)StatusCodes.TooManyRequests); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -210,7 +210,7 @@ public async Task ShouldRetry_WithPolicy_On413_3402() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.RequestEntityTooLarge) { SubStatusCode = (SubStatusCodes)3402 }; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -224,7 +224,7 @@ public async Task ShouldRetry_WithPolicy_On413_0() OperationType.Create, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.RequestEntityTooLarge); - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsFalse(shouldRetryResult.ShouldRetry); @@ -238,7 +238,7 @@ public async Task ShouldRetry_WithPolicy_OnSplit() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.Gone) { SubStatusCode = SubStatusCodes.PartitionKeyRangeGone }; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -252,7 +252,7 @@ public async Task ShouldRetry_WithPolicy_OnCompletingSplit() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.Gone) { SubStatusCode = SubStatusCodes.CompletingSplit }; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); @@ -266,7 +266,7 @@ public async Task ShouldRetry_WithPolicy_OnCompletingPartitionMigration() OperationType.Read, new ResourceThrottleRetryPolicy(1)); TransactionalBatchOperationResult result = new TransactionalBatchOperationResult(HttpStatusCode.Gone) { SubStatusCode = SubStatusCodes.CompletingPartitionMigration }; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null); operation.AttachContext(new ItemBatchOperationContext(string.Empty, NoOpTrace.Singleton, retryPolicy)); ShouldRetryResult shouldRetryResult = await operation.Context.ShouldRetryAsync(result, default); Assert.IsTrue(shouldRetryResult.ShouldRetry); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index a35fab1160..1935285fda 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -23,7 +23,7 @@ public class BatchAsyncStreamerTests private const int MaxBatchByteSize = 100000; private const int defaultMaxDegreeOfConcurrency = 10; private static readonly Exception expectedException = new Exception(); - private readonly ItemBatchOperation ItemBatchOperation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null, "0"); + private readonly ItemBatchOperation ItemBatchOperation = new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null, "0"); private readonly TimerWheel TimerWheel = TimerWheel.CreateTimerWheel(TimeSpan.FromMilliseconds(50), 20); private readonly SemaphoreSlim limiter = new SemaphoreSlim(1, defaultMaxDegreeOfConcurrency); @@ -142,7 +142,7 @@ public async Task ValidatesCongestionControlAsync() List> contexts = new List>(100); for (int i = 0; i < 600; i++) { - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); ItemBatchOperationContext context = AttachContext(operation); batchAsyncStreamer.Add(operation); contexts.Add(context.OperationTask); @@ -173,7 +173,7 @@ public async Task DispatchesAsync() List> contexts = new List>(10); for (int i = 0; i < 10; i++) { - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Create, i, Cosmos.PartitionKey.Null, i.ToString()); ItemBatchOperationContext context = AttachContext(operation); batchAsyncStreamer.Add(operation); contexts.Add(context.OperationTask); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs index d919f64700..2ec57ab969 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs @@ -238,7 +238,6 @@ private static Result ReadOperation(ref RowReader reader, int operationIndex, ou } operation = new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: operationType, operationIndex: operationIndex, partitionKey: Cosmos.PartitionKey.Null, // ParsedPartitionKey is used for validation diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs index 4710760684..357cccaf84 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs @@ -33,7 +33,6 @@ public async Task BatchRequestSerializationAsync() ItemBatchOperation[] operations = new ItemBatchOperation[] { new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.CreateItem, operationType: OperationType.Create, operationIndex: 0, containerCore:containerCore) @@ -41,7 +40,6 @@ public async Task BatchRequestSerializationAsync() ResourceBody = new byte[] { 0x41, 0x42 } }, new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.ReplaceItem, id: "id2", operationType: OperationType.Replace, operationIndex: 1, @@ -90,7 +88,6 @@ public void TestWriteOperationWithBinaryIdByteArray() TransactionalBatchItemRequestOptions transactionalBatchItemRequestOptions = TransactionalBatchItemRequestOptions.FromItemRequestOptions(requestOptions); ItemBatchOperation operation = new ItemBatchOperation( - operationName: OpenTelemetryConstants.Operations.PatchItem, operationType: OperationType.Patch, operationIndex: 0, partitionKey: Cosmos.PartitionKey.Null, @@ -146,8 +143,8 @@ public async Task BatchResponseDeserializationAsync() operations: new ArraySegment( new ItemBatchOperation[] { - new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem,OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore), - new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem,OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore) + new ItemBatchOperation(OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore), + new ItemBatchOperation(OperationType.Read, operationIndex: 0, id: "someId", containerCore: containerCore) }), serializerCore: MockCosmosUtil.Serializer, trace: NoOpTrace.Singleton, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs index 6be964b526..fead59c950 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs @@ -28,7 +28,7 @@ public async Task StatusCodesAreSetThroughResponseAsync() List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) @@ -66,7 +66,7 @@ public async Task DiagnosticsAreSetThroughResponseAsync() List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs index 0c4d080940..a9367552b8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs @@ -41,7 +41,7 @@ public async Task StatusCodesAreSetThroughResponseAsync() List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReplaceItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) @@ -128,7 +128,7 @@ private async Task ConstainsSplitIsTrueInternal(HttpStatusCode statusCode, List results = new List(); ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - ItemBatchOperation operation = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); + ItemBatchOperation operation = new ItemBatchOperation(OperationType.Read, 0, Cosmos.PartitionKey.Null, "0"); results.Add( new TransactionalBatchOperationResult(HttpStatusCode.OK) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs index 151ac948ed..4168fe3ee2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs @@ -19,7 +19,7 @@ public class PartitionKeyRangeServerBatchRequestTests { private static ItemBatchOperation CreateItemBatchOperation(string id = "") { - return new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.CreateItem, OperationType.Create, 0, Cosmos.PartitionKey.Null, id, new MemoryStream(new byte[] { 0x41, 0x42 }, index: 0, count: 2, writable: false, publiclyVisible: true)); + return new ItemBatchOperation(OperationType.Create, 0, Cosmos.PartitionKey.Null, id, new MemoryStream(new byte[] { 0x41, 0x42 }, index: 0, count: 2, writable: false, publiclyVisible: true)); } [TestMethod] @@ -168,7 +168,7 @@ private static async Task GetTransactionalBatchRespo if(arrayOperations == null) { arrayOperations = new ItemBatchOperation[1]; - arrayOperations[0] = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, Documents.OperationType.Read, 0, new PartitionKey("0")); + arrayOperations[0] = new ItemBatchOperation(Documents.OperationType.Read, 0, new PartitionKey("0")); } SinglePartitionKeyServerBatchRequest batchRequest = await SinglePartitionKeyServerBatchRequest.CreateAsync( @@ -245,7 +245,7 @@ private static async Task GetPartitionKeyRangeBa { ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; - arrayOperations[0] = new ItemBatchOperation(operationName: OpenTelemetryConstants.Operations.ReadItem, Documents.OperationType.Read, 0, new PartitionKey("0")); + arrayOperations[0] = new ItemBatchOperation(Documents.OperationType.Read, 0, new PartitionKey("0")); PartitionKeyRangeBatchResponse partitionKeyRangeBatchResponse = new PartitionKeyRangeBatchResponse( arrayOperations.Length, await OpenTelemetryRecorderTests.GetTransactionalBatchResponse(arrayOperations), From d58a8c5c9757fb3ef4c7b1ad9037bdaed195a277 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 30 Aug 2024 15:23:03 +0530 Subject: [PATCH 07/22] reverted few files --- Microsoft.Azure.Cosmos.sln | 16 ++++++++++++++-- .../Batch/BatchAsyncContainerExecutorTests.cs | 1 - .../ClientTelemetryTestsBase.cs | 1 - .../Batch/BatchAsyncBatcherTests.cs | 1 - .../Batch/BatchAsyncContainerExecutorTests.cs | 1 - .../Batch/BatchAsyncOperationContextTests.cs | 1 - .../Batch/BatchAsyncStreamerTests.cs | 1 - .../Batch/BatchRequestPayloadReader.cs | 1 - .../Batch/BatchSchemaTests.cs | 1 - .../Batch/PartitionKeyBatchResponseTests.cs | 1 - ...PartitionKeyRangeBatchExecutionResultTests.cs | 1 - .../PartitionKeyRangeServerBatchRequestTests.cs | 1 - .../Telemetry/OpenTelemetryRecorderTests.cs | 1 - 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Microsoft.Azure.Cosmos.sln b/Microsoft.Azure.Cosmos.sln index d412905195..03a17e2f39 100644 --- a/Microsoft.Azure.Cosmos.sln +++ b/Microsoft.Azure.Cosmos.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29123.88 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Cosmos", "Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj", "{36F6F6A8-CEC8-4261-9948-903495BC3C25}" EndProject @@ -164,6 +164,18 @@ Global {B5B3631D-AC2F-4257-855D-D6FE12F20B60}.Release|Any CPU.Build.0 = Release|Any CPU {B5B3631D-AC2F-4257-855D-D6FE12F20B60}.Release|x64.ActiveCfg = Release|Any CPU {B5B3631D-AC2F-4257-855D-D6FE12F20B60}.Release|x64.Build.0 = Release|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|Any CPU.ActiveCfg = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|Any CPU.Build.0 = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|x64.ActiveCfg = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|x64.Build.0 = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|x64.ActiveCfg = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|x64.Build.0 = Debug|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|Any CPU.Build.0 = Release|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.ActiveCfg = Release|Any CPU + {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs index ac63d2bff7..86ea3cab79 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchAsyncContainerExecutorTests.cs @@ -8,7 +8,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Collections.Generic; using System.Net; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index 41fa6302d4..85e3496731 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Linq; using Cosmos.Util; using Microsoft.Azure.Cosmos.Telemetry.Models; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; public abstract class ClientTelemetryTestsBase : BaseCosmosClientHelper { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index 700d8a48d5..acc83d3ff4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -13,7 +13,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index 176425608b..c6bca20950 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs index 7227da8f88..8e3c6bcbc3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncOperationContextTests.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index 1935285fda..896eb0fade 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs index 2ec57ab969..74beb6d626 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchRequestPayloadReader.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos.Tests using Microsoft.Azure.Cosmos.Serialization.HybridRow; using Microsoft.Azure.Cosmos.Serialization.HybridRow.IO; using Microsoft.Azure.Cosmos.Serialization.HybridRow.RecordIO; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs index 357cccaf84..9fce10c298 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchSchemaTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.Azure.Cosmos.Tests using Microsoft.Azure.Cosmos.Core.Utf8; using Microsoft.Azure.Cosmos.Serialization.HybridRow; using Microsoft.Azure.Cosmos.Serialization.HybridRow.IO; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs index fead59c950..c081377f2c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyBatchResponseTests.cs @@ -13,7 +13,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Diagnostics; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs index a9367552b8..1e8c1488b4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeBatchExecutionResultTests.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs index 4168fe3ee2..e2ddfd3e13 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/PartitionKeyRangeServerBatchRequestTests.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Linq; using System.Threading; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs index a9e32cd83b..15ac38d85b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry using Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Scripts; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; From 20fd605e5c9a6a6d66c553fe743618a0a6abc3a8 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Sat, 31 Aug 2024 23:54:54 +0530 Subject: [PATCH 08/22] append prefix --- Microsoft.Azure.Cosmos.sln | 16 +- .../src/Resource/ClientContextCore.cs | 49 ++- .../Resource/Container/ContainerInlineCore.cs | 39 +- .../src/Resource/CosmosClientContext.cs | 1 + .../OpenTelemetryCoreRecorder.cs | 21 +- ...iterBaselineTests.BatchOperationsAsync.xml | 4 +- ...riterBaselineTests.BulkOperationsAsync.xml | 403 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 42 +- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 6 + ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 +-- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +- ...TraceWriterBaselineTests.ReadManyAsync.xml | 4 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Batch/BatchAsyncBatcherTests.cs | 5 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 5 +- .../Batch/BatchAsyncStreamerTests.cs | 5 +- .../ChangeFeedEstimatorIteratorTests.cs | 10 +- ...dPartitionKeyResultSetIteratorCoreTests.cs | 21 +- .../CosmosItemUnitTests.cs | 2 + .../FeedRange/ChangeFeedIteratorCoreTests.cs | 1 + 22 files changed, 384 insertions(+), 362 deletions(-) diff --git a/Microsoft.Azure.Cosmos.sln b/Microsoft.Azure.Cosmos.sln index 03a17e2f39..d412905195 100644 --- a/Microsoft.Azure.Cosmos.sln +++ b/Microsoft.Azure.Cosmos.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.10.35201.131 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29123.88 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Cosmos", "Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj", "{36F6F6A8-CEC8-4261-9948-903495BC3C25}" EndProject @@ -164,18 +164,6 @@ Global {B5B3631D-AC2F-4257-855D-D6FE12F20B60}.Release|Any CPU.Build.0 = Release|Any CPU {B5B3631D-AC2F-4257-855D-D6FE12F20B60}.Release|x64.ActiveCfg = Release|Any CPU {B5B3631D-AC2F-4257-855D-D6FE12F20B60}.Release|x64.Build.0 = Release|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|Any CPU.ActiveCfg = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|Any CPU.Build.0 = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|x64.ActiveCfg = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Cover|x64.Build.0 = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|x64.ActiveCfg = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Debug|x64.Build.0 = Debug|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|Any CPU.Build.0 = Release|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.ActiveCfg = Release|Any CPU - {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 2c5a1aefaa..0c3b90e19f 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -212,6 +212,7 @@ internal override Task RequestOptions requestOptions, Func> task, Func openTelemetry, + ResourceType? resourceType = null, TraceComponent traceComponent = TraceComponent.Transport, Tracing.TraceLevel traceLevel = Tracing.TraceLevel.Info) { @@ -224,7 +225,8 @@ internal override Task task, openTelemetry, traceComponent, - traceLevel) : + traceLevel, + resourceType) : this.OperationHelperWithRootTraceWithSynchronizationContextAsync( operationName, containerName, @@ -234,7 +236,8 @@ internal override Task task, openTelemetry, traceComponent, - traceLevel); + traceLevel, + resourceType); } private async Task OperationHelperWithRootTraceAsync( @@ -246,7 +249,8 @@ private async Task OperationHelperWithRootTraceAsync( Func> task, Func openTelemetry, TraceComponent traceComponent, - Tracing.TraceLevel traceLevel) + Tracing.TraceLevel traceLevel, + ResourceType? resourceType) { bool disableDiagnostics = requestOptions != null && requestOptions.DisablePointOperationDiagnostics; @@ -262,7 +266,8 @@ private async Task OperationHelperWithRootTraceAsync( task, openTelemetry, operationName, - requestOptions); + requestOptions, + resourceType); } } @@ -275,7 +280,8 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn Func> task, Func openTelemetry, TraceComponent traceComponent, - Tracing.TraceLevel traceLevel) + Tracing.TraceLevel traceLevel, + ResourceType? resourceType) { Debug.Assert(SynchronizationContext.Current != null, "This should only be used when a SynchronizationContext is specified"); @@ -299,7 +305,8 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn task, openTelemetry, operationName, - requestOptions); + requestOptions, + resourceType); } }); } @@ -491,17 +498,23 @@ private async Task RunWithDiagnosticsHelperAsync( Func> task, Func openTelemetry, string operationName, - RequestOptions requestOptions) + RequestOptions requestOptions, + ResourceType? resourceType = null) { + if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) + { + operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + operationName; + } + using (OpenTelemetryCoreRecorder recorder = - OpenTelemetryRecorderFactory.CreateRecorder( - operationName: operationName, - containerName: containerName, - databaseName: databaseName, - operationType: operationType, - requestOptions: requestOptions, - trace: trace, - clientContext: this.isDisposed ? null : this)) + OpenTelemetryRecorderFactory.CreateRecorder( + operationName: operationName, + containerName: containerName, + databaseName: databaseName, + operationType: operationType, + requestOptions: requestOptions, + trace: trace, + clientContext: this.isDisposed ? null : this)) using (new ActivityScope(Guid.NewGuid())) { try @@ -587,12 +600,8 @@ private bool IsBulkOperationSupported( OperationType operationType) { this.ThrowIfDisposed(); - return IsBulk(this.ClientOptions.AllowBulkExecution, resourceType, operationType); - } - public static bool IsBulk(bool isBulkConfigured, ResourceType resourceType, OperationType operationType) - { - if (!isBulkConfigured) + if (!this.ClientOptions.AllowBulkExecution) { return false; } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index acb5cf2602..1cfeaced13 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -220,7 +220,8 @@ Task func(ITrace trace) operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: func, - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task> CreateItemAsync(T item, @@ -235,7 +236,8 @@ public override Task> CreateItemAsync(T item, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task ReadItemStreamAsync( @@ -251,7 +253,8 @@ public override Task ReadItemStreamAsync( operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task> ReadItemAsync( @@ -267,7 +270,8 @@ public override Task> ReadItemAsync( operationType: Documents.OperationType.Read, requestOptions, (trace) => base.ReadItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task UpsertItemStreamAsync( @@ -283,7 +287,8 @@ public override Task UpsertItemStreamAsync( operationType: Documents.OperationType.Upsert, requestOptions: requestOptions, task: (trace) => base.UpsertItemStreamAsync(streamPayload, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task> UpsertItemAsync( @@ -299,7 +304,8 @@ public override Task> UpsertItemAsync( operationType: Documents.OperationType.Upsert, requestOptions: requestOptions, task: (trace) => base.UpsertItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task ReplaceItemStreamAsync( @@ -316,7 +322,8 @@ public override Task ReplaceItemStreamAsync( operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceItemStreamAsync(streamPayload, id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task> ReplaceItemAsync( @@ -333,7 +340,8 @@ public override Task> ReplaceItemAsync( operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceItemAsync(item, id, trace, partitionKey, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task DeleteItemStreamAsync( @@ -349,7 +357,8 @@ public override Task DeleteItemStreamAsync( operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task> DeleteItemAsync( @@ -365,7 +374,8 @@ public override Task> DeleteItemAsync( operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task PatchItemStreamAsync( @@ -382,7 +392,8 @@ public override Task PatchItemStreamAsync( operationType: Documents.OperationType.Patch, requestOptions: requestOptions, task: (trace) => base.PatchItemStreamAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task PatchItemStreamAsync( @@ -399,7 +410,8 @@ public override Task PatchItemStreamAsync( operationType: Documents.OperationType.Patch, requestOptions: requestOptions, task: (trace) => base.PatchItemStreamAsync(id, partitionKey, streamPayload, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task> PatchItemAsync( @@ -416,7 +428,8 @@ public override Task> PatchItemAsync( operationType: Documents.OperationType.Patch, requestOptions: requestOptions, task: (trace) => base.PatchItemAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response), + resourceType: Documents.ResourceType.Document); } public override Task ReadManyItemsStreamAsync( diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs index 5bd2cc1848..285b339c71 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs @@ -66,6 +66,7 @@ internal abstract Task OperationHelperAsync( RequestOptions requestOptions, Func> task, Func openTelemetry = null, + ResourceType? resourceType = null, TraceComponent traceComponent = TraceComponent.Transport, TraceLevel traceLevel = TraceLevel.Info); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index 325c6feffa..ff35a94054 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -9,7 +9,6 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System.Diagnostics; using global::Azure.Core; using Microsoft.Azure.Cosmos.Telemetry.Diagnostics; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; /// @@ -27,12 +26,8 @@ internal struct OpenTelemetryCoreRecorder : IDisposable private readonly OperationType operationType = OperationType.Invalid; private readonly string connectionModeCache = null; - private readonly bool isBulkEnabled = false; - private OpenTelemetryAttributes response = null; - private string operationName = null; - /// /// Maps exception types to actions that record their OpenTelemetry attributes. /// @@ -69,16 +64,15 @@ private OpenTelemetryCoreRecorder( this.scope = scope; this.config = config; - this.operationName = operationName; this.operationType = operationType; this.connectionModeCache = Enum.GetName(typeof(ConnectionMode), clientContext.ClientOptions.ConnectionMode); - this.isBulkEnabled = clientContext.ClientOptions.AllowBulkExecution; if (scope.IsEnabled) { this.scope.Start(); this.Record( + operationName: operationName, containerName: containerName, databaseName: databaseName, clientContext: clientContext); @@ -138,16 +132,19 @@ public void Record(string key, string value) /// /// Recording information /// + /// /// /// /// public void Record( + string operationName, string containerName, string databaseName, CosmosClientContext clientContext) { if (this.IsEnabled) { + this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbOperation, operationName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbName, databaseName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ContainerName, containerName); @@ -230,17 +227,11 @@ public void Dispose() OperationType operationType = (this.response == null || this.response?.OperationType == OperationType.Invalid) ? this.operationType : this.response.OperationType; - string operationTypeName = Enum.GetName(typeof(OperationType), operationType); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationTypeName); + string operationName = Enum.GetName(typeof(OperationType), operationType); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationName); if (this.response != null) { - if (this.response.ResourceType is not null && ClientContextCore.IsBulk(this.isBulkEnabled, this.response.ResourceType.Value, this.operationType)) - { - this.operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + this.operationName; - } - this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbOperation, this.operationName); - if (this.response.BatchSize is not null) { this.scope.AddIntegerAttribute(OpenTelemetryAttributeKeys.BatchSize, (int)this.response.BatchSize); 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 8d8fc72372..0aa023efeb 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 @@ -142,6 +142,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + execute_batch databaseName containerName cosmosdb @@ -151,7 +152,6 @@ Some Value Direct Batch - execute_batch 90 Some Value Some Value @@ -295,6 +295,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + execute_batch databaseName containerName cosmosdb @@ -304,7 +305,6 @@ Some Value Direct Batch - execute_batch 50 Some Value Some Value 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 9db11f83f8..eaecdc1c57 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 @@ -163,9 +163,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -175,15 +176,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -193,15 +194,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -211,15 +212,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -229,15 +230,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -247,15 +248,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -265,15 +266,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -283,15 +284,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -301,15 +302,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -319,15 +320,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -337,7 +338,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -500,9 +500,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -512,15 +513,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -530,15 +531,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -548,15 +549,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -566,15 +567,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -584,15 +585,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -602,15 +603,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -620,15 +621,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -638,15 +639,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -656,15 +657,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -674,7 +675,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -837,9 +837,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -849,15 +850,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -867,15 +868,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -885,15 +886,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -903,15 +904,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -921,15 +922,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -939,15 +940,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -957,15 +958,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -975,15 +976,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -993,15 +994,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1011,7 +1012,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -1174,9 +1174,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1186,15 +1187,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1204,15 +1205,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1222,15 +1223,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1240,15 +1241,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1258,15 +1259,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1276,15 +1277,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1294,15 +1295,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1312,15 +1313,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1330,15 +1331,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1348,7 +1349,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -1511,9 +1511,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1523,15 +1524,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1541,15 +1542,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1559,15 +1560,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1577,15 +1578,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1595,15 +1596,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1613,15 +1614,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1631,15 +1632,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1649,15 +1650,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1667,15 +1668,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1685,7 +1686,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -1848,9 +1848,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1860,15 +1861,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1878,15 +1879,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1896,15 +1897,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1914,15 +1915,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1932,15 +1933,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1950,15 +1951,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1968,15 +1969,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -1986,15 +1987,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2004,15 +2005,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2022,7 +2023,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -2185,9 +2185,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2197,15 +2198,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2215,15 +2216,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2233,15 +2234,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2251,15 +2252,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2269,15 +2270,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2287,15 +2288,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2305,15 +2306,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2323,15 +2324,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2341,15 +2342,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2359,7 +2360,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -2522,9 +2522,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2534,15 +2535,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2552,15 +2553,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2570,15 +2571,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2588,15 +2589,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2606,15 +2607,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2624,15 +2625,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2642,15 +2643,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2660,15 +2661,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2678,15 +2679,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2696,7 +2697,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -2859,9 +2859,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2871,15 +2872,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2889,15 +2890,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2907,15 +2908,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2925,15 +2926,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2943,15 +2944,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2961,15 +2962,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2979,15 +2980,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -2997,15 +2998,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3015,15 +3016,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3033,7 +3034,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -3196,9 +3196,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3208,15 +3209,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3226,15 +3227,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3244,15 +3245,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3262,15 +3263,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3280,15 +3281,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3298,15 +3299,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3316,15 +3317,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3334,15 +3335,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3352,15 +3353,15 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb @@ -3370,7 +3371,6 @@ Some Value Direct Create - bulk_create_item Some Value Some Value Some Value @@ -4150,9 +4150,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + bulk_create_item databaseName containerName cosmosdb 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 37a610dbba..1ffc916779 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 @@ -1026,6 +1026,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -1035,7 +1036,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -1045,6 +1045,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -1054,7 +1055,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -1064,6 +1064,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -1073,7 +1074,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -1083,6 +1083,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -1092,7 +1093,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -1102,6 +1102,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -1111,7 +1112,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -1772,6 +1772,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1781,7 +1782,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1791,6 +1791,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1800,7 +1801,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1810,6 +1810,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1819,7 +1820,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1829,6 +1829,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1838,7 +1839,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1848,6 +1848,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1857,7 +1858,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -2499,6 +2499,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -2508,7 +2509,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -2518,6 +2518,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -2527,7 +2528,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -2537,6 +2537,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -2546,7 +2547,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -2556,6 +2556,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -2565,7 +2566,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -2575,6 +2575,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed databaseName containerName cosmosdb @@ -2584,7 +2585,6 @@ Some Value Direct ReadFeed - query_change_feed Some Value Some Value Some Value @@ -3246,6 +3246,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3255,7 +3256,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -3265,6 +3265,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3274,7 +3275,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -3284,6 +3284,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3293,7 +3294,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -3303,6 +3303,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3312,7 +3313,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -3322,6 +3322,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3331,7 +3332,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -3647,6 +3647,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_change_feed_estimator databaseName containerName cosmosdb @@ -3656,7 +3657,6 @@ Some Value Direct ReadFeed - query_change_feed_estimator Some Value Some Value Some Value 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 a01be81919..e5a8ecb1a7 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 @@ -120,6 +120,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + delete_database miscdbcustonhandler cosmosdb Some Value @@ -128,7 +129,6 @@ Some Value Direct Delete - delete_database Some Value Some Value Some Value @@ -137,6 +137,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_database miscdbcustonhandler cosmosdb Some Value @@ -145,7 +146,6 @@ Some Value Direct Create - create_database Some Value Some Value Some Value @@ -261,6 +261,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + delete_database miscdbdataplane cosmosdb Some Value @@ -269,7 +270,6 @@ Some Value Direct Delete - delete_database Some Value Some Value Some Value @@ -278,6 +278,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_database miscdbdataplane cosmosdb Some Value @@ -286,7 +287,6 @@ Some Value Direct Create - create_database Some Value Some Value Some Value 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 1724944558..441ac59832 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 @@ -161,6 +161,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -437,6 +438,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -691,6 +693,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -977,6 +980,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -1327,6 +1331,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -1510,6 +1515,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb 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 d7164c03d4..2b182e75be 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 @@ -613,6 +613,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -622,7 +623,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -634,6 +634,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -643,7 +644,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -655,6 +655,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -664,7 +665,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -676,6 +676,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -685,7 +686,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -1334,6 +1334,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1343,7 +1344,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -1355,6 +1355,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1364,7 +1365,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -1376,6 +1376,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1385,7 +1386,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -1397,6 +1397,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1406,7 +1407,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2036,6 +2036,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2045,7 +2046,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2057,6 +2057,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2066,7 +2067,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2078,6 +2078,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2087,7 +2088,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2099,6 +2099,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2108,7 +2109,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2758,6 +2758,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2767,7 +2768,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2779,6 +2779,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2788,7 +2789,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2800,6 +2800,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2809,7 +2810,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -2821,6 +2821,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2830,7 +2831,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -3554,6 +3554,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3563,7 +3564,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -3575,6 +3575,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3584,7 +3585,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -3596,6 +3596,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3605,7 +3606,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -3617,6 +3617,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -3626,7 +3627,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -4265,6 +4265,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -4274,7 +4275,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -4286,6 +4286,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -4295,7 +4296,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -4307,6 +4307,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -4316,7 +4317,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -4328,6 +4328,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -4337,7 +4338,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -4996,6 +4996,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -5005,7 +5006,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -5017,6 +5017,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -5026,7 +5027,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -5038,6 +5038,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -5047,7 +5048,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value @@ -5059,6 +5059,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -5068,7 +5069,6 @@ Some Value Direct Query - query_items Some Value Some Value Some Value 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 36150430b6..c023163156 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 @@ -579,6 +579,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -588,7 +589,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -599,6 +599,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -608,7 +609,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -619,6 +619,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -628,7 +629,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -639,6 +639,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -648,7 +649,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1262,6 +1262,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1271,7 +1272,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1282,6 +1282,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1291,7 +1292,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1302,6 +1302,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1311,7 +1312,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1322,6 +1322,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1331,7 +1332,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1926,6 +1926,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1935,7 +1936,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1946,6 +1946,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1955,7 +1956,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1966,6 +1966,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1975,7 +1976,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -1986,6 +1986,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -1995,7 +1996,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -2610,6 +2610,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2619,7 +2620,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -2630,6 +2630,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2639,7 +2640,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -2650,6 +2650,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2659,7 +2660,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value @@ -2670,6 +2670,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + query_items databaseName containerName cosmosdb @@ -2679,7 +2680,6 @@ Some Value Direct ReadFeed - query_items Some Value Some Value Some Value 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 6ad86dc458..7e8bcd1f8b 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 @@ -554,6 +554,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + read_many_items databaseName containerName cosmosdb @@ -563,7 +564,6 @@ Some Value Direct Read - read_many_items Some Value Some Value Some Value @@ -1139,6 +1139,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + read_many_items databaseName containerName cosmosdb @@ -1148,7 +1149,6 @@ Some Value Direct Read - read_many_items Some Value Some Value Some Value 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 18de70d8fd..60b4ab3f92 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 @@ -102,6 +102,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -111,7 +112,6 @@ Some Value Direct Create - create_item Some Value Some Value Some Value @@ -218,6 +218,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + read_item databaseName containerName cosmosdb @@ -227,7 +228,6 @@ Some Value Direct Read - read_item Some Value Some Value Some Value @@ -342,6 +342,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + replace_item databaseName containerName cosmosdb @@ -351,7 +352,6 @@ Some Value Direct Replace - replace_item Some Value Some Value Some Value @@ -461,6 +461,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + delete_item databaseName containerName cosmosdb @@ -470,7 +471,6 @@ Some Value Direct Delete - delete_item Some Value Some Value Some Value 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 c9cd9016f8..da534cc3a2 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 @@ -122,6 +122,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + create_item databaseName containerName cosmosdb @@ -131,7 +132,6 @@ Some Value Direct Create - create_item Some Value Some Value Some Value @@ -243,6 +243,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + read_item databaseName containerName cosmosdb @@ -252,7 +253,6 @@ Some Value Direct Read - read_item Some Value Some Value Some Value @@ -377,6 +377,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + replace_item databaseName containerName cosmosdb @@ -386,7 +387,6 @@ Some Value Direct Replace - replace_item Some Value Some Value Some Value @@ -500,6 +500,7 @@ Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 + delete_item databaseName containerName cosmosdb @@ -509,7 +510,6 @@ Some Value Direct Delete - delete_item Some Value Some Value Some Value diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index acc83d3ff4..5861121dd4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -763,10 +763,11 @@ private static CosmosClientContext MockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType,requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType,requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index c6bca20950..30c48043d5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -351,10 +351,11 @@ private Mock MockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName,containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + (operationName,containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index 896eb0fade..90db4644ef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -207,10 +207,11 @@ private CosmosClientContext GetMockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs index 39b8c00bd3..663017f214 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs @@ -392,10 +392,11 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>>, Func, OpenTelemetryAttributes>, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -503,10 +504,11 @@ private static ContainerInternal GetMockedContainer() It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>>, Func, OpenTelemetryAttributes>, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs index 1d98dc81b1..f5fdbf2831 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests { using System; using System.IO; + using System.Security.AccessControl; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; @@ -48,10 +49,11 @@ public async Task EtagPassesContinuation() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>,Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>,Func, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -128,10 +130,11 @@ public async Task NextReadHasUpdatedContinuation() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -198,10 +201,11 @@ public async Task ShouldSetFeedRangePartitionKeyRange() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -280,10 +284,11 @@ public async Task ShouldUseFeedRangeEpk() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>, Func, Documents.ResourceType, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs index 5f9b3d3dad..f2ec22382d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs @@ -717,6 +717,7 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.IsAny(), It.IsAny())) .Returns>, Func, TraceComponent, TraceLevel>( @@ -730,6 +731,7 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny(), It.IsAny(), It.IsAny())) .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs index 6594bd926e..3d02743af9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs @@ -483,6 +483,7 @@ private CosmosClientContext MockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), + It.IsAny(), It.IsAny(), It.IsAny())) .Returns>, Func, TraceComponent, TraceLevel>( From 83f14d40fe91ffbe14121b4f600770a3bc02ed78 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Sun, 1 Sep 2024 07:13:16 +0530 Subject: [PATCH 09/22] fix tests --- .../src/Resource/ClientContextCore.cs | 109 +++++++++--------- .../OpenTelemetryRecorderFactory.cs | 4 +- .../OpenTelemetry/OpenTelemetryResponse.cs | 1 - .../Batch/BatchAsyncBatcherTests.cs | 4 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 4 +- .../Batch/BatchAsyncStreamerTests.cs | 4 +- .../ChangeFeedEstimatorIteratorTests.cs | 8 +- ...dPartitionKeyResultSetIteratorCoreTests.cs | 16 +-- .../CosmosItemUnitTests.cs | 12 +- .../FeedRange/ChangeFeedIteratorCoreTests.cs | 6 +- 10 files changed, 87 insertions(+), 81 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 0c3b90e19f..45df0388dc 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -501,65 +501,71 @@ private async Task RunWithDiagnosticsHelperAsync( RequestOptions requestOptions, ResourceType? resourceType = null) { - if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) + using (OpenTelemetryCoreRecorder recorder = + OpenTelemetryRecorderFactory.CreateRecorder( + getOperationName: () => + { + if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) + { + operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + operationName; + } + + return operationName; + }, + containerName: containerName, + databaseName: databaseName, + operationType: operationType, + requestOptions: requestOptions, + trace: trace, + clientContext: this.isDisposed ? null : this)) { - operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + operationName; - } - - using (OpenTelemetryCoreRecorder recorder = - OpenTelemetryRecorderFactory.CreateRecorder( - operationName: operationName, - containerName: containerName, - databaseName: databaseName, - operationType: operationType, - requestOptions: requestOptions, - trace: trace, - clientContext: this.isDisposed ? null : this)) - using (new ActivityScope(Guid.NewGuid())) - { - try + using (new ActivityScope(Guid.NewGuid())) { - TResult result = await task(trace).ConfigureAwait(false); - if (openTelemetry != null && recorder.IsEnabled) + try { - // Record request response information - OpenTelemetryAttributes response = openTelemetry(result); - recorder.Record(response); + TResult result = await task(trace).ConfigureAwait(false); + if (openTelemetry != null && recorder.IsEnabled) + { + // Record request response information + OpenTelemetryAttributes response = openTelemetry(result); + recorder.Record(response); + } + + return result; } + catch (OperationCanceledException oe) when (!(oe is CosmosOperationCanceledException)) + { + CosmosOperationCanceledException operationCancelledException = new CosmosOperationCanceledException(oe, trace); + recorder.MarkFailed(operationCancelledException); - return result; - } - catch (OperationCanceledException oe) when (!(oe is CosmosOperationCanceledException)) - { - CosmosOperationCanceledException operationCancelledException = new CosmosOperationCanceledException(oe, trace); - recorder.MarkFailed(operationCancelledException); - - throw operationCancelledException; - } - catch (ObjectDisposedException objectDisposed) when (!(objectDisposed is CosmosObjectDisposedException)) - { - CosmosObjectDisposedException objectDisposedException = new CosmosObjectDisposedException( - objectDisposed, - this.client, - trace); - recorder.MarkFailed(objectDisposedException); + throw operationCancelledException; + } + catch (ObjectDisposedException objectDisposed) when (!(objectDisposed is CosmosObjectDisposedException)) + { + CosmosObjectDisposedException objectDisposedException = new CosmosObjectDisposedException( + objectDisposed, + this.client, + trace); + recorder.MarkFailed(objectDisposedException); - throw objectDisposedException; - } - catch (NullReferenceException nullRefException) when (!(nullRefException is CosmosNullReferenceException)) - { - CosmosNullReferenceException nullException = new CosmosNullReferenceException( - nullRefException, - trace); - recorder.MarkFailed(nullException); + throw objectDisposedException; + } + catch (NullReferenceException nullRefException) when (!(nullRefException is CosmosNullReferenceException)) + { + CosmosNullReferenceException nullException = new CosmosNullReferenceException( + nullRefException, + trace); + recorder.MarkFailed(nullException); - throw nullException; - } - catch (Exception ex) - { - recorder.MarkFailed(ex); + throw nullException; + } + catch (Exception ex) + { + recorder.MarkFailed(ex); + + throw; + } - throw; } } } @@ -585,7 +591,6 @@ private async Task ProcessResourceOperationAsBulkStreamAsync( resourceStream: streamPayload, requestOptions: batchItemRequestOptions, cosmosClientContext: this); - TransactionalBatchOperationResult batchOperationResult = await cosmosContainerCore.BatchExecutor.AddAsync( itemBatchOperation, trace, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 1b16f48307..368594114a 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -26,7 +26,7 @@ internal static class OpenTelemetryRecorderFactory isStable: false), isThreadSafe: true); - public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, + public static OpenTelemetryCoreRecorder CreateRecorder(Func getOperationName, string containerName, string databaseName, Documents.OperationType operationType, @@ -37,6 +37,8 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, OpenTelemetryCoreRecorder openTelemetryRecorder = default; if (clientContext is { ClientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing: false }) { + string operationName = getOperationName(); + // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = LazyScopeFactory.Value.CreateScope(name: $"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}", kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? ActivityKind.Internal : ActivityKind.Client); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 5166940883..5738d58c5c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -8,7 +8,6 @@ namespace Microsoft.Azure.Cosmos using System.IO; using System.Net; using Microsoft.Azure.Cosmos.Core.Trace; - using Microsoft.Azure.Documents; using Telemetry; internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index 5861121dd4..592590c83f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -763,10 +763,10 @@ private static CosmosClientContext MockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType,requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index 30c48043d5..506198a744 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -351,10 +351,10 @@ private Mock MockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( (operationName,containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index 90db4644ef..641567d0a7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -207,10 +207,10 @@ private CosmosClientContext GetMockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs index 663017f214..41e14ea85b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs @@ -392,10 +392,10 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), - It.IsAny(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, ResourceType, TraceComponent, TraceLevel>( + .Returns>>, Func, OpenTelemetryAttributes>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -504,10 +504,10 @@ private static ContainerInternal GetMockedContainer() It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), - It.IsAny(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, ResourceType, TraceComponent, TraceLevel>( + .Returns>>, Func, OpenTelemetryAttributes>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs index f5fdbf2831..8e90431099 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs @@ -49,10 +49,10 @@ public async Task EtagPassesContinuation() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>,Func, ResourceType, TraceComponent, TraceLevel>( + .Returns>,Func, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -130,10 +130,10 @@ public async Task NextReadHasUpdatedContinuation() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -201,10 +201,10 @@ public async Task ShouldSetFeedRangePartitionKeyRange() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, ResourceType, TraceComponent, TraceLevel>( + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -284,10 +284,10 @@ public async Task ShouldUseFeedRangeEpk() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, Documents.ResourceType, TraceComponent, TraceLevel>( + .Returns>, Func, Documents.ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs index f2ec22382d..1801104a7d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs @@ -717,11 +717,11 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.OperationHelperAsync>( It.IsAny(), @@ -731,11 +731,11 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), - It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>>, Func, OpenTelemetryAttributes>, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.ProcessResourceOperationStreamAsync( It.IsAny(), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs index 3d02743af9..4159da4080 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs @@ -483,11 +483,11 @@ private CosmosClientContext MockClientContext() It.IsAny(), It.IsAny>>(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; } From 235d6ea17de029637f5766731e728762108db4e3 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Mon, 2 Sep 2024 15:02:58 +0530 Subject: [PATCH 10/22] remove commented code --- .../src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs index 84405130cf..983ef4624e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -23,7 +23,6 @@ public static class Operations // Conflict Operations public const string DeleteConflict = "delete_conflict"; public const string QueryConflicts = "query_conflicts"; - //public const string ReadAllConflicts = "read_all_conflicts"; public const string ReadConflict = "read_conflict"; //Container Operations From 1556119b96f6768a97148393f833fc87a77dedad Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 5 Sep 2024 08:21:16 +0530 Subject: [PATCH 11/22] fix activity name --- .../ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs | 4 +--- .../src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs index e532fe5565..a1872d1682 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs @@ -94,14 +94,12 @@ private ChangeFeedPartitionKeyResultSetIteratorCore( public override Task ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange, + operationName: "Change Feed Processor Read Next Async", containerName: this.container?.Id, databaseName: this.container?.Database?.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, requestOptions: this.changeFeedOptions, task: (trace) => this.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs index 983ef4624e..3d69bb6c7e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -14,8 +14,7 @@ public static class Operations // Change feed operations public const string QueryChangeFeed = "query_change_feed"; - public const string QueryChangeFeedForPartitionKeyRange = "query_change_feed_for_partition_key_range"; - public const string QueryChangeFeedEstimator = "query_change_feed_estimator"; + public const string QueryChangeFeedEstimator = "get_change_feed_processor_estimate"; // Account Operations public const string ReadAccount = "read_account"; From 37c5daaff127448a60a0f7e3dd6e2932328e6630 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 6 Sep 2024 08:26:47 +0530 Subject: [PATCH 12/22] code refatot for different operation name for diagnostics --- Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs | 5 +- .../src/ChangeFeed/ChangeFeedIteratorCore.cs | 4 +- .../ChangeFeedEstimatorIterator.cs | 4 +- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 24 ++-- .../src/Resource/ClientContextCore.cs | 14 +-- .../ClientEncryptionKeyInlineCore.cs | 8 +- .../Resource/Conflict/ConflictsInlineCore.cs | 8 +- .../Resource/Container/ContainerInlineCore.cs | 118 +++++++++--------- .../src/Resource/CosmosClientContext.cs | 2 +- .../Resource/Database/DatabaseInlineCore.cs | 75 +++++------ .../FeedIterators/FeedIteratorInlineCore.cs | 4 +- .../FeedIteratorInlineCore{T}.cs | 4 +- .../Permission/PermissionInlineCore.cs | 12 +- .../src/Resource/Scripts/ScriptsInlineCore.cs | 60 ++++----- .../src/Resource/User/UserInlineCore.cs | 18 +-- .../OpenTelemetry/OpenTelemetryConstants.cs | 1 - .../CFP/AllVersionsAndDeletes/BuilderTests.cs | 2 +- .../BuilderWithCustomSerializerTests.cs | 4 +- .../ChangeFeed/DynamicStreamTests.cs | 3 +- .../ChangeFeed/DynamicTests.cs | 2 +- .../Batch/BatchAsyncBatcherTests.cs | 4 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 4 +- .../Batch/BatchAsyncStreamerTests.cs | 4 +- .../ChangeFeedEstimatorIteratorTests.cs | 12 +- ...dPartitionKeyResultSetIteratorCoreTests.cs | 24 ++-- .../CosmosItemUnitTests.cs | 6 +- .../FeedRange/ChangeFeedIteratorCoreTests.cs | 4 +- 27 files changed, 213 insertions(+), 217 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index be2a26207d..d9092d32f7 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs @@ -224,7 +224,7 @@ public override Task ExecuteAsync( CancellationToken cancellationToken = default) { return this.container.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ExecuteBatch, + operationName: nameof(ExecuteAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Batch, @@ -240,8 +240,7 @@ public override Task ExecuteAsync( this.operations = new List(); return executor.ExecuteAsync(trace, cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ExecuteBatch, (response) => new OpenTelemetryResponse(responseMessage: response))); } /// diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs index 0c6bc862a0..b3e4485f35 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs @@ -221,13 +221,13 @@ public ChangeFeedIteratorCore( public override async Task ReadNextAsync(CancellationToken cancellationToken = default) { - return await this.clientContext.OperationHelperAsync(OpenTelemetryConstants.Operations.QueryChangeFeed, + return await this.clientContext.OperationHelperAsync("Change Feed Iterator Read Next Async", containerName: this.container?.Id, databaseName: this.container?.Database?.Id ?? this.databaseName, operationType: OperationType.ReadFeed, requestOptions: this.changeFeedRequestOptions, task: (trace) => this.ReadNextInternalAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response), + openTelemetry: new (OpenTelemetryConstants.Operations.QueryChangeFeed, (response) => new OpenTelemetryResponse(responseMessage: response)), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs index c3a8ceeafc..0e930b2c79 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs @@ -114,13 +114,13 @@ private ChangeFeedEstimatorIterator( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { return this.monitoredContainer.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.QueryChangeFeedEstimator, + operationName: "Change Feed Estimator Read Next Async", containerName: this.monitoredContainer?.Id, databaseName: this.monitoredContainer?.Database?.Id, operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response), + openTelemetry: new (OpenTelemetryConstants.Operations.QueryChangeFeedEstimator, (response) => new OpenTelemetryResponse(responseMessage: response)), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index 47499b6989..217357edb8 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Handlers; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; + using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; @@ -651,7 +652,7 @@ internal CosmosClient( public virtual Task ReadAccountAsync() { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadAccount, + operationName: nameof(ReadAccountAsync), containerName: null, databaseName: null, operationType: OperationType.Read, @@ -740,7 +741,7 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateDatabase, + operationName: nameof(CreateDatabaseAsync), containerName: null, databaseName: id, operationType: OperationType.Create, @@ -757,7 +758,7 @@ public virtual Task CreateDatabaseAsync( trace: trace, cancellationToken: cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabase, (response) => new OpenTelemetryResponse(responseMessage: response))); } /// @@ -790,7 +791,7 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateDatabase, + operationName: nameof(CreateDatabaseAsync), containerName: null, databaseName: id, operationType: OperationType.Create, @@ -805,7 +806,7 @@ public virtual Task CreateDatabaseAsync( trace: trace, cancellationToken: cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabase, (response) => new OpenTelemetryResponse(responseMessage: response))); } /// @@ -849,7 +850,7 @@ public virtual Task CreateDatabaseIfNotExistsAsync( return string.IsNullOrEmpty(id) ? throw new ArgumentNullException(nameof(id)) : this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, + operationName: nameof(CreateDatabaseIfNotExistsAsync), containerName: null, databaseName: id, operationType: OperationType.Create, @@ -901,8 +902,7 @@ public virtual Task CreateDatabaseIfNotExistsAsync( return this.ClientContext.ResponseFactory.CreateDatabaseResponse(this.GetDatabase(databaseProperties.Id), readResponseAfterConflict); } }, - openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, (response) => new OpenTelemetryResponse(responseMessage: response))); } /// @@ -1191,7 +1191,7 @@ public virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateDatabase, + operationName: nameof(CreateDatabaseStreamAsync), containerName: null, databaseName: databaseProperties.Id, operationType: OperationType.Create, @@ -1206,7 +1206,7 @@ public virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabase, (response) => new OpenTelemetryResponse(response))); } /// @@ -1289,7 +1289,7 @@ internal virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, + operationName: nameof(CreateDatabaseIfNotExistsAsync), containerName: null, databaseName: databaseProperties.Id, operationType: OperationType.Create, @@ -1304,7 +1304,7 @@ internal virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, (response) => new OpenTelemetryResponse(response))); } private async Task CreateDatabaseInternalAsync( diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 45df0388dc..ef46dd6d3b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -211,7 +211,7 @@ internal override Task OperationType operationType, RequestOptions requestOptions, Func> task, - Func openTelemetry, + Tuple> openTelemetry, ResourceType? resourceType = null, TraceComponent traceComponent = TraceComponent.Transport, Tracing.TraceLevel traceLevel = Tracing.TraceLevel.Info) @@ -247,7 +247,7 @@ private async Task OperationHelperWithRootTraceAsync( OperationType operationType, RequestOptions requestOptions, Func> task, - Func openTelemetry, + Tuple> openTelemetry, TraceComponent traceComponent, Tracing.TraceLevel traceLevel, ResourceType? resourceType) @@ -278,7 +278,7 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn OperationType operationType, RequestOptions requestOptions, Func> task, - Func openTelemetry, + Tuple> openTelemetry, TraceComponent traceComponent, Tracing.TraceLevel traceLevel, ResourceType? resourceType) @@ -496,7 +496,7 @@ private async Task RunWithDiagnosticsHelperAsync( OperationType operationType, ITrace trace, Func> task, - Func openTelemetry, + Tuple> openTelemetry, string operationName, RequestOptions requestOptions, ResourceType? resourceType = null) @@ -507,10 +507,10 @@ private async Task RunWithDiagnosticsHelperAsync( { if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) { - operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + operationName; + operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry.Item1; } - return operationName; + return openTelemetry.Item1; }, containerName: containerName, databaseName: databaseName, @@ -527,7 +527,7 @@ private async Task RunWithDiagnosticsHelperAsync( if (openTelemetry != null && recorder.IsEnabled) { // Record request response information - OpenTelemetryAttributes response = openTelemetry(result); + OpenTelemetryAttributes response = openTelemetry.Item2(result); recorder.Record(response); } diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs index 5553d3957b..8883d5b0a8 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs @@ -30,13 +30,13 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadClientEncryptionKey, + operationName: nameof(ReadAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadAsync(requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadClientEncryptionKey, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceAsync( @@ -45,13 +45,13 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceClientEncryptionKey, + operationName: nameof(ReplaceAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceAsync(clientEncryptionKeyProperties, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceClientEncryptionKey, (response) => new OpenTelemetryResponse(response))); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs index 8f219107da..682d43d0d7 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs @@ -26,13 +26,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteConflict, + operationName: nameof(DeleteAsync), containerName: null, databaseName: null, operationType: Documents.OperationType.Delete, requestOptions: null, task: (trace) => base.DeleteAsync(conflict, partitionKey, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteConflict, (response) => new OpenTelemetryResponse(response))); } public override FeedIterator GetConflictQueryStreamIterator( @@ -89,13 +89,13 @@ public override Task> ReadCurrentAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadConflict, + operationName: nameof(ReadCurrentAsync), containerName: null, databaseName: null, operationType: Documents.OperationType.Read, requestOptions: null, task: (trace) => base.ReadCurrentAsync(cosmosConflict, partitionKey, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadConflict, (response) => new OpenTelemetryResponse(response))); } public override T ReadConflictContent(ConflictProperties cosmosConflict) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index 1cfeaced13..d827a878fa 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -37,13 +37,13 @@ public override Task ReadContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadContainer, + operationName: nameof(ReadContainerAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadContainerAsync(trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadContainer, (response) => new OpenTelemetryResponse(response))); } public override Task ReadContainerStreamAsync( @@ -51,13 +51,13 @@ public override Task ReadContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadContainer, + operationName: nameof(ReadContainerStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadContainerStreamAsync(trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadContainer, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceContainerAsync( @@ -66,13 +66,13 @@ public override Task ReplaceContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceContainer, + operationName: nameof(ReplaceContainerAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceContainerAsync(containerProperties, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceContainer, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceContainerStreamAsync( @@ -81,13 +81,13 @@ public override Task ReplaceContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceContainer, + operationName: nameof(ReplaceContainerStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceContainerStreamAsync(containerProperties, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceContainer, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteContainerAsync( @@ -95,13 +95,13 @@ public override Task DeleteContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteContainer, + operationName: nameof(DeleteContainerAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteContainerAsync(trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteContainer, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteContainerStreamAsync( @@ -109,19 +109,19 @@ public override Task DeleteContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteContainer, + operationName: nameof(DeleteContainerAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteContainerStreamAsync(trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteContainer, (response) => new OpenTelemetryResponse(response))); } public override Task ReadThroughputAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadThroughput, + operationName: nameof(ReadThroughputAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -134,13 +134,13 @@ public override Task ReadThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadThroughput, + operationName: nameof(ReadThroughputAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadThroughputAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadThroughput, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceThroughputAsync( @@ -149,13 +149,13 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, + operationName: nameof(ReplaceThroughputAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceThroughputAsync(throughput, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceThroughput, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceThroughputAsync( @@ -164,37 +164,37 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, + operationName: nameof(ReplaceThroughputAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceThroughputAsync(throughputProperties, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceThroughput, (response) => new OpenTelemetryResponse(response))); } public override Task ReadThroughputIfExistsAsync(RequestOptions requestOptions, CancellationToken cancellationToken) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadThroughputIfExists, + operationName: nameof(ReadThroughputIfExistsAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadThroughputIfExistsAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadThroughputIfExists, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceThroughputIfExistsAsync(ThroughputProperties throughput, RequestOptions requestOptions, CancellationToken cancellationToken) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceThroughputIfExists, + operationName: nameof(ReplaceThroughputIfExistsAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceThroughputIfExistsAsync(throughput, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceThroughputIfExists, (response) => new OpenTelemetryResponse(response))); } public override Task CreateItemStreamAsync( @@ -214,13 +214,13 @@ Task func(ITrace trace) } return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateItem, + operationName: nameof(CreateItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: func, - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.CreateItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -230,13 +230,13 @@ public override Task> CreateItemAsync(T item, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateItem, + operationName: nameof(CreateItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.CreateItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -247,13 +247,13 @@ public override Task ReadItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadItem, + operationName: nameof(ReadItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.ReadItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -264,13 +264,13 @@ public override Task> ReadItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadItem, + operationName: nameof(ReadItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, - requestOptions, - (trace) => base.ReadItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response), + requestOptions: requestOptions, + task: (trace) => base.ReadItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: new (OpenTelemetryConstants.Operations.ReadItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -281,13 +281,13 @@ public override Task UpsertItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.UpsertItem, + operationName: nameof(UpsertItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, requestOptions: requestOptions, task: (trace) => base.UpsertItemStreamAsync(streamPayload, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.UpsertItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -298,13 +298,13 @@ public override Task> UpsertItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.UpsertItem, + operationName: nameof(UpsertItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, requestOptions: requestOptions, task: (trace) => base.UpsertItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.UpsertItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -316,13 +316,13 @@ public override Task ReplaceItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceItem, + operationName: nameof(ReplaceItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceItemStreamAsync(streamPayload, id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -334,13 +334,13 @@ public override Task> ReplaceItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceItem, + operationName: nameof(ReplaceItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceItemAsync(item, id, trace, partitionKey, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -351,13 +351,13 @@ public override Task DeleteItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteItem, + operationName: nameof(DeleteItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -368,13 +368,13 @@ public override Task> DeleteItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteItem, + operationName: nameof(DeleteItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -386,13 +386,13 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.PatchItem, + operationName: nameof(PatchItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, requestOptions: requestOptions, task: (trace) => base.PatchItemStreamAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.PatchItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -404,13 +404,13 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.PatchItem, + operationName: nameof(PatchItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, requestOptions: requestOptions, task: (trace) => base.PatchItemStreamAsync(id, partitionKey, streamPayload, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.PatchItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -422,13 +422,13 @@ public override Task> PatchItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.PatchItem, + operationName: nameof(PatchItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Patch, requestOptions: requestOptions, task: (trace) => base.PatchItemAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response), + openTelemetry: new (OpenTelemetryConstants.Operations.PatchItem, (response) => new OpenTelemetryResponse(response)), resourceType: Documents.ResourceType.Document); } @@ -438,13 +438,13 @@ public override Task ReadManyItemsStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadManyItems, + operationName: nameof(ReadManyItemsStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: null, task: (trace) => base.ReadManyItemsStreamAsync(items, trace, readManyRequestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadManyItems, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task> ReadManyItemsAsync( @@ -453,13 +453,13 @@ public override Task> ReadManyItemsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadManyItems, + operationName: nameof(ReadManyItemsAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: null, task: (trace) => base.ReadManyItemsAsync(items, trace, readManyRequestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadManyItems, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override FeedIterator GetItemQueryStreamIterator( @@ -578,7 +578,7 @@ public override TransactionalBatch CreateTransactionalBatch(PartitionKey partiti public override Task> GetFeedRangesAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadFeedRanges, + operationName: nameof(GetFeedRangesAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.ReadFeed, @@ -610,7 +610,7 @@ public override Task> GetPartitionKeyRangesAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadPartitionKeyRanges, + operationName: nameof(GetPartitionKeyRangesAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, @@ -666,13 +666,13 @@ public override Task DeleteAllItemsByPartitionKeyStreamAsync( CancellationToken cancellationToken = default(CancellationToken)) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteAllItemsByPartitionKeyStream, + operationName: nameof(DeleteAllItemsByPartitionKeyStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteAllItemsByPartitionKeyStreamAsync(partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteAllItemsByPartitionKeyStream, (response) => new OpenTelemetryResponse(response))); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs index 285b339c71..5db29ee8a2 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs @@ -65,7 +65,7 @@ internal abstract Task OperationHelperAsync( OperationType operationType, RequestOptions requestOptions, Func> task, - Func openTelemetry = null, + Tuple> openTelemetry = null, ResourceType? resourceType = null, TraceComponent traceComponent = TraceComponent.Transport, TraceLevel traceLevel = TraceLevel.Info); diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs index aaa2261234..36fdfa51c2 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System.Threading; using System.Threading.Tasks; + using global::Azure; using Microsoft.Azure.Cosmos.Fluent; using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; @@ -28,13 +29,13 @@ public override Task CreateContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainer, + operationName: nameof(CreateContainerAsync), containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainer, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task CreateContainerAsync(string id, @@ -44,13 +45,13 @@ public override Task CreateContainerAsync(string id, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainer, + operationName: nameof(CreateContainerAsync), containerName: id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerAsync(id, partitionKeyPath, throughput, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainer, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task CreateContainerIfNotExistsAsync( @@ -60,13 +61,13 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainerIfNotExists, + operationName: nameof(CreateContainerIfNotExistsAsync), containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerIfNotExistsAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainerIfNotExists, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task CreateContainerIfNotExistsAsync( @@ -77,13 +78,13 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainerIfNotExists, + operationName: nameof(CreateContainerIfNotExistsAsync), containerName: id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerIfNotExistsAsync(id, partitionKeyPath, throughput, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainerIfNotExists, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task CreateContainerStreamAsync( @@ -93,13 +94,13 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainer, + operationName: nameof(CreateContainerStreamAsync), containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerStreamAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainer, (response) => new OpenTelemetryResponse(response))); } public override Task CreateUserAsync(string id, @@ -107,13 +108,13 @@ public override Task CreateUserAsync(string id, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateUser, + operationName: nameof(CreateUserAsync), containerName: id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateUserAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateUser, (response) => new OpenTelemetryResponse(response))); } public override ContainerBuilder DefineContainer( @@ -128,13 +129,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteDatabase, + operationName: nameof(DeleteAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteDatabase, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task DeleteStreamAsync( @@ -142,13 +143,13 @@ public override Task DeleteStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteDatabase, + operationName: nameof(DeleteStreamAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteStreamAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteDatabase, (response) => new OpenTelemetryResponse(response))); } public override Container GetContainer(string id) @@ -236,13 +237,13 @@ public override Task ReadAsync(RequestOptions requestOptions = CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadDatabase, + operationName: nameof(ReadAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadDatabase, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task ReadStreamAsync( @@ -250,19 +251,19 @@ public override Task ReadStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadDatabase, + operationName: nameof(ReadStreamAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadStreamAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadDatabase, (response) => new OpenTelemetryResponse(response))); } public override Task ReadThroughputAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadThroughput, + operationName: nameof(ReadThroughputAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, @@ -275,13 +276,13 @@ public override Task ReadThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadThroughput, + operationName: nameof(ReadThroughputAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadThroughputAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadThroughput, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceThroughputAsync( @@ -290,13 +291,13 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, + operationName: nameof(ReplaceThroughputAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceThroughputAsync(throughput, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceThroughput, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceThroughputAsync( @@ -305,13 +306,13 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceThroughput, + operationName: nameof(ReplaceThroughputAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceThroughputAsync(throughputProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceThroughput, (response) => new OpenTelemetryResponse(response))); } public override Task CreateContainerAsync( @@ -321,13 +322,13 @@ public override Task CreateContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainer, + operationName: nameof(CreateContainerAsync), containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainer, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task CreateContainerIfNotExistsAsync( @@ -337,13 +338,13 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainerIfNotExists, + operationName: nameof(CreateContainerIfNotExistsAsync), containerName: containerProperties.Id, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerIfNotExistsAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainerIfNotExists, (response) => new OpenTelemetryResponse(response))); } public override Task CreateContainerStreamAsync( @@ -353,13 +354,13 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateContainer, + operationName: nameof(CreateContainerStreamAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateContainerStreamAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateContainer, (response) => new OpenTelemetryResponse(response))); } public override Task UpsertUserAsync( @@ -368,13 +369,13 @@ public override Task UpsertUserAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.UpsertUser, + operationName: nameof(UpsertUserAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Upsert, requestOptions: requestOptions, task: (trace) => base.UpsertUserAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.UpsertUser, (response) => new OpenTelemetryResponse(response))); } public override ClientEncryptionKey GetClientEncryptionKey(string id) @@ -396,13 +397,13 @@ public override Task CreateClientEncryptionKeyAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateClientEncryptionKey, + operationName: nameof(CreateClientEncryptionKeyAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateClientEncryptionKeyAsync(trace, clientEncryptionKeyProperties, requestOptions, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateClientEncryptionKey, (response) => new OpenTelemetryResponse(response))); } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs index bfac96b351..6b78bdc91b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs @@ -48,13 +48,13 @@ internal FeedIteratorInlineCore( public override Task ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.QueryItems, + operationName: "FeedIterator ReadNextAsync", containerName: this.container?.Id, databaseName: this.container?.Database?.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.QueryItems, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task ReadNextAsync(ITrace trace, CancellationToken cancellationToken = default) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs index a19f59a068..48f114e181 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs @@ -48,13 +48,13 @@ internal FeedIteratorInlineCore( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { return this.clientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.QueryItems, + operationName: "Typed FeedIterator ReadNextAsync", containerName: this.container?.Id, databaseName: this.container?.Database.Id ?? this.databaseName, operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: trace => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); + openTelemetry: new (OpenTelemetryConstants.Operations.QueryItems, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task> ReadNextAsync(ITrace trace, CancellationToken cancellationToken) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs index a75adbfa0c..c231808305 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs @@ -28,13 +28,13 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadPermission, + operationName: nameof(ReadAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadAsync(tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadPermission, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceAsync( @@ -44,13 +44,13 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplacePermission, + operationName: nameof(ReplaceAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplacePermission, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteAsync( @@ -58,13 +58,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeletePermission, + operationName: nameof(DeleteAsync), containerName: null, databaseName: this.Id, operationType: Documents.OperationType.Delete, requestOptions, task: (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeletePermission, (response) => new OpenTelemetryResponse(response))); } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs index adbc3699a0..bea3309b7f 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs @@ -28,13 +28,13 @@ public override Task CreateStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateStoredProcedure, + operationName: nameof(CreateStoredProcedureAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateStoredProcedureAsync(storedProcedureProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateStoredProcedure, (response) => new OpenTelemetryResponse(response))); } public override FeedIterator GetStoredProcedureQueryIterator( @@ -91,13 +91,13 @@ public override Task ReadStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadStoredProcedure, + operationName: nameof(ReadStoredProcedureAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadStoredProcedureAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadStoredProcedure, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceStoredProcedureAsync( @@ -106,13 +106,13 @@ public override Task ReplaceStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceStoredProcedure, + operationName: nameof(ReplaceStoredProcedureAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Replace, requestOptions, task: (trace) => base.ReplaceStoredProcedureAsync(storedProcedureProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceStoredProcedure, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteStoredProcedureAsync( @@ -121,13 +121,13 @@ public override Task DeleteStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteStoreProcedure, + operationName: nameof(DeleteStoredProcedureAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteStoredProcedureAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteStoreProcedure, (response) => new OpenTelemetryResponse(response))); } public override Task> ExecuteStoredProcedureAsync( @@ -138,13 +138,13 @@ public override Task> ExecuteStoredProce CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ExecuteStoredProcedure, + operationName: nameof(ExecuteStoredProcedureAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Execute, requestOptions: requestOptions, task: (trace) => base.ExecuteStoredProcedureAsync(storedProcedureId, partitionKey, parameters, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ExecuteStoredProcedure, (response) => new OpenTelemetryResponse(response))); } public override Task ExecuteStoredProcedureStreamAsync( @@ -155,13 +155,13 @@ public override Task ExecuteStoredProcedureStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ExecuteStoredProcedureStream, + operationName: nameof(ExecuteStoredProcedureStreamAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Execute, requestOptions: requestOptions, task: (trace) => base.ExecuteStoredProcedureStreamAsync(storedProcedureId, partitionKey, parameters, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ExecuteStoredProcedure, (response) => new OpenTelemetryResponse(response))); } public override Task ExecuteStoredProcedureStreamAsync( @@ -172,13 +172,13 @@ public override Task ExecuteStoredProcedureStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ExecuteStoredProcedureStream, + operationName: nameof(ExecuteStoredProcedureStreamAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Execute, requestOptions: requestOptions, task: (trace) => base.ExecuteStoredProcedureStreamAsync(storedProcedureId, streamPayload, partitionKey, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ExecuteStoredProcedure, (response) => new OpenTelemetryResponse(response))); } public override Task CreateTriggerAsync( @@ -187,13 +187,13 @@ public override Task CreateTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateTrigger, + operationName: nameof(CreateTriggerAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateTriggerAsync(triggerProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateTrigger, (response) => new OpenTelemetryResponse(response))); } public override FeedIterator GetTriggerQueryIterator( @@ -250,13 +250,13 @@ public override Task ReadTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadTrigger, + operationName: nameof(ReadTriggerAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadTriggerAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadTrigger, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceTriggerAsync( @@ -265,13 +265,13 @@ public override Task ReplaceTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceTrigger, + operationName: nameof(ReplaceTriggerAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceTriggerAsync(triggerProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceTrigger, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteTriggerAsync( @@ -280,13 +280,13 @@ public override Task DeleteTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteTrigger, + operationName: nameof(DeleteTriggerAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteTriggerAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteTrigger, (response) => new OpenTelemetryResponse(response))); } public override Task CreateUserDefinedFunctionAsync( @@ -295,13 +295,13 @@ public override Task CreateUserDefinedFunctionAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreateUserDefinedFunction, + operationName: nameof(CreateUserDefinedFunctionAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreateUserDefinedFunctionAsync(userDefinedFunctionProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateUserDefinedFunction, (response) => new OpenTelemetryResponse(response))); } public override FeedIterator GetUserDefinedFunctionQueryIterator( @@ -358,13 +358,13 @@ public override Task ReadUserDefinedFunctionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadUserDefinedFunction, + operationName: nameof(ReadUserDefinedFunctionAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadUserDefinedFunctionAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadUserDefinedFunction, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceUserDefinedFunctionAsync( @@ -373,13 +373,13 @@ public override Task ReplaceUserDefinedFunctionAsyn CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceUserDefinedFunctions, + operationName: nameof(ReplaceUserDefinedFunctionAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceUserDefinedFunctionAsync(userDefinedFunctionProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceUserDefinedFunctions, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteUserDefinedFunctionAsync( @@ -388,13 +388,13 @@ public override Task DeleteUserDefinedFunctionAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteUserDefinedFunctions, + operationName: nameof(DeleteUserDefinedFunctionAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteUserDefinedFunctionAsync(id, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteUserDefinedFunctions, (response) => new OpenTelemetryResponse(response))); } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs index 8fe038007d..8c2253fd00 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs @@ -27,13 +27,13 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReadUser, + operationName: nameof(ReadAsync), containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Read, requestOptions: requestOptions, task: (trace) => base.ReadAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReadUser, (response) => new OpenTelemetryResponse(response))); } public override Task ReplaceAsync( @@ -42,13 +42,13 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.ReplaceUser, + operationName: nameof(ReplaceAsync), containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, requestOptions: requestOptions, task: (trace) => base.ReplaceAsync(userProperties, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.ReplaceUser, (response) => new OpenTelemetryResponse(response))); } public override Task DeleteAsync( @@ -56,13 +56,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.DeleteUser, + operationName: nameof(DeleteAsync), containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteUser, (response) => new OpenTelemetryResponse(response))); } public override Permission GetPermission(string id) @@ -77,13 +77,13 @@ public override Task CreatePermissionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.CreatePermission, + operationName: nameof(CreatePermissionAsync), containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Create, requestOptions: requestOptions, task: (trace) => base.CreatePermissionAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreatePermission, (response) => new OpenTelemetryResponse(response))); } public override Task UpsertPermissionAsync( @@ -99,7 +99,7 @@ public override Task UpsertPermissionAsync( operationType: Documents.OperationType.Upsert, requestOptions: requestOptions, task: (trace) => base.UpsertPermissionAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.UpsertPermission, (response) => new OpenTelemetryResponse(response))); } public override FeedIterator GetPermissionQueryIterator( diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs index 3d69bb6c7e..4224b9cd2d 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -61,7 +61,6 @@ public static class Operations public const string CreateStoredProcedure = "create_stored_procedure"; public const string DeleteStoreProcedure = "delete_stored_procedure"; public const string ExecuteStoredProcedure = "execute_stored_procedure"; - public const string ExecuteStoredProcedureStream = "execute_stored_procedure_stream"; public const string ReadStoredProcedure = "read_stored_procedure"; public const string ReplaceStoredProcedure = "replace_stored_procedure"; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs index a610e75b7f..2b0631cac1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs @@ -189,7 +189,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync() Assert.IsNotNull(context.Headers); Assert.IsNotNull(context.Headers.Session); Assert.IsTrue(context.Headers.RequestCharge > 0); - Assert.IsTrue(context.Diagnostics.ToString().Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); + Assert.IsTrue(context.Diagnostics.ToString().Contains("Change Feed Processor Read Next Async")); Assert.AreEqual(expected: 3, actual: docs.Count); ChangeFeedItem createChange = docs.ElementAt(0); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs index 4f68205673..c6812193da 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs @@ -9,14 +9,12 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.CFP.AllVersionsAndDeletes using System.Diagnostics; using System.Linq; using System.Text.Json; - using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos; using Microsoft.Azure.Cosmos.ChangeFeed.Utils; using Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed; using Microsoft.Azure.Cosmos.Services.Management.Tests; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -540,7 +538,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync(bool pr Assert.IsNotNull(context.Headers); Assert.IsNotNull(context.Headers.Session); Assert.IsTrue(context.Headers.RequestCharge > 0); - Assert.IsTrue(context.Diagnostics.ToString().Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); + Assert.IsTrue(context.Diagnostics.ToString().Contains("Change Feed Processor Read Next Async")); Assert.AreEqual(expected: 3, actual: docs.Count); ChangeFeedItem createChange = docs.ElementAt(0); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs index b187a4a4a2..f63ef4dbda 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Scripts; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -320,7 +319,7 @@ private void ValidateContext(ChangeFeedProcessorContext changeFeedProcessorConte Assert.IsNotNull(changeFeedProcessorContext.Headers.Session); Assert.IsTrue(changeFeedProcessorContext.Headers.RequestCharge > 0); string diagnosticsAsString = changeFeedProcessorContext.Diagnostics.ToString(); - Assert.IsTrue(diagnosticsAsString.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); + Assert.IsTrue(diagnosticsAsString.Contains("Change Feed Processor Read Next Async")); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs index ccb17311b3..40bdae7439 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs @@ -378,7 +378,7 @@ private async Task ValidateContextAsync(ChangeFeedProcessorContext changeFeedPro Assert.IsNotNull(changeFeedProcessorContext.Headers.Session); Assert.IsTrue(changeFeedProcessorContext.Headers.RequestCharge > 0); string diagnosticsAsString = changeFeedProcessorContext.Diagnostics.ToString(); - Assert.IsTrue(diagnosticsAsString.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)); + Assert.IsTrue(diagnosticsAsString.Contains("Change Feed Processor Read Next Async")); await this.ValidateFeedRangeAsync(changeFeedProcessorContext.FeedRange); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index 592590c83f..cd0107d44d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -762,11 +762,11 @@ private static CosmosClientContext MockClientContext() It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType,requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index 506198a744..e517c3a6f7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -350,11 +350,11 @@ private Mock MockClientContext() It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName,containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index 641567d0a7..b1b7ba094b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -206,11 +206,11 @@ private CosmosClientContext GetMockClientContext() It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs index 41e14ea85b..999d3aecfc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs @@ -385,17 +385,17 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti Mock mockedContext = new Mock(MockBehavior.Strict); mockedContext.Setup(c => c.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); mockedContext.Setup(x => x.OperationHelperAsync>( - It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedEstimator)), + It.Is(str => str.Contains("Change Feed Estimator")), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>>>(), - It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny, OpenTelemetryAttributes>>>(), It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, ResourceType?, TraceComponent, TraceLevel>( + .Returns>>, Tuple, OpenTelemetryAttributes>>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -497,17 +497,17 @@ private static ContainerInternal GetMockedContainer() containerMock.Setup(c => c.Database.Id).Returns("databaseId"); mockContext.Setup(x => x.OperationHelperAsync>( - It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedEstimator)), + It.Is(str => str.Contains("Change Feed Estimator")), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>>>(), - It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny, OpenTelemetryAttributes>>>(), It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, ResourceType?, TraceComponent, TraceLevel>( + .Returns>>, Tuple, OpenTelemetryAttributes>>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs index 8e90431099..d670cf2459 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs @@ -42,17 +42,17 @@ public async Task EtagPassesContinuation() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), + It.Is(str => str.Contains("Change Feed Processor")), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>,Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>,Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -123,17 +123,17 @@ public async Task NextReadHasUpdatedContinuation() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), + It.Is(str => str.Contains("Change Feed Processor")), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -194,17 +194,17 @@ public async Task ShouldSetFeedRangePartitionKeyRange() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), + It.Is(str => str.Contains("Change Feed Processor")), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) @@ -277,17 +277,17 @@ public async Task ShouldUseFeedRangeEpk() Mock containerMock = new Mock(); Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( - It.Is(str => str.Contains(OpenTelemetryConstants.Operations.QueryChangeFeedForPartitionKeyRange)), + It.Is(str => str.Contains("Change Feed Processor")), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, Documents.ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, Documents.ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs index 1801104a7d..4d29866b57 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs @@ -716,11 +716,11 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.OperationHelperAsync>( @@ -730,7 +730,7 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny(), It.IsAny>>>(), - It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny, OpenTelemetryAttributes>>>(), It.IsAny(), It.IsAny(), It.IsAny())) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs index 4159da4080..73777effc4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs @@ -482,11 +482,11 @@ private CosmosClientContext MockClientContext() It.IsAny(), It.IsAny(), It.IsAny>>(), - It.IsAny>(), + It.IsAny>>(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>, Func, ResourceType?, TraceComponent, TraceLevel>( + .Returns>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; From 93f5c07c5c72e699f729b8995824a91cce79bbe4 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 6 Sep 2024 08:28:25 +0530 Subject: [PATCH 13/22] baseline files --- .../src/Resource/ClientContextCore.cs | 4 +- ...iterBaselineTests.BatchOperationsAsync.xml | 8 +- ...riterBaselineTests.BulkOperationsAsync.xml | 448 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 156 +++--- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 24 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 112 ++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 64 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 16 +- ...selineTests.StreamPointOperationsAsync.xml | 16 +- ...aselineTests.TypedPointOperationsAsync.xml | 16 +- .../CosmosItemUnitTests.cs | 2 +- 12 files changed, 437 insertions(+), 437 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index ef46dd6d3b..1a0fe80a58 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -507,10 +507,10 @@ private async Task RunWithDiagnosticsHelperAsync( { if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) { - operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry.Item1; + operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry?.Item1; } - return openTelemetry.Item1; + return openTelemetry?.Item1; }, containerName: containerName, databaseName: databaseName, 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 0aa023efeb..6ec622e735 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 @@ -34,7 +34,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -181,10 +181,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -199,10 +199,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -217,10 +217,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -235,10 +235,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -253,10 +253,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -271,10 +271,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -289,10 +289,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -307,10 +307,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -325,10 +325,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -387,7 +387,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -518,10 +518,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -536,10 +536,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -554,10 +554,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -572,10 +572,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -590,10 +590,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -608,10 +608,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -626,10 +626,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -644,10 +644,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -662,10 +662,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -724,7 +724,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -855,10 +855,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -873,10 +873,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -891,10 +891,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -909,10 +909,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -927,10 +927,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -945,10 +945,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -963,10 +963,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -981,10 +981,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -999,10 +999,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1061,7 +1061,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1192,10 +1192,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1210,10 +1210,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1228,10 +1228,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1246,10 +1246,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1264,10 +1264,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1282,10 +1282,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1300,10 +1300,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1318,10 +1318,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1336,10 +1336,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1398,7 +1398,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1529,10 +1529,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1547,10 +1547,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1565,10 +1565,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1583,10 +1583,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1601,10 +1601,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1619,10 +1619,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1637,10 +1637,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1655,10 +1655,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1673,10 +1673,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1735,7 +1735,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1866,10 +1866,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1884,10 +1884,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1902,10 +1902,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1920,10 +1920,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1938,10 +1938,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1956,10 +1956,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1974,10 +1974,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -1992,10 +1992,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2010,10 +2010,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2072,7 +2072,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2203,10 +2203,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2221,10 +2221,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2239,10 +2239,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2257,10 +2257,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2275,10 +2275,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2293,10 +2293,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2311,10 +2311,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2329,10 +2329,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2347,10 +2347,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2409,7 +2409,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2540,10 +2540,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2558,10 +2558,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2576,10 +2576,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2594,10 +2594,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2612,10 +2612,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2630,10 +2630,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2648,10 +2648,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2666,10 +2666,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2684,10 +2684,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2746,7 +2746,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2877,10 +2877,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2895,10 +2895,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2913,10 +2913,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2931,10 +2931,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2949,10 +2949,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2967,10 +2967,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -2985,10 +2985,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3003,10 +3003,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3021,10 +3021,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3083,7 +3083,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3214,10 +3214,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3232,10 +3232,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3250,10 +3250,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3268,10 +3268,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3286,10 +3286,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3304,10 +3304,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3322,10 +3322,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3340,10 +3340,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3358,10 +3358,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb @@ -3441,7 +3441,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - bulk_create_item + create_item databaseName containerName cosmosdb 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 1ffc916779..4bf97b7cf5 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 @@ -26,7 +26,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -1042,10 +1042,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -1061,10 +1061,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -1080,10 +1080,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -1099,10 +1099,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -1153,7 +1153,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -1788,10 +1788,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -1807,10 +1807,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -1826,10 +1826,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -1845,10 +1845,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -1900,7 +1900,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -2515,10 +2515,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -2534,10 +2534,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -2553,10 +2553,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -2572,10 +2572,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed + Change Feed Iterator Read Next Async databaseName containerName cosmosdb @@ -2627,7 +2627,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -3262,10 +3262,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -3281,10 +3281,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -3300,10 +3300,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -3319,10 +3319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + Typed FeedIterator ReadNextAsync databaseName containerName cosmosdb @@ -3369,7 +3369,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_change_feed_estimator + Change Feed Estimator Read Next Async databaseName containerName cosmosdb 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 e5a8ecb1a7..60703df9ae 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 @@ -16,7 +16,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_many_items + ReadManyItemsStreamAsync databaseName containerName cosmosdb @@ -582,7 +582,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - read_many_items + ReadManyItemsAsync databaseName containerName cosmosdb 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 60b4ab3f92..f774d248cf 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 @@ -18,7 +18,7 @@ (), It.IsAny(), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, ResourceType?, TraceComponent, TraceLevel>( + .Returns>>, Tuple, OpenTelemetryAttributes>>, ResourceType?, TraceComponent, TraceLevel>( (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.ProcessResourceOperationStreamAsync( From ca7e903ac1ef8297c5b21ff529f4b01d0e8b51a0 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 6 Sep 2024 22:45:12 +0530 Subject: [PATCH 14/22] fix tests --- ...geFeedPartitionKeyResultSetIteratorCore.cs | 2 - Microsoft.Azure.Cosmos/src/CosmosClient.cs | 2 +- .../src/Resource/ClientContextCore.cs | 1 - .../Resource/Container/ContainerInlineCore.cs | 6 +- .../src/Resource/User/UserInlineCore.cs | 2 +- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 84 +++++++++---------- ...TraceWriterBaselineTests.ReadManyAsync.xml | 8 +- ...selineTests.StreamPointOperationsAsync.xml | 4 +- .../CFP/AllVersionsAndDeletes/BuilderTests.cs | 1 - .../BuilderWithCustomSerializerTests.cs | 1 + .../ChangeFeed/DynamicTests.cs | 1 - .../CosmosDatabaseTests.cs | 3 +- .../CosmosNullReferenceExceptionTests.cs | 7 +- .../EndToEndTraceWriterBaselineTests.cs | 25 ++++-- ...dPartitionKeyResultSetIteratorCoreTests.cs | 1 - 15 files changed, 75 insertions(+), 73 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs index a1872d1682..63a779a0b4 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs @@ -9,8 +9,6 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; - using Microsoft.Azure.Cosmos.CosmosElements; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index 217357edb8..3a8c6a1ccf 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -791,7 +791,7 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseAsync), + operationName: nameof(CreateDatabaseAsync), containerName: null, databaseName: id, operationType: OperationType.Create, diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 1a0fe80a58..731888cf25 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -605,7 +605,6 @@ private bool IsBulkOperationSupported( OperationType operationType) { this.ThrowIfDisposed(); - if (!this.ClientOptions.AllowBulkExecution) { return false; diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index d827a878fa..70c7331074 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -109,7 +109,7 @@ public override Task DeleteContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(DeleteContainerAsync), + operationName: nameof(DeleteContainerStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Delete, @@ -298,7 +298,7 @@ public override Task> UpsertItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(UpsertItemStreamAsync), + operationName: nameof(UpsertItemAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, @@ -316,7 +316,7 @@ public override Task ReplaceItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: nameof(ReplaceItemAsync), + operationName: nameof(ReplaceItemStreamAsync), containerName: this.Id, databaseName: this.Database.Id, operationType: Documents.OperationType.Replace, diff --git a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs index 8c2253fd00..a649186a14 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs @@ -93,7 +93,7 @@ public override Task UpsertPermissionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - operationName: OpenTelemetryConstants.Operations.UpsertPermission, + operationName: nameof(UpsertPermissionAsync), containerName: null, databaseName: this.Database.Id, operationType: Documents.OperationType.Upsert, 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 4bf97b7cf5..8c6070bc0f 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 @@ -1023,10 +1023,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1042,10 +1042,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1061,10 +1061,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1080,10 +1080,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1099,10 +1099,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -1769,10 +1769,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1788,10 +1788,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1807,10 +1807,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1826,10 +1826,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -1845,10 +1845,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -2496,10 +2496,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2515,10 +2515,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2534,10 +2534,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2553,10 +2553,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -2572,10 +2572,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Iterator Read Next Async + query_change_feed databaseName containerName cosmosdb @@ -3243,10 +3243,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -3262,10 +3262,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -3281,10 +3281,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -3300,10 +3300,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -3319,10 +3319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + query_items databaseName containerName cosmosdb @@ -3644,10 +3644,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Change Feed Estimator Read Next Async + get_change_feed_processor_estimate databaseName containerName cosmosdb 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 e2203da4aa..6b201665a8 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 @@ -551,10 +551,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadManyItemsStreamAsync + read_many_items databaseName containerName cosmosdb @@ -1136,10 +1136,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadManyItemsAsync + read_many_items databaseName containerName cosmosdb 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 f774d248cf..6aac53346a 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 @@ -258,7 +258,7 @@ diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs index db1e4669ee..b91b43fd64 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNullReferenceExceptionTests.cs @@ -8,7 +8,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Diagnostics; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -58,7 +57,7 @@ public async Task CosmosEndToEndNullReferenceExceptionTestAsync() catch(NullReferenceException nre) { Assert.AreEqual(typeof(CosmosNullReferenceException), nre.GetType()); - Assert.IsTrue(nre.Message.Contains(OpenTelemetryConstants.Operations.CreateItem)); + Assert.IsTrue(nre.Message.Contains("CreateItemAsync")); string cosmosToString = nre.ToString(); Assert.IsFalse(cosmosToString.Contains("Microsoft.Azure.Cosmos.CosmosNullReferenceException"), $"The internal wrapper exception should not be exposed to users. {cosmosToString}"); Assert.IsTrue(cosmosToString.Contains(errorMessage)); @@ -74,11 +73,11 @@ public async Task CosmosEndToEndNullReferenceExceptionTestAsync() catch (NullReferenceException nre) { Assert.AreEqual(typeof(CosmosNullReferenceException), nre.GetType()); - Assert.IsTrue(nre.Message.Contains(OpenTelemetryConstants.Operations.QueryItems)); + Assert.IsTrue(nre.Message.Contains("Typed FeedIterator ReadNextAsync")); string cosmosToString = nre.ToString(); Assert.IsFalse(cosmosToString.Contains("Microsoft.Azure.Cosmos.CosmosNullReferenceException"), $"The internal wrapper exception should not be exposed to users. {cosmosToString}"); Assert.IsTrue(cosmosToString.Contains(errorMessage)); - Assert.IsTrue(cosmosToString.Contains(OpenTelemetryConstants.Operations.QueryItems)); + Assert.IsTrue(cosmosToString.Contains("Typed FeedIterator ReadNextAsync")); } } } 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 9639de4e39..53689de374 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 @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.SDK.EmulatorTests; using Microsoft.Azure.Cosmos.Services.Management.Tests.BaselineTest; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -1531,7 +1530,7 @@ public override Output ExecuteTest(Input input) oTelActivitiesString.Append(""); } - AssertTraceProperties(input.Trace); + AssertTraceProperites(input.Trace); Assert.IsTrue(text.Contains("Client Side Request Stats"), $"All diagnostics should have request stats: {text}"); Assert.IsTrue(json.Contains("Client Side Request Stats"), $"All diagnostics should have request stats: {json}"); Assert.IsTrue(text.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {text}"); @@ -1620,13 +1619,23 @@ private static JObject FindChild( } - private static void AssertTraceProperties(ITrace trace) + private static void AssertTraceProperites(ITrace trace) { - if (trace.Name == OpenTelemetryConstants.Operations.ReadManyItems || // skip test for read many as the queries are done in parallel - trace.Name == OpenTelemetryConstants.Operations.QueryChangeFeedEstimator || // Change Feed Estimator issues parallel requests - trace.Children.Count == 0) // Base case + if (trace.Name == "ReadManyItemsStreamAsync" || + trace.Name == "ReadManyItemsAsync") { - return; + return; // skip test for read many as the queries are done in parallel + } + + if (trace.Name == "Change Feed Estimator Read Next Async") + { + return; // Change Feed Estimator issues parallel requests + } + + if (trace.Children.Count == 0) + { + // Base case + return; } // Trace stopwatch should be greater than the sum of all children's stop watches @@ -1635,7 +1644,7 @@ private static void AssertTraceProperties(ITrace trace) foreach (ITrace child in trace.Children) { sumOfChildrenTimeSpan += child.Duration; - AssertTraceProperties(child); + AssertTraceProperites(child); } if (rootTimeSpan < sumOfChildrenTimeSpan) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs index d670cf2459..5f8a9903bf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; From 301ebe5705e060503c6e88dfa7067f8a392e4f24 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 10 Sep 2024 15:49:40 +0530 Subject: [PATCH 15/22] refcator code --- .../src/Resource/ClientContextCore.cs | 107 +++++++++--------- 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 731888cf25..44bb36027b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -502,70 +502,66 @@ private async Task RunWithDiagnosticsHelperAsync( ResourceType? resourceType = null) { using (OpenTelemetryCoreRecorder recorder = - OpenTelemetryRecorderFactory.CreateRecorder( - getOperationName: () => - { - if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) - { - operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry?.Item1; - } - - return openTelemetry?.Item1; - }, - containerName: containerName, - databaseName: databaseName, - operationType: operationType, - requestOptions: requestOptions, - trace: trace, - clientContext: this.isDisposed ? null : this)) + OpenTelemetryRecorderFactory.CreateRecorder( + getOperationName: () => + { + if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) + { + operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry?.Item1; + } + return openTelemetry?.Item1; + }, + containerName: containerName, + databaseName: databaseName, + operationType: operationType, + requestOptions: requestOptions, + trace: trace, + clientContext: this.isDisposed ? null : this)) + using (new ActivityScope(Guid.NewGuid())) { - using (new ActivityScope(Guid.NewGuid())) + try { - try + TResult result = await task(trace).ConfigureAwait(false); + if (openTelemetry != null && recorder.IsEnabled) { - TResult result = await task(trace).ConfigureAwait(false); - if (openTelemetry != null && recorder.IsEnabled) - { - // Record request response information - OpenTelemetryAttributes response = openTelemetry.Item2(result); - recorder.Record(response); - } - - return result; + // Record request response information + OpenTelemetryAttributes response = openTelemetry?.Item2(result); + recorder.Record(response); } - catch (OperationCanceledException oe) when (!(oe is CosmosOperationCanceledException)) - { - CosmosOperationCanceledException operationCancelledException = new CosmosOperationCanceledException(oe, trace); - recorder.MarkFailed(operationCancelledException); - throw operationCancelledException; - } - catch (ObjectDisposedException objectDisposed) when (!(objectDisposed is CosmosObjectDisposedException)) - { - CosmosObjectDisposedException objectDisposedException = new CosmosObjectDisposedException( - objectDisposed, - this.client, - trace); - recorder.MarkFailed(objectDisposedException); + return result; + } + catch (OperationCanceledException oe) when (!(oe is CosmosOperationCanceledException)) + { + CosmosOperationCanceledException operationCancelledException = new CosmosOperationCanceledException(oe, trace); + recorder.MarkFailed(operationCancelledException); - throw objectDisposedException; - } - catch (NullReferenceException nullRefException) when (!(nullRefException is CosmosNullReferenceException)) - { - CosmosNullReferenceException nullException = new CosmosNullReferenceException( - nullRefException, - trace); - recorder.MarkFailed(nullException); + throw operationCancelledException; + } + catch (ObjectDisposedException objectDisposed) when (!(objectDisposed is CosmosObjectDisposedException)) + { + CosmosObjectDisposedException objectDisposedException = new CosmosObjectDisposedException( + objectDisposed, + this.client, + trace); + recorder.MarkFailed(objectDisposedException); - throw nullException; - } - catch (Exception ex) - { - recorder.MarkFailed(ex); + throw objectDisposedException; + } + catch (NullReferenceException nullRefException) when (!(nullRefException is CosmosNullReferenceException)) + { + CosmosNullReferenceException nullException = new CosmosNullReferenceException( + nullRefException, + trace); + recorder.MarkFailed(nullException); - throw; - } + throw nullException; + } + catch (Exception ex) + { + recorder.MarkFailed(ex); + throw; } } } @@ -591,6 +587,7 @@ private async Task ProcessResourceOperationAsBulkStreamAsync( resourceStream: streamPayload, requestOptions: batchItemRequestOptions, cosmosClientContext: this); + TransactionalBatchOperationResult batchOperationResult = await cosmosContainerCore.BatchExecutor.AddAsync( itemBatchOperation, trace, From 22773febec6fbca09e1088e4ce1ef9c3c831ec39 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 10 Sep 2024 18:04:54 +0530 Subject: [PATCH 16/22] fix test --- .../src/Resource/ClientContextCore.cs | 10 ++++++++-- .../OpenTelemetry/OpenTelemetryRecorderFactory.cs | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 44bb36027b..540cc84453 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -505,11 +505,17 @@ private async Task RunWithDiagnosticsHelperAsync( OpenTelemetryRecorderFactory.CreateRecorder( getOperationName: () => { + // If opentelemetry is not enabled then return null operation name, so that no activity is created. + if (openTelemetry == null) + { + return null; + } + if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) { - operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry?.Item1; + operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry.Item1; } - return openTelemetry?.Item1; + return openTelemetry.Item1; }, containerName: containerName, databaseName: databaseName, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 368594114a..e83846d287 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -39,6 +39,12 @@ public static OpenTelemetryCoreRecorder CreateRecorder(Func getOperation { string operationName = getOperationName(); + // Trace without operation name is not valid trace to create + if (string.IsNullOrEmpty(operationName)) + { + return openTelemetryRecorder; + } + // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = LazyScopeFactory.Value.CreateScope(name: $"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}", kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? ActivityKind.Internal : ActivityKind.Client); From 190de3ac90ecc9e7184f266758034b70956258ba Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 17 Sep 2024 12:28:18 +0530 Subject: [PATCH 17/22] remove stream --- .../src/Resource/Container/ContainerInlineCore.cs | 2 +- .../src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index 70c7331074..2f9184527e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -672,7 +672,7 @@ public override Task DeleteAllItemsByPartitionKeyStreamAsync( operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteAllItemsByPartitionKeyStreamAsync(partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: new (OpenTelemetryConstants.Operations.DeleteAllItemsByPartitionKeyStream, (response) => new OpenTelemetryResponse(response))); + openTelemetry: new (OpenTelemetryConstants.Operations.DeleteAllItemsByPartitionKey, (response) => new OpenTelemetryResponse(response))); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs index 4224b9cd2d..17a26e71e0 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -41,7 +41,7 @@ public static class Operations // Item Operations public const string CreateItem = "create_item"; - public const string DeleteAllItemsByPartitionKeyStream = "delete_all_items_by_partition_key_stream"; + public const string DeleteAllItemsByPartitionKey = "delete_all_items_by_partition_key"; public const string DeleteItem = "delete_item"; public const string PatchItem = "patch_item"; public const string QueryItems = "query_items"; From 07dbf1df74d5fe991af13b9f16fbfccf8308fdd6 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 17 Sep 2024 15:29:57 +0530 Subject: [PATCH 18/22] feediterator changes --- .../src/ChangeFeed/ChangeFeedIteratorCore.cs | 2 ++ ...geFeedPartitionKeyResultSetIteratorCore.cs | 3 ++ .../src/ChangeFeed/StandByFeedIteratorCore.cs | 3 ++ .../ChangeFeedEstimatorIterator.cs | 2 ++ Microsoft.Azure.Cosmos/src/CosmosClient.cs | 4 +-- .../src/Query/v3Query/QueryIterator.cs | 2 ++ .../src/ReadFeed/ReadFeedIteratorCore.cs | 2 ++ .../Resource/FeedIterators/FeedIterator.cs | 5 +++ .../FeedIterators/FeedIteratorCore.cs | 5 +++ .../FeedIterators/FeedIteratorInlineCore.cs | 6 +++- .../FeedIteratorInlineCore{T}.cs | 6 +++- .../Resource/FeedIterators/FeedIterator{T}.cs | 5 +++ ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +++++++++---------- 13 files changed, 57 insertions(+), 20 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs index b3e4485f35..5f722e16ed 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs @@ -51,6 +51,8 @@ public ChangeFeedIteratorCore( this.changeFeedRequestOptions = changeFeedRequestOptions ?? new ChangeFeedRequestOptions(); this.changeFeedQuerySpec = changeFeedQuerySpec; + this.operationName = OpenTelemetryConstants.Operations.QueryChangeFeed; + this.lazyMonadicEnumerator = new AsyncLazy>( valueFactory: async (trace, cancellationToken) => { diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs index 63a779a0b4..5a5846795a 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -80,6 +81,8 @@ private ChangeFeedPartitionKeyResultSetIteratorCore( this.changeFeedStartFrom = changeFeedStartFrom ?? throw new ArgumentNullException(nameof(changeFeedStartFrom)); this.clientContext = this.container.ClientContext; this.changeFeedOptions = options; + + this.operationName = OpenTelemetryConstants.Operations.QueryChangeFeed; } public override bool HasMoreResults => this.hasMoreResultsInternal; diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/StandByFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/StandByFeedIteratorCore.cs index e9cbcfbdfd..dc41d17d2b 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/StandByFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/StandByFeedIteratorCore.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -45,6 +46,8 @@ internal StandByFeedIteratorCore( this.changeFeedOptions = options; this.maxItemCount = maxItemCount; this.continuationToken = continuationToken; + + this.operationName = OpenTelemetryConstants.Operations.QueryChangeFeed; } /// diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs index 0e930b2c79..4c38ee3b21 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs @@ -107,6 +107,8 @@ private ChangeFeedEstimatorIterator( this.monitoredContainerFeedCreator = monitoredContainerFeedCreator; this.documentServiceLeaseContainer = documentServiceLeaseContainer; + + this.operationName = OpenTelemetryConstants.Operations.QueryChangeFeedEstimator; } public override bool HasMoreResults => this.hasMoreResults; diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index 3a8c6a1ccf..0c0cef4001 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -1289,7 +1289,7 @@ internal virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - operationName: nameof(CreateDatabaseIfNotExistsAsync), + operationName: nameof(CreateDatabaseStreamAsync), containerName: null, databaseName: databaseProperties.Id, operationType: OperationType.Create, @@ -1304,7 +1304,7 @@ internal virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabaseIfNotExists, (response) => new OpenTelemetryResponse(response))); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabase, (response) => new OpenTelemetryResponse(response))); } private async Task CreateDatabaseInternalAsync( diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index 3d32cdedf5..d1fe581194 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -19,6 +19,7 @@ namespace Microsoft.Azure.Cosmos.Query using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; using Microsoft.Azure.Cosmos.Query.Core.QueryClient; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; internal sealed class QueryIterator : FeedIteratorInternal @@ -53,6 +54,7 @@ private QueryIterator( this.correlatedActivityId = correlatedActivityId; this.container = container; + this.operationName = OpenTelemetryConstants.Operations.QueryItems; } public static QueryIterator Create( diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs index 858926c9a4..7093390d72 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Cosmos.ReadFeed using Microsoft.Azure.Cosmos.ReadFeed.Pagination; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -38,6 +39,7 @@ public ReadFeedIteratorCore( CancellationToken cancellationToken) { this.container = container; + this.operationName = OpenTelemetryConstants.Operations.ReadFeedRanges; this.queryRequestOptions = queryRequestOptions; readFeedPaginationOptions ??= ReadFeedExecutionOptions.Default; diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs index 17b73829ba..df86f3b7a8 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs @@ -135,5 +135,10 @@ public void Dispose() /// Collect database name if container information not available in open telemetry attributes /// internal string databaseName; + + /// + /// Operation Name used for open telemetry traces + /// + internal string operationName; } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs index 9b630c3859..6487f2b01d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Json; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Serializer; + using Microsoft.Azure.Cosmos.Telemetry.OpenTelemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using static Microsoft.Azure.Documents.RuntimeConstants; @@ -49,6 +50,8 @@ public FeedIteratorCore( this.databaseName = databaseId; this.container = container; + + this.operationName = OpenTelemetryConstants.Operations.QueryItems; } public override bool HasMoreResults => this.hasMoreResultsInternal; @@ -212,6 +215,8 @@ internal FeedIteratorCore( this.databaseName = feedIterator.databaseName; this.container = feedIterator.container; + + this.operationName = OpenTelemetryConstants.Operations.QueryItems; } public override bool HasMoreResults => this.feedIterator.HasMoreResults; diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs index 6b78bdc91b..8da888479b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs @@ -30,6 +30,8 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; } internal FeedIteratorInlineCore( @@ -41,6 +43,8 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; } public override bool HasMoreResults => this.feedIteratorInternal.HasMoreResults; @@ -54,7 +58,7 @@ public override Task ReadNextAsync(CancellationToken cancellati operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: new (OpenTelemetryConstants.Operations.QueryItems, (response) => new OpenTelemetryResponse(responseMessage: response))); + openTelemetry: new (this.operationName, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task ReadNextAsync(ITrace trace, CancellationToken cancellationToken = default) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs index 48f114e181..3242daa749 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs @@ -30,6 +30,8 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; } internal FeedIteratorInlineCore( @@ -41,6 +43,8 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; } public override bool HasMoreResults => this.feedIteratorInternal.HasMoreResults; @@ -54,7 +58,7 @@ public override Task> ReadNextAsync(CancellationToken cancellati operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: trace => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: new (OpenTelemetryConstants.Operations.QueryItems, (response) => new OpenTelemetryResponse(responseMessage: response))); + openTelemetry: new (this.feedIteratorInternal.operationName, (response) => new OpenTelemetryResponse(responseMessage: response))); } public override Task> ReadNextAsync(ITrace trace, CancellationToken cancellationToken) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs index bd901c9004..1bf911441d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs @@ -123,5 +123,10 @@ public void Dispose() /// Collect database name if container information not available in open telemetry attributes /// internal string databaseName; + + /// + /// Operation Name used for open telemetry traces + /// + internal string operationName; } } \ 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 a8cc33f3bc..192a52b120 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 @@ -576,10 +576,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -596,10 +596,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -616,10 +616,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -636,10 +636,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1923,10 +1923,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1943,10 +1943,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1963,10 +1963,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1983,10 +1983,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb From 8bb094692d59c79ee8742ed6dd00fe8c4b457c32 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 17 Sep 2024 21:05:23 +0530 Subject: [PATCH 19/22] fix bugs --- .../src/Resource/ClientContextCore.cs | 5 +- .../OpenTelemetry/OpenTelemetryAttributes.cs | 11 + .../OpenTelemetry/OpenTelemetryResponse.cs | 5 +- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 23 +- ...riterBaselineTests.BulkOperationsAsync.xml | 404 +++++++++--------- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 +-- 6 files changed, 246 insertions(+), 258 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 540cc84453..37fe60f89e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -265,7 +265,6 @@ private async Task OperationHelperWithRootTraceAsync( trace, task, openTelemetry, - operationName, requestOptions, resourceType); } @@ -304,7 +303,6 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn trace, task, openTelemetry, - operationName, requestOptions, resourceType); } @@ -497,7 +495,6 @@ private async Task RunWithDiagnosticsHelperAsync( ITrace trace, Func> task, Tuple> openTelemetry, - string operationName, RequestOptions requestOptions, ResourceType? resourceType = null) { @@ -513,7 +510,7 @@ private async Task RunWithDiagnosticsHelperAsync( if (resourceType is not null && this.IsBulkOperationSupported(resourceType.Value, operationType)) { - operationName = OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry.Item1; + return OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry.Item1; } return openTelemetry.Item1; }, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 3dd7ae877e..2e927f53a1 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -4,7 +4,9 @@ namespace Microsoft.Azure.Cosmos.Telemetry { + using System; using System.Net; + using System.Security.AccessControl; internal class OpenTelemetryAttributes { @@ -18,6 +20,15 @@ internal OpenTelemetryAttributes() internal OpenTelemetryAttributes(RequestMessage requestMessage) { this.RequestContentLength = requestMessage?.Headers?.ContentLength; + if (requestMessage != null) + { + this.OperationType = requestMessage.OperationType; + this.ResourceType = requestMessage.ResourceType; + } + else + { + this.OperationType = Documents.OperationType.Invalid; + } } /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 5738d58c5c..ed55a9812e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -37,8 +37,7 @@ internal OpenTelemetryResponse(ResponseMessage responseMessage) requestMessage: responseMessage.RequestMessage, subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, - correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) + correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId) { } @@ -52,7 +51,6 @@ private OpenTelemetryResponse( Documents.SubStatusCodes? subStatusCode, string activityId, string correlationId, - Documents.OperationType operationType = Documents.OperationType.Invalid, int? batchSize = null) : base(requestMessage) { @@ -64,7 +62,6 @@ private OpenTelemetryResponse( this.SubStatusCode = (int)(subStatusCode ?? Documents.SubStatusCodes.Unknown); this.ActivityId = activityId; this.CorrelatedActivityId = correlationId; - this.OperationType = operationType; this.BatchSize = batchSize; } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 692a0aa552..a6ffa18dc1 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -22,8 +22,7 @@ internal OpenTelemetryResponse(FeedResponse responseMessage) requestMessage: responseMessage.RequestMessage, subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, - correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) + correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId) { } @@ -37,22 +36,10 @@ internal OpenTelemetryResponse(Response responseMessage) requestMessage: responseMessage.RequestMessage, subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, - correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, - operationType: GetOperationType(responseMessage), - resourceType: GetResourceType(responseMessage)) + correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId) { } - private static OperationType GetOperationType(Response responseMessage) - { - return responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid; - } - - private static ResourceType? GetResourceType(Response responseMessage) - { - return responseMessage is ItemResponse ? Documents.ResourceType.Document : null; - } - private OpenTelemetryResponse( HttpStatusCode statusCode, double? requestCharge, @@ -62,9 +49,7 @@ private OpenTelemetryResponse( RequestMessage requestMessage, Documents.SubStatusCodes? subStatusCode, string activityId, - string correlatedActivityId, - Documents.OperationType operationType, - Documents.ResourceType? resourceType = null) + string correlatedActivityId) : base(requestMessage) { this.StatusCode = statusCode; @@ -75,8 +60,6 @@ private OpenTelemetryResponse( this.SubStatusCode = (int)(subStatusCode ?? Documents.SubStatusCodes.Unknown); this.ActivityId = activityId; this.CorrelatedActivityId = correlatedActivityId; - this.OperationType = operationType; - this.ResourceType = resourceType; } private static Headers GetHeader(FeedResponse responseMessage) 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 70aaff65a7..ae53deaaee 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 @@ -163,10 +163,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -181,10 +181,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -199,10 +199,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -217,10 +217,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -235,10 +235,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -253,10 +253,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -271,10 +271,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -289,10 +289,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -307,10 +307,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -325,10 +325,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -500,10 +500,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -518,10 +518,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -536,10 +536,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -554,10 +554,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -572,10 +572,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -590,10 +590,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -608,10 +608,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -626,10 +626,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -644,10 +644,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -662,10 +662,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -837,10 +837,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -855,10 +855,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -873,10 +873,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -891,10 +891,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -909,10 +909,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -927,10 +927,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -945,10 +945,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -963,10 +963,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -981,10 +981,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -999,10 +999,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1174,10 +1174,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1192,10 +1192,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1210,10 +1210,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1228,10 +1228,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1246,10 +1246,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1264,10 +1264,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1282,10 +1282,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1300,10 +1300,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1318,10 +1318,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1336,10 +1336,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1511,10 +1511,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1529,10 +1529,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1547,10 +1547,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1565,10 +1565,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1583,10 +1583,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1601,10 +1601,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1619,10 +1619,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1637,10 +1637,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1655,10 +1655,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1673,10 +1673,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1848,10 +1848,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1866,10 +1866,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1884,10 +1884,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1902,10 +1902,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1920,10 +1920,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1938,10 +1938,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1956,10 +1956,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1974,10 +1974,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -1992,10 +1992,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2010,10 +2010,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2185,10 +2185,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2203,10 +2203,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2221,10 +2221,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2239,10 +2239,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2257,10 +2257,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2275,10 +2275,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2293,10 +2293,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2311,10 +2311,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2329,10 +2329,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2347,10 +2347,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2522,10 +2522,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2540,10 +2540,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2558,10 +2558,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2576,10 +2576,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2594,10 +2594,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2612,10 +2612,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2630,10 +2630,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2648,10 +2648,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2666,10 +2666,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2684,10 +2684,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2859,10 +2859,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2877,10 +2877,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2895,10 +2895,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2913,10 +2913,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2931,10 +2931,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2949,10 +2949,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2967,10 +2967,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -2985,10 +2985,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3003,10 +3003,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3021,10 +3021,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3196,10 +3196,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3214,10 +3214,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3232,10 +3232,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3250,10 +3250,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3268,10 +3268,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3286,10 +3286,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3304,10 +3304,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3322,10 +3322,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3340,10 +3340,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -3358,10 +3358,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb @@ -4150,10 +4150,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - create_item + bulk_create_item databaseName containerName cosmosdb 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 9c45187931..5478964355 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 @@ -622,7 +622,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -643,7 +643,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -664,7 +664,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -685,7 +685,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -1343,7 +1343,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -1364,7 +1364,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -1385,7 +1385,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -1406,7 +1406,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2045,7 +2045,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2066,7 +2066,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2087,7 +2087,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2108,7 +2108,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2767,7 +2767,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2788,7 +2788,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2809,7 +2809,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -2830,7 +2830,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -3563,7 +3563,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -3584,7 +3584,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -3605,7 +3605,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -3626,7 +3626,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -4274,7 +4274,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -4295,7 +4295,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -4316,7 +4316,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -4337,7 +4337,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -5005,7 +5005,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -5026,7 +5026,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -5047,7 +5047,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value @@ -5068,7 +5068,7 @@ Some Value Some Value Direct - Query + ReadFeed Some Value Some Value Some Value From 79543d0240d2f5685d8ece884cde64274d999a2b Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 17 Sep 2024 23:31:09 +0530 Subject: [PATCH 20/22] further fixes --- .../src/Query/v3Query/QueryIterator.cs | 1 + .../Resource/FeedIterators/FeedIterator.cs | 5 ++ .../FeedIterators/FeedIteratorCore.cs | 4 +- .../FeedIterators/FeedIteratorInlineCore.cs | 13 ++++- .../FeedIteratorInlineCore{T}.cs | 13 ++++- .../Resource/FeedIterators/FeedIterator{T}.cs | 5 ++ .../OpenTelemetryAttributeKeys.cs | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 10 ++++ ...aceWriterBaselineTests.ChangeFeedAsync.xml | 40 ++++++------- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 +++++++++---------- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +++++------ 11 files changed, 113 insertions(+), 68 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index d1fe581194..ae1a0d6c22 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -55,6 +55,7 @@ private QueryIterator( this.container = container; this.operationName = OpenTelemetryConstants.Operations.QueryItems; + this.operationType = Documents.OperationType.Query; } public static QueryIterator Create( diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs index df86f3b7a8..16226e6591 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs @@ -140,5 +140,10 @@ public void Dispose() /// Operation Name used for open telemetry traces /// internal string operationName; + + /// + /// Operation Type used for open telemetry traces, it will set optionally, otherwise default operation type will be used in traces + /// + internal Documents.OperationType? operationType; } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs index 6487f2b01d..8e59fc26f7 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorCore.cs @@ -52,6 +52,7 @@ public FeedIteratorCore( this.container = container; this.operationName = OpenTelemetryConstants.Operations.QueryItems; + this.operationType = OperationType.Query; } public override bool HasMoreResults => this.hasMoreResultsInternal; @@ -216,7 +217,8 @@ internal FeedIteratorCore( this.databaseName = feedIterator.databaseName; this.container = feedIterator.container; - this.operationName = OpenTelemetryConstants.Operations.QueryItems; + this.operationName = feedIterator.operationName; + this.operationType = feedIterator.operationType; } public override bool HasMoreResults => this.feedIterator.HasMoreResults; diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs index 8da888479b..9d0fbd6caf 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs @@ -32,6 +32,7 @@ internal FeedIteratorInlineCore( this.databaseName = feedIteratorInternal.databaseName; this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } internal FeedIteratorInlineCore( @@ -45,6 +46,7 @@ internal FeedIteratorInlineCore( this.databaseName = feedIteratorInternal.databaseName; this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } public override bool HasMoreResults => this.feedIteratorInternal.HasMoreResults; @@ -58,7 +60,16 @@ public override Task ReadNextAsync(CancellationToken cancellati operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: new (this.operationName, (response) => new OpenTelemetryResponse(responseMessage: response))); + openTelemetry: new (this.operationName, (response) => + { + OpenTelemetryResponse openTelemetryResponse = new OpenTelemetryResponse(responseMessage: response); + + if (this.operationType.HasValue) + { + openTelemetryResponse.OperationType = this.operationType.Value; + } + return openTelemetryResponse; + })); } public override Task ReadNextAsync(ITrace trace, CancellationToken cancellationToken = default) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs index 3242daa749..605e293ae1 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs @@ -32,6 +32,7 @@ internal FeedIteratorInlineCore( this.databaseName = feedIteratorInternal.databaseName; this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } internal FeedIteratorInlineCore( @@ -45,6 +46,7 @@ internal FeedIteratorInlineCore( this.databaseName = feedIteratorInternal.databaseName; this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } public override bool HasMoreResults => this.feedIteratorInternal.HasMoreResults; @@ -58,7 +60,16 @@ public override Task> ReadNextAsync(CancellationToken cancellati operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: trace => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: new (this.feedIteratorInternal.operationName, (response) => new OpenTelemetryResponse(responseMessage: response))); + openTelemetry: new (this.feedIteratorInternal.operationName, (response) => + { + OpenTelemetryResponse openTelemetryResponse = new OpenTelemetryResponse(responseMessage: response); + + if (this.operationType.HasValue) + { + openTelemetryResponse.OperationType = this.operationType.Value; + } + return openTelemetryResponse; + })); } public override Task> ReadNextAsync(ITrace trace, CancellationToken cancellationToken) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs index 1bf911441d..cf389ee846 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs @@ -128,5 +128,10 @@ public void Dispose() /// Operation Name used for open telemetry traces /// internal string operationName; + + /// + /// Operation Type used for open telemetry traces + /// + internal Documents.OperationType? operationType; } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index bb228ba229..a0fdccb233 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -140,7 +140,7 @@ internal sealed class OpenTelemetryAttributeKeys /// /// Represents the size of the batch operation. /// - public const string BatchSize = "db.operation.batch.size"; + public const string BatchSize = "db.operation.batch_size"; // Exceptions 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 ae53deaaee..503c07e44f 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 @@ -353,6 +353,7 @@ + @@ -690,6 +691,7 @@ + @@ -1027,6 +1029,7 @@ + @@ -1364,6 +1367,7 @@ + @@ -1701,6 +1705,7 @@ + @@ -2038,6 +2043,7 @@ + @@ -2375,6 +2381,7 @@ + @@ -2712,6 +2719,7 @@ + @@ -3049,6 +3057,7 @@ + @@ -3386,6 +3395,7 @@ + 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 8c6070bc0f..a659800720 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 @@ -1769,10 +1769,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -1788,10 +1788,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -1807,10 +1807,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -1826,10 +1826,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -1845,10 +1845,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -3243,10 +3243,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -3262,10 +3262,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -3281,10 +3281,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -3300,10 +3300,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb @@ -3319,10 +3319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + query_change_feed databaseName containerName cosmosdb 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 5478964355..9c45187931 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 @@ -622,7 +622,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -643,7 +643,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -664,7 +664,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -685,7 +685,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -1343,7 +1343,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -1364,7 +1364,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -1385,7 +1385,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -1406,7 +1406,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2045,7 +2045,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2066,7 +2066,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2087,7 +2087,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2108,7 +2108,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2767,7 +2767,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2788,7 +2788,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2809,7 +2809,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -2830,7 +2830,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -3563,7 +3563,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -3584,7 +3584,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -3605,7 +3605,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -3626,7 +3626,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -4274,7 +4274,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -4295,7 +4295,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -4316,7 +4316,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -4337,7 +4337,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -5005,7 +5005,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -5026,7 +5026,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -5047,7 +5047,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value @@ -5068,7 +5068,7 @@ Some Value Some Value Direct - ReadFeed + Query Some Value Some Value Some Value 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 192a52b120..3c1d420f00 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 @@ -1259,10 +1259,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1279,10 +1279,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1299,10 +1299,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -1319,10 +1319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -2607,10 +2607,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -2627,10 +2627,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -2647,10 +2647,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb @@ -2667,10 +2667,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - query_items + read_feed_ranges databaseName containerName cosmosdb From 5e31de4a7643b87e77e402e9744c805e46b932b8 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 18 Sep 2024 00:51:21 +0530 Subject: [PATCH 21/22] typo fix --- .../EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml | 4 ++-- .../Tracing/AssertActivity.cs | 2 +- .../Tracing/CustomListener.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 6ec622e735..31271cf531 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 @@ -152,7 +152,7 @@ Some Value Direct Batch - 90 + 90 Some Value Some Value Some Value @@ -305,7 +305,7 @@ Some Value Direct Batch - 50 + 50 Some Value Some Value Some Value 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 fe157287bc..71bd1947f0 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 @@ -54,7 +54,7 @@ public static void IsValidOperationActivity(Activity activity) "db.cosmosdb.request_charge", "db.cosmosdb.regions_contacted", "db.cosmosdb.item_count", - "db.operation.batch.size", + "db.operation.batch_size", "db.cosmosdb.activity_id", "db.cosmosdb.correlated_activity_id", "exception.type", 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 37b27d8a63..e1fbb1690a 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 @@ -40,7 +40,7 @@ internal class CustomListener : "db.cosmosdb.connection_mode", "db.cosmosdb.operation_type", "db.cosmosdb.regions_contacted", - "db.operation.batch.size", + "db.operation.batch_size", "error.type" }; From 71b0d07658b982351a114f73096dbc5522eb1091 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 18 Sep 2024 02:04:54 +0530 Subject: [PATCH 22/22] fix test --- ...EndTraceWriterBaselineTests.BulkOperationsAsync.xml | 10 ---------- 1 file changed, 10 deletions(-) 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 503c07e44f..ae53deaaee 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 @@ -353,7 +353,6 @@ - @@ -691,7 +690,6 @@ - @@ -1029,7 +1027,6 @@ - @@ -1367,7 +1364,6 @@ - @@ -1705,7 +1701,6 @@ - @@ -2043,7 +2038,6 @@ - @@ -2381,7 +2375,6 @@ - @@ -2719,7 +2712,6 @@ - @@ -3057,7 +3049,6 @@ - @@ -3395,7 +3386,6 @@ -