Table of Contents

Class ProductionTelemetryProvider

Namespace
DotCompute.Core.Telemetry
Assembly
DotCompute.Core.dll

Production-grade telemetry provider with OpenTelemetry integration for comprehensive observability. Provides distributed tracing, metrics collection, and performance profiling for DotCompute operations.

public sealed class ProductionTelemetryProvider : TelemetryProvider, IDisposable
Inheritance
ProductionTelemetryProvider
Implements
Inherited Members
Extension Methods

Constructors

ProductionTelemetryProvider(ILogger<ProductionTelemetryProvider>, IOptions<TelemetryOptions>, MetricsCollector, PerformanceProfiler)

Initializes a new instance of the ProductionTelemetryProvider class.

public ProductionTelemetryProvider(ILogger<ProductionTelemetryProvider> logger, IOptions<TelemetryOptions> options, MetricsCollector metricsCollector, PerformanceProfiler performanceProfiler)

Parameters

logger ILogger<ProductionTelemetryProvider>

The logger.

options IOptions<TelemetryOptions>

The options.

metricsCollector MetricsCollector

The metrics collector.

performanceProfiler PerformanceProfiler

The performance profiler.

Methods

CreatePerformanceProfileAsync(string, CancellationToken)

Creates a performance profile for detailed kernel analysis.

public Task<PerformanceProfile> CreatePerformanceProfileAsync(string correlationId, CancellationToken cancellationToken = default)

Parameters

correlationId string
cancellationToken CancellationToken

Returns

Task<PerformanceProfile>

Dispose()

Performs dispose.

public void Dispose()

ExportTelemetryAsync(TelemetryExportFormat, CancellationToken)

Exports telemetry data to configured external systems (Prometheus, ELK, etc.).

public override Task ExportTelemetryAsync(TelemetryExportFormat format = TelemetryExportFormat.Prometheus, CancellationToken cancellationToken = default)

Parameters

format TelemetryExportFormat
cancellationToken CancellationToken

Returns

Task

GetSystemHealth()

Gets current system health metrics for monitoring and alerting.

public override SystemHealthMetrics GetSystemHealth()

Returns

SystemHealthMetrics

RecordError(Exception, string, Dictionary<string, object>?)

Records error with context and correlation information for debugging.

public void RecordError(Exception exception, string correlationId, Dictionary<string, object>? context = null)

Parameters

exception Exception
correlationId string
context Dictionary<string, object>

RecordKernelExecution(string, TimeSpan, string, bool, Dictionary<string, object>)

Records kernel execution metrics with detailed performance data.

public override void RecordKernelExecution(string kernelName, TimeSpan executionTime, string deviceId, bool success, Dictionary<string, object> metadata)

Parameters

kernelName string
executionTime TimeSpan
deviceId string
success bool
metadata Dictionary<string, object>

RecordMemoryOperation(string, long, TimeSpan, string, bool)

Records memory operation metrics including allocation patterns and transfer performance.

public override void RecordMemoryOperation(string operationType, long bytes, TimeSpan duration, string deviceId, bool success)

Parameters

operationType string
bytes long
duration TimeSpan
deviceId string
success bool

StartKernelTrace(string, string, Dictionary<string, object?>?)

Starts a new distributed trace for kernel execution with correlation context.

public Activity? StartKernelTrace(string operationName, string correlationId, Dictionary<string, object?>? tags = null)

Parameters

operationName string

The name of the operation being traced

correlationId string

Unique correlation ID for request tracing

tags Dictionary<string, object>

Additional tags for the trace

Returns

Activity

Activity for the trace span