diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index cecf1fd778..d9092d32f7 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 @@ -18,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. /// @@ -29,6 +35,8 @@ internal BatchCore( { this.container = container; this.partitionKey = partitionKey; + + this.operations = new List(); } public override TransactionalBatch CreateItem( @@ -40,7 +48,7 @@ public override TransactionalBatch CreateItem( throw new ArgumentNullException(nameof(item)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Create, operationIndex: this.operations.Count, resource: item, @@ -59,7 +67,7 @@ public override TransactionalBatch CreateItemStream( throw new ArgumentNullException(nameof(streamPayload)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Create, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -78,7 +86,7 @@ public override TransactionalBatch ReadItem( throw new ArgumentNullException(nameof(id)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Read, operationIndex: this.operations.Count, id: id, @@ -97,7 +105,7 @@ public override TransactionalBatch UpsertItem( throw new ArgumentNullException(nameof(item)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Upsert, operationIndex: this.operations.Count, resource: item, @@ -116,7 +124,7 @@ public override TransactionalBatch UpsertItemStream( throw new ArgumentNullException(nameof(streamPayload)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Upsert, operationIndex: this.operations.Count, resourceStream: streamPayload, @@ -141,7 +149,7 @@ public override TransactionalBatch ReplaceItem( throw new ArgumentNullException(nameof(item)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -167,7 +175,7 @@ public override TransactionalBatch ReplaceItemStream( throw new ArgumentNullException(nameof(streamPayload)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Replace, operationIndex: this.operations.Count, id: id, @@ -187,7 +195,7 @@ public override TransactionalBatch DeleteItem( throw new ArgumentNullException(nameof(id)); } - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Delete, operationIndex: this.operations.Count, id: id, @@ -232,10 +240,7 @@ public override Task ExecuteAsync( this.operations = new List(); return executor.ExecuteAsync(trace, cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response, - isHomogenousOperations: this.isHomogenousOperations, - batchOperation: this.homogenousOperation)); + openTelemetry: new (OpenTelemetryConstants.Operations.ExecuteBatch, (response) => new OpenTelemetryResponse(responseMessage: response))); } /// @@ -250,7 +255,7 @@ public virtual TransactionalBatch PatchItemStream( Stream patchStream, TransactionalBatchPatchItemRequestOptions requestOptions = null) { - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, @@ -286,7 +291,7 @@ public override TransactionalBatch PatchItem( PatchSpec patchSpec = new PatchSpec(patchOperations, requestOptions); - this.AddOperation(new ItemBatchOperation( + this.operations.Add(new ItemBatchOperation( operationType: OperationType.Patch, operationIndex: this.operations.Count, id: id, diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs index aa6c72189b..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 OperationType? 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().OperationType == itemBatchOperation.OperationType; - this.homogenousOperation = this.isHomogenousOperations ? itemBatchOperation.OperationType : 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..5f722e16ed 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; @@ -50,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) => { @@ -226,7 +229,7 @@ public override async Task ReadNextAsync(CancellationToken canc 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/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs index 0456fc1d87..5a5846795a 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs @@ -9,7 +9,7 @@ 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; @@ -81,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; @@ -99,8 +101,6 @@ public override Task ReadNextAsync(CancellationToken cancellati 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/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 4d1fc6fd4a..4c38ee3b21 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; @@ -106,6 +107,8 @@ private ChangeFeedEstimatorIterator( this.monitoredContainerFeedCreator = monitoredContainerFeedCreator; this.documentServiceLeaseContainer = documentServiceLeaseContainer; + + this.operationName = OpenTelemetryConstants.Operations.QueryChangeFeedEstimator; } public override bool HasMoreResults => this.hasMoreResults; @@ -119,7 +122,7 @@ public override Task> ReadNextAsync(Cance 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 89c628635f..0c0cef4001 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -18,6 +18,8 @@ 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; using Microsoft.Azure.Documents; @@ -756,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))); } /// @@ -804,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))); } /// @@ -900,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))); } /// @@ -1205,7 +1206,7 @@ public virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - openTelemetry: (response) => new OpenTelemetryResponse(response)); + openTelemetry: new (OpenTelemetryConstants.Operations.CreateDatabase, (response) => new OpenTelemetryResponse(response))); } /// @@ -1288,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, @@ -1303,7 +1304,7 @@ internal virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - openTelemetry: (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..ae1a0d6c22 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,8 @@ private QueryIterator( this.correlatedActivityId = correlatedActivityId; this.container = container; + this.operationName = OpenTelemetryConstants.Operations.QueryItems; + this.operationType = Documents.OperationType.Query; } 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/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index a8cc0d59dc..37fe60f89e 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; @@ -210,7 +211,8 @@ 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) { @@ -223,7 +225,8 @@ internal override Task task, openTelemetry, traceComponent, - traceLevel) : + traceLevel, + resourceType) : this.OperationHelperWithRootTraceWithSynchronizationContextAsync( operationName, containerName, @@ -233,7 +236,8 @@ internal override Task task, openTelemetry, traceComponent, - traceLevel); + traceLevel, + resourceType); } private async Task OperationHelperWithRootTraceAsync( @@ -243,9 +247,10 @@ private async Task OperationHelperWithRootTraceAsync( OperationType operationType, RequestOptions requestOptions, Func> task, - Func openTelemetry, + Tuple> openTelemetry, TraceComponent traceComponent, - Tracing.TraceLevel traceLevel) + Tracing.TraceLevel traceLevel, + ResourceType? resourceType) { bool disableDiagnostics = requestOptions != null && requestOptions.DisablePointOperationDiagnostics; @@ -260,8 +265,8 @@ private async Task OperationHelperWithRootTraceAsync( trace, task, openTelemetry, - operationName, - requestOptions); + requestOptions, + resourceType); } } @@ -272,9 +277,10 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn OperationType operationType, RequestOptions requestOptions, Func> task, - Func openTelemetry, + Tuple> 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"); @@ -297,8 +303,8 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn trace, task, openTelemetry, - operationName, - requestOptions); + requestOptions, + resourceType); } }); } @@ -488,13 +494,26 @@ private async Task RunWithDiagnosticsHelperAsync( OperationType operationType, ITrace trace, Func> task, - Func openTelemetry, - string operationName, - RequestOptions requestOptions) + Tuple> openTelemetry, + RequestOptions requestOptions, + ResourceType? resourceType = null) { - using (OpenTelemetryCoreRecorder recorder = + using (OpenTelemetryCoreRecorder recorder = OpenTelemetryRecorderFactory.CreateRecorder( - operationName: operationName, + 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)) + { + return OpenTelemetryConstants.Operations.ExecuteBulkPrefix + openTelemetry.Item1; + } + return openTelemetry.Item1; + }, containerName: containerName, databaseName: databaseName, operationType: operationType, @@ -509,7 +528,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); } @@ -519,7 +538,7 @@ private async Task RunWithDiagnosticsHelperAsync( { CosmosOperationCanceledException operationCancelledException = new CosmosOperationCanceledException(oe, trace); recorder.MarkFailed(operationCancelledException); - + throw operationCancelledException; } catch (ObjectDisposedException objectDisposed) when (!(objectDisposed is CosmosObjectDisposedException)) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs index 6d6305e30b..8883d5b0a8 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. @@ -35,7 +36,7 @@ public override Task ReadAsync( 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( @@ -50,7 +51,7 @@ public override Task ReplaceAsync( 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 17caba406e..682d43d0d7 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 @@ -31,7 +32,7 @@ public override Task DeleteAsync( 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( @@ -94,7 +95,7 @@ public override Task> ReadCurrentAsync( 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 f3153a33cf..2f9184527e 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. @@ -42,7 +43,7 @@ public override Task ReadContainerAsync( 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( @@ -56,7 +57,7 @@ public override Task ReadContainerStreamAsync( 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( @@ -71,7 +72,7 @@ public override Task ReplaceContainerAsync( 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( @@ -86,7 +87,7 @@ public override Task ReplaceContainerStreamAsync( 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( @@ -100,7 +101,7 @@ public override Task DeleteContainerAsync( 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( @@ -114,7 +115,7 @@ public override Task DeleteContainerStreamAsync( 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) @@ -139,7 +140,7 @@ public override Task ReadThroughputAsync( 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( @@ -154,7 +155,7 @@ public override Task ReplaceThroughputAsync( 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( @@ -169,7 +170,7 @@ public override Task ReplaceThroughputAsync( 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) @@ -181,7 +182,7 @@ public override Task ReadThroughputIfExistsAsync(RequestOpti 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) @@ -193,7 +194,7 @@ public override Task ReplaceThroughputIfExistsAsync(Throughp 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( @@ -219,7 +220,8 @@ Task func(ITrace trace) 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); } public override Task> CreateItemAsync(T item, @@ -234,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: new (OpenTelemetryConstants.Operations.CreateItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task ReadItemStreamAsync( @@ -250,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: new (OpenTelemetryConstants.Operations.ReadItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task> ReadItemAsync( @@ -260,13 +264,14 @@ public override Task> ReadItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadItemAsync), + 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); } public override Task UpsertItemStreamAsync( @@ -282,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: new (OpenTelemetryConstants.Operations.UpsertItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task> UpsertItemAsync( @@ -298,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: new (OpenTelemetryConstants.Operations.UpsertItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task ReplaceItemStreamAsync( @@ -315,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: new (OpenTelemetryConstants.Operations.ReplaceItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task> ReplaceItemAsync( @@ -332,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: new (OpenTelemetryConstants.Operations.ReplaceItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task DeleteItemStreamAsync( @@ -348,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: new (OpenTelemetryConstants.Operations.DeleteItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task> DeleteItemAsync( @@ -364,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: new (OpenTelemetryConstants.Operations.DeleteItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task PatchItemStreamAsync( @@ -381,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: new (OpenTelemetryConstants.Operations.PatchItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task PatchItemStreamAsync( @@ -398,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: new (OpenTelemetryConstants.Operations.PatchItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task> PatchItemAsync( @@ -415,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: new (OpenTelemetryConstants.Operations.PatchItem, (response) => new OpenTelemetryResponse(response)), + resourceType: Documents.ResourceType.Document); } public override Task ReadManyItemsStreamAsync( @@ -430,7 +444,7 @@ public override Task ReadManyItemsStreamAsync( 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( @@ -439,13 +453,13 @@ public override Task> ReadManyItemsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadManyItemsAsync), + 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( @@ -658,7 +672,7 @@ public override Task DeleteAllItemsByPartitionKeyStreamAsync( operationType: Documents.OperationType.Delete, requestOptions: requestOptions, task: (trace) => base.DeleteAllItemsByPartitionKeyStreamAsync(partitionKey, trace, requestOptions, cancellationToken), - openTelemetry: (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/Resource/CosmosClientContext.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs index 5bd2cc1848..5db29ee8a2 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs @@ -65,7 +65,8 @@ 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 fb25ef4190..36fdfa51c2 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs @@ -6,7 +6,9 @@ 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; // This class acts as a wrapper for environments that use SynchronizationContext. internal sealed class DatabaseInlineCore : DatabaseCore @@ -33,7 +35,7 @@ public override Task CreateContainerAsync( 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, @@ -49,7 +51,7 @@ public override Task CreateContainerAsync(string 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( @@ -65,7 +67,7 @@ public override Task CreateContainerIfNotExistsAsync( 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( @@ -82,7 +84,7 @@ public override Task CreateContainerIfNotExistsAsync( 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( @@ -98,7 +100,7 @@ public override Task CreateContainerStreamAsync( 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, @@ -112,7 +114,7 @@ public override Task CreateUserAsync(string 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( @@ -133,7 +135,7 @@ public override Task DeleteAsync( 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( @@ -147,7 +149,7 @@ public override Task DeleteStreamAsync( 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) @@ -241,7 +243,7 @@ public override Task ReadAsync(RequestOptions requestOptions = 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( @@ -255,7 +257,7 @@ public override Task ReadStreamAsync( 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) @@ -280,7 +282,7 @@ public override Task ReadThroughputAsync( 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( @@ -295,7 +297,7 @@ public override Task ReplaceThroughputAsync( 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( @@ -310,7 +312,7 @@ public override Task ReplaceThroughputAsync( 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( @@ -326,7 +328,7 @@ public override Task CreateContainerAsync( 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( @@ -342,7 +344,7 @@ public override Task CreateContainerIfNotExistsAsync( 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( @@ -358,7 +360,7 @@ public override Task CreateContainerStreamAsync( 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( @@ -373,7 +375,7 @@ public override Task UpsertUserAsync( 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) @@ -401,7 +403,7 @@ public override Task CreateClientEncryptionKeyAsync 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/FeedIterator.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs index 17b73829ba..16226e6591 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator.cs @@ -135,5 +135,15 @@ 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; + + /// + /// 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 9b630c3859..8e59fc26f7 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,9 @@ public FeedIteratorCore( this.databaseName = databaseId; this.container = container; + + this.operationName = OpenTelemetryConstants.Operations.QueryItems; + this.operationType = OperationType.Query; } public override bool HasMoreResults => this.hasMoreResultsInternal; @@ -212,6 +216,9 @@ internal FeedIteratorCore( this.databaseName = feedIterator.databaseName; this.container = feedIterator.container; + + 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 87d0de1ef5..9d0fbd6caf 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 @@ -29,6 +30,9 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } internal FeedIteratorInlineCore( @@ -40,6 +44,9 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } public override bool HasMoreResults => this.feedIteratorInternal.HasMoreResults; @@ -53,7 +60,16 @@ public override Task ReadNextAsync(CancellationToken cancellati operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: (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 010dc6569a..605e293ae1 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 @@ -29,6 +30,9 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } internal FeedIteratorInlineCore( @@ -40,6 +44,9 @@ internal FeedIteratorInlineCore( this.container = feedIteratorInternal.container; this.databaseName = feedIteratorInternal.databaseName; + + this.operationName = feedIteratorInternal.operationName; + this.operationType = feedIteratorInternal.operationType; } public override bool HasMoreResults => this.feedIteratorInternal.HasMoreResults; @@ -53,7 +60,16 @@ public override Task> ReadNextAsync(CancellationToken cancellati operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: trace => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: (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 bd901c9004..cf389ee846 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIterator{T}.cs @@ -123,5 +123,15 @@ 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; + + /// + /// Operation Type used for open telemetry traces + /// + internal Documents.OperationType? operationType; } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs index ecf8e36d95..c231808305 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 @@ -33,7 +34,7 @@ public override Task ReadAsync( 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( @@ -49,7 +50,7 @@ public override Task ReplaceAsync( 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( @@ -63,7 +64,7 @@ public override Task DeleteAsync( 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 15059c1def..bea3309b7f 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. @@ -33,7 +34,7 @@ public override Task CreateStoredProcedureAsync( 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( @@ -96,7 +97,7 @@ public override Task ReadStoredProcedureAsync( 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( @@ -111,7 +112,7 @@ public override Task ReplaceStoredProcedureAsync( 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( @@ -126,7 +127,7 @@ public override Task DeleteStoredProcedureAsync( 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( @@ -143,7 +144,7 @@ public override Task> ExecuteStoredProce 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( @@ -160,7 +161,7 @@ public override Task ExecuteStoredProcedureStreamAsync( 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( @@ -177,7 +178,7 @@ public override Task ExecuteStoredProcedureStreamAsync( 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( @@ -192,7 +193,7 @@ public override Task CreateTriggerAsync( 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( @@ -255,7 +256,7 @@ public override Task ReadTriggerAsync( 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( @@ -270,7 +271,7 @@ public override Task ReplaceTriggerAsync( 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( @@ -285,7 +286,7 @@ public override Task DeleteTriggerAsync( 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( @@ -300,7 +301,7 @@ public override Task CreateUserDefinedFunctionAsync 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( @@ -363,7 +364,7 @@ public override Task ReadUserDefinedFunctionAsync( 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( @@ -378,7 +379,7 @@ public override Task ReplaceUserDefinedFunctionAsyn 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( @@ -393,7 +394,7 @@ public override Task DeleteUserDefinedFunctionAsync 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 c50ab7ff22..a649186a14 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 @@ -32,7 +33,7 @@ public override Task ReadAsync( 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( @@ -47,7 +48,7 @@ public override Task ReplaceAsync( 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( @@ -61,7 +62,7 @@ public override Task DeleteAsync( 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) @@ -82,7 +83,7 @@ public override Task CreatePermissionAsync( 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( @@ -98,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/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/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 7dbf7aab51..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; + } } /// @@ -71,31 +82,13 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage) internal Documents.OperationType OperationType { get; set; } /// - /// Batch Size + /// ResourceType /// - internal int? BatchSize { get; set; } + internal Documents.ResourceType? ResourceType { 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. + /// Batch Size /// - /// - /// 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; } + internal int? BatchSize { 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..17a26e71e0 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryConstants.cs @@ -0,0 +1,99 @@ +// ------------------------------------------------------------ +// 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 ExecuteBulkPrefix = "bulk_"; + + // Change feed operations + public const string QueryChangeFeed = "query_change_feed"; + public const string QueryChangeFeedEstimator = "get_change_feed_processor_estimate"; + + // 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 ReadConflict = "read_conflict"; + + //Container Operations + public const string CreateContainer = "create_container"; + public const string CreateContainerIfNotExists = "create_container_if_not_exists"; + public const string DeleteContainer = "delete_container"; + public const string ReadContainer = "read_container"; + public const string ReplaceContainer = "replace_container"; + 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 CreateDatabaseIfNotExists = "create_database_if_not_exists"; + public const string DeleteDatabase = "delete_database"; + public const string ReadDatabase = "read_database"; + + // Item Operations + public const string CreateItem = "create_item"; + 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"; + public const string ReadManyItems = "read_many_items"; + public const string ReadItem = "read_item"; + public const string ReplaceItem = "replace_item"; + public const string UpsertItem = "upsert_item"; + + // Permission operations + public const string CreatePermission = "create_permission"; + public const string DeletePermission = "delete_permission"; + 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 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 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 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 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 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/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 1b16f48307..e83846d287 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,14 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, OpenTelemetryCoreRecorder openTelemetryRecorder = default; if (clientContext is { ClientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing: false }) { + 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); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 5dba699773..ed55a9812e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -8,12 +8,11 @@ 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 { - internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage, bool isHomogenousOperations, OperationType? batchOperation) + internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage) : this( statusCode: responseMessage.StatusCode, requestCharge: OpenTelemetryResponse.GetHeader(responseMessage)?.RequestCharge, @@ -24,8 +23,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()) { } @@ -39,9 +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) { } @@ -55,9 +51,7 @@ private OpenTelemetryResponse( Documents.SubStatusCodes? subStatusCode, 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; @@ -68,9 +62,7 @@ private OpenTelemetryResponse( this.SubStatusCode = (int)(subStatusCode ?? Documents.SubStatusCodes.Unknown); this.ActivityId = activityId; this.CorrelatedActivityId = correlationId; - this.OperationType = operationType; this.BatchSize = batchSize; - this.BatchOperationName = batchOperationName; } private static string GetPayloadSize(ResponseMessage response) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 976b68173a..a6ffa18dc1 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 @@ -21,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) { } @@ -36,8 +36,7 @@ internal OpenTelemetryResponse(Response 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) { } @@ -50,8 +49,7 @@ private OpenTelemetryResponse( RequestMessage requestMessage, Documents.SubStatusCodes? subStatusCode, string activityId, - string correlatedActivityId, - Documents.OperationType operationType) + string correlatedActivityId) : base(requestMessage) { this.StatusCode = statusCode; @@ -62,7 +60,6 @@ private OpenTelemetryResponse( this.SubStatusCode = (int)(subStatusCode ?? Documents.SubStatusCodes.Unknown); this.ActivityId = activityId; this.CorrelatedActivityId = correlatedActivityId; - this.OperationType = operationType; } 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 fb5d0761ee..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 @@ -139,10 +139,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ExecuteAsync + execute_batch databaseName containerName cosmosdb @@ -152,7 +152,7 @@ Some Value Direct Batch - 90 + 90 Some Value Some Value Some Value @@ -292,10 +292,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ExecuteAsync + execute_batch databaseName containerName cosmosdb @@ -304,8 +304,8 @@ Some Value Some Value Direct - Batch.Create - 50 + Batch + 50 Some Value 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..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 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -181,10 +181,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -199,10 +199,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -217,10 +217,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -235,10 +235,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -253,10 +253,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -271,10 +271,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -289,10 +289,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -307,10 +307,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -325,10 +325,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -500,10 +500,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -518,10 +518,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -536,10 +536,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -554,10 +554,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -572,10 +572,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -590,10 +590,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -608,10 +608,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -626,10 +626,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -644,10 +644,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -662,10 +662,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -837,10 +837,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -855,10 +855,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -873,10 +873,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -891,10 +891,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -909,10 +909,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -927,10 +927,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -945,10 +945,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -963,10 +963,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -981,10 +981,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -999,10 +999,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1174,10 +1174,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1192,10 +1192,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1210,10 +1210,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1228,10 +1228,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1246,10 +1246,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1264,10 +1264,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1282,10 +1282,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1300,10 +1300,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1318,10 +1318,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1336,10 +1336,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1511,10 +1511,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1529,10 +1529,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1547,10 +1547,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1565,10 +1565,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1583,10 +1583,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1601,10 +1601,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1619,10 +1619,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1637,10 +1637,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1655,10 +1655,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1673,10 +1673,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1848,10 +1848,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1866,10 +1866,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1884,10 +1884,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1902,10 +1902,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1920,10 +1920,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1938,10 +1938,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1956,10 +1956,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1974,10 +1974,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -1992,10 +1992,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2010,10 +2010,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2185,10 +2185,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2203,10 +2203,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2221,10 +2221,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2239,10 +2239,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2257,10 +2257,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2275,10 +2275,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2293,10 +2293,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2311,10 +2311,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2329,10 +2329,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2347,10 +2347,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2522,10 +2522,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2540,10 +2540,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2558,10 +2558,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2576,10 +2576,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2594,10 +2594,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2612,10 +2612,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2630,10 +2630,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2648,10 +2648,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2666,10 +2666,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2684,10 +2684,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2859,10 +2859,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2877,10 +2877,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2895,10 +2895,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2913,10 +2913,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2931,10 +2931,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2949,10 +2949,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2967,10 +2967,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -2985,10 +2985,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3003,10 +3003,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3021,10 +3021,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3196,10 +3196,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3214,10 +3214,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3232,10 +3232,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3250,10 +3250,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3268,10 +3268,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3286,10 +3286,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3304,10 +3304,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3322,10 +3322,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3340,10 +3340,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -3358,10 +3358,10 @@ Some Value Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + bulk_create_item databaseName containerName cosmosdb @@ -4150,10 +4150,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + 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 4bf97b7cf5..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 @@ -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_change_feed 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_change_feed 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_change_feed 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_change_feed 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_change_feed 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_change_feed 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_change_feed 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_change_feed 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_change_feed 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_change_feed 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.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 58d4a538ea..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 @@ -117,10 +117,10 @@ } ] }]]> - + 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 @@ -258,10 +258,10 @@ } ] }]]> - + 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..2c5f831bc4 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 @@ -158,10 +158,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -435,10 +435,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -690,10 +690,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -977,10 +977,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1328,10 +1328,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -1512,10 +1512,10 @@ } ] }]]> - + 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..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 @@ -610,10 +610,10 @@ } ] }]]> - + 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 @@ -1331,10 +1331,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + 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 + 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 + 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 + query_items databaseName containerName cosmosdb @@ -2033,10 +2033,10 @@ } ] }]]> - + 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 @@ -2755,10 +2755,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + 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 + 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 + 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 + query_items databaseName containerName cosmosdb @@ -3551,10 +3551,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + 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 + 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 + 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 + query_items databaseName containerName cosmosdb @@ -4262,10 +4262,10 @@ } ] }]]> - + 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 @@ -4993,10 +4993,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + 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 + 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 + 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 + 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..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 @@ -576,10 +576,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -596,10 +596,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -616,10 +616,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -636,10 +636,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1259,10 +1259,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1279,10 +1279,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1299,10 +1299,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1319,10 +1319,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1923,10 +1923,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1943,10 +1943,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1963,10 +1963,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -1983,10 +1983,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -2607,10 +2607,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -2627,10 +2627,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -2647,10 +2647,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges databaseName containerName cosmosdb @@ -2667,10 +2667,10 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - Typed FeedIterator ReadNextAsync + read_feed_ranges 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 854845fbee..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 @@ -99,10 +99,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemStreamAsync + create_item databaseName containerName cosmosdb @@ -215,10 +215,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadItemStreamAsync + read_item databaseName containerName cosmosdb @@ -339,10 +339,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReplaceItemStreamAsync + replace_item databaseName containerName cosmosdb @@ -458,10 +458,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - DeleteItemStreamAsync + delete_item 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..983c9aad50 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 @@ -119,10 +119,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - CreateItemAsync + create_item databaseName containerName cosmosdb @@ -240,10 +240,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReadItemAsync + read_item databaseName containerName cosmosdb @@ -374,10 +374,10 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.23.0 - ReplaceItemAsync + replace_item databaseName containerName cosmosdb @@ -497,10 +497,10 @@ } ] }]]> - + 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/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" }; 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..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,12 @@ private static CosmosClientContext MockClientContext() It.IsAny(), 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>, 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 c6bca20950..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,12 @@ private Mock MockClientContext() It.IsAny(), 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>, 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 896eb0fade..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,12 @@ private CosmosClientContext GetMockClientContext() It.IsAny(), 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>, 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 8589a5e049..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 @@ -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; @@ -390,11 +391,12 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti 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>, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .Returns>>, Tuple, OpenTelemetryAttributes>>, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -501,11 +503,12 @@ private static ContainerInternal GetMockedContainer() 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>, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => + .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 08baba746b..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 @@ -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; @@ -46,11 +47,12 @@ public async Task EtagPassesContinuation() It.IsAny(), It.IsAny(), 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>,Tuple>, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -126,11 +128,12 @@ public async Task NextReadHasUpdatedContinuation() It.IsAny(), It.IsAny(), 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>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -196,11 +199,12 @@ public async Task ShouldSetFeedRangePartitionKeyRange() It.IsAny(), It.IsAny(), 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>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -278,11 +282,12 @@ public async Task ShouldUseFeedRangeEpk() It.IsAny(), It.IsAny(), 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>, 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 5f9b3d3dad..09766b2962 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,12 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), 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>, Tuple>, ResourceType?, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, resourceType, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.OperationHelperAsync>( It.IsAny(), @@ -729,11 +730,12 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() It.IsAny(), It.IsAny(), It.IsAny>>>(), - It.IsAny, OpenTelemetryAttributes>>(), + It.IsAny, OpenTelemetryAttributes>>>(), + It.IsAny(), It.IsAny(), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>>, Tuple, 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 6594bd926e..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,12 @@ private CosmosClientContext MockClientContext() It.IsAny(), 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>, 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/Telemetry/OpenTelemetryRecorderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs index d3d89a1664..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 @@ -108,7 +108,7 @@ public async Task CheckResponseCompatibility() if (instance is TransactionalBatchResponse transactionInstance) { - _ = new OpenTelemetryResponse(transactionInstance, false, null); + _ = new OpenTelemetryResponse(transactionInstance); } else if (instance is ResponseMessage responseMessageInstance) {