Table of Contents

Class MetalTelemetryExtensions

Namespace
DotCompute.Backends.Metal
Assembly
DotCompute.Backends.Metal.dll

Extension methods for configuring Metal telemetry and monitoring

public static class MetalTelemetryExtensions
Inheritance
MetalTelemetryExtensions
Inherited Members

Methods

AddMetalTelemetry(IServiceCollection, IConfiguration, string)

Adds Metal telemetry services with configuration from appsettings

public static IServiceCollection AddMetalTelemetry(this IServiceCollection services, IConfiguration configuration, string sectionName = "MetalTelemetry")

Parameters

services IServiceCollection
configuration IConfiguration
sectionName string

Returns

IServiceCollection

AddMetalTelemetry(IServiceCollection, Action<MetalTelemetryOptions>?)

Adds Metal telemetry services to the dependency injection container

public static IServiceCollection AddMetalTelemetry(this IServiceCollection services, Action<MetalTelemetryOptions>? configureOptions = null)

Parameters

services IServiceCollection
configureOptions Action<MetalTelemetryOptions>

Returns

IServiceCollection

EnableAlerts(MetalTelemetryOptions, params string[])

Enables alert notifications

public static MetalTelemetryOptions EnableAlerts(this MetalTelemetryOptions options, params string[] notificationEndpoints)

Parameters

options MetalTelemetryOptions
notificationEndpoints string[]

Returns

MetalTelemetryOptions

EnableProductionLogging(MetalTelemetryOptions, bool, bool, params string[])

Enables production logging features

public static MetalTelemetryOptions EnableProductionLogging(this MetalTelemetryOptions options, bool useJsonFormat = true, bool enableCorrelationTracking = true, params string[] externalEndpoints)

Parameters

options MetalTelemetryOptions
useJsonFormat bool
enableCorrelationTracking bool
externalEndpoints string[]

Returns

MetalTelemetryOptions

SetIntervals(MetalTelemetryOptions, TimeSpan?, TimeSpan?, TimeSpan?)

Configures telemetry intervals

public static MetalTelemetryOptions SetIntervals(this MetalTelemetryOptions options, TimeSpan? reportingInterval = null, TimeSpan? cleanupInterval = null, TimeSpan? exportInterval = null)

Parameters

options MetalTelemetryOptions
reportingInterval TimeSpan?
cleanupInterval TimeSpan?
exportInterval TimeSpan?

Returns

MetalTelemetryOptions

SetPerformanceThresholds(MetalTelemetryOptions, double, double, double)

Configures performance thresholds

public static MetalTelemetryOptions SetPerformanceThresholds(this MetalTelemetryOptions options, double slowOperationMs = 100, double highGpuUtilization = 85, double highMemoryUtilization = 80)

Parameters

options MetalTelemetryOptions
slowOperationMs double
highGpuUtilization double
highMemoryUtilization double

Returns

MetalTelemetryOptions

UseApplicationInsights(MetalTelemetryOptions, string, string)

Configures Application Insights export

public static MetalTelemetryOptions UseApplicationInsights(this MetalTelemetryOptions options, string endpoint, string instrumentationKey)

Parameters

options MetalTelemetryOptions
endpoint string
instrumentationKey string

Returns

MetalTelemetryOptions

UseDataDog(MetalTelemetryOptions, string, string)

Configures DataDog export

public static MetalTelemetryOptions UseDataDog(this MetalTelemetryOptions options, string endpoint, string apiKey)

Parameters

options MetalTelemetryOptions
endpoint string
apiKey string

Returns

MetalTelemetryOptions

UseGrafanaCloud(MetalTelemetryOptions, string, string)

Configures Grafana Cloud export

public static MetalTelemetryOptions UseGrafanaCloud(this MetalTelemetryOptions options, string endpoint, string apiKey)

Parameters

options MetalTelemetryOptions
endpoint string
apiKey string

Returns

MetalTelemetryOptions

UseOpenTelemetry(MetalTelemetryOptions, string, Dictionary<string, string>?)

Configures OpenTelemetry export

public static MetalTelemetryOptions UseOpenTelemetry(this MetalTelemetryOptions options, string endpoint, Dictionary<string, string>? headers = null)

Parameters

options MetalTelemetryOptions
endpoint string
headers Dictionary<string, string>

Returns

MetalTelemetryOptions

UsePrometheusExport(MetalTelemetryOptions, string, Dictionary<string, string>?)

Configures Prometheus metrics export

public static MetalTelemetryOptions UsePrometheusExport(this MetalTelemetryOptions options, string endpoint, Dictionary<string, string>? headers = null)

Parameters

options MetalTelemetryOptions
endpoint string
headers Dictionary<string, string>

Returns

MetalTelemetryOptions