Skip to content

Commit

Permalink
Update document model sync operations
Browse files Browse the repository at this point in the history
  • Loading branch information
96malhar committed Oct 30, 2024
1 parent 2946318 commit 299265b
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* permissions and limitations under the License.
*/

using Amazon.Runtime.Telemetry.Tracing;

namespace Amazon.DynamoDBv2.DocumentModel
{
public partial interface IDocumentBatchGet
Expand All @@ -29,7 +31,11 @@ public partial class DocumentBatchGet : IDocumentBatchGet
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(DocumentBatchGet), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}

Expand All @@ -47,7 +53,11 @@ public partial class MultiTableDocumentBatchGet : IMultiTableDocumentBatchGet
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(MultiTableDocumentBatchGet), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* permissions and limitations under the License.
*/

using Amazon.Runtime.Telemetry.Tracing;

namespace Amazon.DynamoDBv2.DocumentModel
{
public partial interface IDocumentBatchWrite
Expand All @@ -31,7 +33,11 @@ public partial class DocumentBatchWrite : IDocumentBatchWrite
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(DocumentBatchWrite), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}

Expand All @@ -51,7 +57,11 @@ public partial class MultiTableDocumentBatchWrite : IMultiTableDocumentBatchWrit
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(MultiTableDocumentBatchWrite), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* permissions and limitations under the License.
*/

using Amazon.Runtime.Telemetry.Tracing;

namespace Amazon.DynamoDBv2.DocumentModel
{
public partial interface IDocumentTransactGet
Expand All @@ -29,7 +31,11 @@ public partial class DocumentTransactGet : IDocumentTransactGet
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(DocumentTransactGet), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}

Expand All @@ -47,7 +53,11 @@ public partial class MultiTableDocumentTransactGet : IMultiTableDocumentTransact
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(MultiTableDocumentTransactGet), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* permissions and limitations under the License.
*/

using Amazon.Runtime.Telemetry.Tracing;

namespace Amazon.DynamoDBv2.DocumentModel
{
public partial interface IDocumentTransactWrite
Expand All @@ -28,7 +30,11 @@ public partial class DocumentTransactWrite : IDocumentTransactWrite
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(DocumentTransactWrite), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}

Expand All @@ -49,7 +55,11 @@ public partial class MultiTableDocumentTransactWrite : IMultiTableDocumentTransa
/// <inheritdoc/>
public void Execute()
{
ExecuteHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(MultiTableDocumentTransactWrite), nameof(Execute));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
ExecuteHelper();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* permissions and limitations under the License.
*/

using Amazon.Runtime.Telemetry.Tracing;
using System.Collections.Generic;

namespace Amazon.DynamoDBv2.DocumentModel
Expand Down Expand Up @@ -41,13 +42,21 @@ public partial class Search : ISearch
/// <inheritdoc/>
public List<Document> GetNextSet()
{
return GetNextSetHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(Search), nameof(GetNextSet));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
return GetNextSetHelper();
}
}

/// <inheritdoc/>
public List<Document> GetRemaining()
{
return GetRemainingHelper();
var operationName = DynamoDBTelemetry.ExtractOperationName(nameof(Search), nameof(GetRemaining));
using (DynamoDBTelemetry.CreateSpan(TracerProvider, operationName, spanKind: SpanKind.CLIENT))
{
return GetRemainingHelper();
}
}
}
}
Loading

0 comments on commit 299265b

Please sign in to comment.