Show / Hide Table of Contents

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.

Inheritance
object
MetricsService
Implements
IAsyncDisposable
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extractor.Metrics
Assembly: Cognite.Metrics.dll
Syntax
public class MetricsService : IAsyncDisposable, IDisposable

Constructors

| Edit this page View Source

MetricsService(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 Source

Dispose()

Dispose metrics, closing the pushers

Declaration
public void Dispose()
| Edit this page View Source

DisposeAsync()

Dispose metrics, closing the pushers

Declaration
public ValueTask DisposeAsync()
Returns
Type Description
ValueTask
| Edit this page View Source

Start()

Starts a Prometheus server for scrape and multiple push gateway destinations, based on the configuration.

Declaration
public void Start()
| Edit this page View Source

Stop()

Stops the metrics service.

Declaration
public Task Stop()
Returns
Type Description
Task

Implements

IAsyncDisposable
IDisposable

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX