<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.8.3" />

Azure.Monitor.OpenTelemetry.Exporter.Internals.CustomerSdkStats.CustomerSdkStatsHelper

static class CustomerSdkStatsHelper
Helper class for tracking customer SDK statistics.
public static string CategorizeStatusCode(int statusCode)

Categorizes an HTTP status code into a human-readable drop reason. Follows the Python categorize_status_code function logic.

public static string GetDropReason(Exception exception)

public static int GetExportIntervalMilliseconds()

Gets the configured export interval for customer SDK stats in milliseconds.

public static bool IsEnabled()

Checks if customer SDK stats are enabled.

public static void TrackDropped(TelemetrySchemaTypeCounter telemetrySchemaTypeCounter, bool persistentBlobProviderExists)

Tracks dropped telemetry using pre-computed counts. According to the specification: - For non-retryable status codes: use the actual HTTP status code (401, 403, etc.) as dropCode - For other scenarios: use DropCode enum values (CLIENT_EXCEPTION, CLIENT_READONLY, etc.)

public static void TrackDropped(TelemetrySchemaTypeCounter telemetrySchemaTypeCounter, int dropCode, string dropReason = null)

Tracks dropped telemetry using pre-computed counts.

public static void TrackRetry(TelemetrySchemaTypeCounter telemetrySchemaTypeCounter, int retryCode, string retryReason = null)

Tracks retry telemetry using pre-computed counts.

public static void TrackSuccess(TelemetrySchemaTypeCounter telemetrySchemaTypeCounter)

Tracks successful telemetry transmission using pre-computed counts.