Amazon DynamoDB · Types · Other public types

ArxDiagnostics

Definition

Namespace
ARX.SDK.Services
Package
ARX.SDK
C#
public static class ArxDiagnostics

ARX's tracing and metrics, on .NET's own instruments, so OpenTelemetry (AddSource("ARX.SDK"), AddMeter("ARX.SDK")) or any ActivityListener and MeterListener read them:

  • an activity per operation (Create, RetrieveMultiple, …), kind Client, named "operation table", tagged db.system.name, db.operation.name, db.collection.name and arx.provider; on failure the status Error, error.type and arx.error.code;
  • arx.operation.duration (a histogram, in seconds) and arx.operation.errors (a counter), with the same tags.

Values are never recorded, only names. Without a listener, each operation costs a check.

Properties

  • const string SourceName

    The name of ARX's ActivitySource and Meter: ARX.SDK.

  • static readonly ActivitySource Source

    The source of ARX's activities.

  • static readonly Meter Meter

    The meter of ARX's metrics.

Methods

  • static Task<T> TraceAsync<T>(string provider, string dbSystem, string operation, string table, Func<Task<T>> work)

    Traces one operation of a provider. For the providers' use: applications read the activities and metrics instead.

    Parameter Type Description
    providerstringThe provider's name ("PostgreSQL").
    dbSystemstringThe database, as OpenTelemetry names it ("postgresql", "microsoft.sql_server", "mysql", "mongodb", "aws.dynamodb").
    operationstringThe operation ("Create", "RetrieveMultiple", …).
    tablestringThe table or entity, when known.
    workFunc<Task<T>>The operation itself.
  • static Task TraceAsync(string provider, string dbSystem, string operation, string table, Func<Task> work)

    As TraceAsync{T}, for an operation without a result.

    Parameter Type Description
    providerstringThe provider's name ("PostgreSQL").
    dbSystemstringThe database, as OpenTelemetry names it ("postgresql", "microsoft.sql_server", "mysql", "mongodb", "aws.dynamodb").
    operationstringThe operation ("Create", "RetrieveMultiple", …).
    tablestringThe table or entity, when known.
    workFunc<Task>The operation itself.

Usage

C#

A line from a verified sample; the full, runnable code is on its page.

ShouldListenTo = source => source.Name == ArxDiagnostics.SourceName,

Set the service up for production, scenario 3

Used in: