Class TelemetryServiceCollectionExtensions
- Namespace
- DotCompute.Core.Extensions
- Assembly
- DotCompute.Core.dll
Extension methods for registering kernel telemetry services with dependency injection.
public static class TelemetryServiceCollectionExtensions
- Inheritance
-
TelemetryServiceCollectionExtensions
- Inherited Members
Methods
AddKernelTelemetry(IServiceCollection)
Registers kernel telemetry services as a singleton.
public static IServiceCollection AddKernelTelemetry(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection.
Returns
- IServiceCollection
The service collection for method chaining.
Remarks
Registers IKernelTelemetryProvider with the production implementation KernelTelemetryCollector. The telemetry collector is registered as a singleton to maintain metrics across the application lifetime.
AddKernelTelemetry(IServiceCollection, Func<IServiceProvider, IKernelTelemetryProvider>)
Registers a custom kernel telemetry provider using a factory function.
public static IServiceCollection AddKernelTelemetry(this IServiceCollection services, Func<IServiceProvider, IKernelTelemetryProvider> implementationFactory)
Parameters
servicesIServiceCollectionThe service collection.
implementationFactoryFunc<IServiceProvider, IKernelTelemetryProvider>The factory function to create the telemetry provider.
Returns
- IServiceCollection
The service collection for method chaining.
Remarks
Use this method when you need to provide custom initialization logic for the telemetry provider, such as configuring storage backends or integration with external telemetry systems.
AddKernelTelemetry<TProvider>(IServiceCollection)
Registers a custom kernel telemetry provider implementation.
public static IServiceCollection AddKernelTelemetry<TProvider>(this IServiceCollection services) where TProvider : class, IKernelTelemetryProvider
Parameters
servicesIServiceCollectionThe service collection.
Returns
- IServiceCollection
The service collection for method chaining.
Type Parameters
TProviderThe custom telemetry provider type.
Remarks
Use this method to register a custom telemetry provider implementation that implements IKernelTelemetryProvider. The custom provider will replace the default KernelTelemetryCollector.