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
loggerILogger<ProductionTelemetryProvider>The logger.
optionsIOptions<TelemetryOptions>The options.
metricsCollectorMetricsCollectorThe metrics collector.
performanceProfilerPerformanceProfilerThe performance profiler.
Methods
CreatePerformanceProfileAsync(string, CancellationToken)
Creates a performance profile for detailed kernel analysis.
public Task<PerformanceProfile> CreatePerformanceProfileAsync(string correlationId, CancellationToken cancellationToken = default)
Parameters
correlationIdstringcancellationTokenCancellationToken
Returns
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
formatTelemetryExportFormatcancellationTokenCancellationToken
Returns
GetSystemHealth()
Gets current system health metrics for monitoring and alerting.
public override SystemHealthMetrics GetSystemHealth()
Returns
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
exceptionExceptioncorrelationIdstringcontextDictionary<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
kernelNamestringexecutionTimeTimeSpandeviceIdstringsuccessboolmetadataDictionary<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
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
operationNamestringThe name of the operation being traced
correlationIdstringUnique correlation ID for request tracing
tagsDictionary<string, object>Additional tags for the trace
Returns
- Activity
Activity for the trace span