Class MetricsService
Utility class for configuring Prometheus for monitoring and metrics. A metrics server and multiple push gateway destinations can be configured according to MetricsConfig.
Inherited Members
Namespace: Cognite.Extractor.Metrics
Assembly: Cognite.Metrics.dll
Syntax
public class MetricsService : IAsyncDisposable, IDisposable
Constructors
| Edit this page View SourceMetricsService(IHttpClientFactory, ILogger<MetricsService>, MetricsConfig?)
Initialized the metrics service with the given config
object.
Declaration
public MetricsService(IHttpClientFactory clientFactory, ILogger<MetricsService> logger, MetricsConfig? config = null)
Parameters
Type | Name | Description |
---|---|---|
IHttpClientFactory | clientFactory | A pre-configured http client factory |
ILogger<MetricsService> | logger | Logger |
MetricsConfig | config | Configuration object |
Methods
| Edit this page View SourceDispose()
Dispose metrics, closing the pushers
Declaration
public void Dispose()
DisposeAsync()
Dispose metrics, closing the pushers
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
ValueTask |
Start()
Starts a Prometheus server for scrape and multiple push gateway destinations, based on the configuration.
Declaration
public void Start()
Stop()
Stops the metrics service.
Declaration
public Task Stop()
Returns
Type | Description |
---|---|
Task |