Table of Contents

Class PrometheusExporter

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

Production-grade Prometheus metrics exporter with real-time dashboard support and custom metric definitions. Provides comprehensive GPU compute metrics in Prometheus format for monitoring and alerting.

public sealed class PrometheusExporter : IDisposable
Inheritance
PrometheusExporter
Implements
Inherited Members
Extension Methods

Constructors

PrometheusExporter(ILogger<PrometheusExporter>, IOptions<PrometheusExporterOptions>, MetricsCollector)

Initializes a new instance of the PrometheusExporter class.

public PrometheusExporter(ILogger<PrometheusExporter> logger, IOptions<PrometheusExporterOptions> options, MetricsCollector metricsCollector)

Parameters

logger ILogger<PrometheusExporter>

The logger.

options IOptions<PrometheusExporterOptions>

The options.

metricsCollector MetricsCollector

The metrics collector.

Methods

Dispose()

Performs dispose.

public void Dispose()

ExportMetricsAsync(CancellationToken)

Exports current metrics in Prometheus text format.

public Task<string> ExportMetricsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token

Returns

Task<string>

Prometheus-formatted metrics string

ExportMetricsToFileAsync(string, CancellationToken)

Exports metrics to a file in Prometheus format.

public Task ExportMetricsToFileAsync(string filePath, CancellationToken cancellationToken = default)

Parameters

filePath string

Path to export file

cancellationToken CancellationToken

Cancellation token

Returns

Task

GetMetricsStatistics()

Gets current metric statistics for monitoring.

public PrometheusMetricsStatistics GetMetricsStatistics()

Returns

PrometheusMetricsStatistics

Metrics statistics

RecordDeviceMetrics(string, DevicePerformanceMetrics)

Records device health and utilization metrics.

public void RecordDeviceMetrics(string deviceId, DevicePerformanceMetrics metrics)

Parameters

deviceId string

Device identifier

metrics DevicePerformanceMetrics

Device performance metrics

RecordKernelCompilation(string, string, TimeSpan, bool)

Records kernel compilation events.

public void RecordKernelCompilation(string kernelName, string deviceId, TimeSpan compilationTime, bool success)

Parameters

kernelName string

Name of the compiled kernel

deviceId string

Target device

compilationTime TimeSpan

Compilation duration

success bool

Whether compilation was successful

RecordKernelExecution(string, string, TimeSpan, KernelExecutionMetrics, bool)

Records kernel execution metrics in Prometheus format.

public void RecordKernelExecution(string kernelName, string deviceId, TimeSpan executionTime, KernelExecutionMetrics metrics, bool success)

Parameters

kernelName string

Name of the executed kernel

deviceId string

Device identifier

executionTime TimeSpan

Kernel execution duration

metrics KernelExecutionMetrics

Detailed execution metrics

success bool

Whether the execution was successful

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

Records memory operation metrics in Prometheus format.

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

Parameters

operationType string

Type of memory operation

deviceId string

Device identifier

bytes long

Number of bytes transferred

duration TimeSpan

Transfer duration

metrics MemoryOperationMetrics

Detailed memory metrics

success bool

Whether the operation was successful

RecordProfileMetrics(string, PerformanceProfile)

Records performance profiling metrics.

public void RecordProfileMetrics(string correlationId, PerformanceProfile profile)

Parameters

correlationId string

Profile correlation ID

profile PerformanceProfile

Performance profile data