Table of Contents

Class PrometheusClient

Namespace
Virtufin.Api.Resources
Assembly
Virtufin.Api.dll

Instant queries against Prometheus' HTTP API (/api/v1/query), read with JsonDocument so the AOT build needs no serializer for them.

public sealed class PrometheusClient
Inheritance
PrometheusClient
Inherited Members

Constructors

PrometheusClient(HttpClient, Uri)

Instant queries against Prometheus' HTTP API (/api/v1/query), read with JsonDocument so the AOT build needs no serializer for them.

public PrometheusClient(HttpClient http, Uri baseUrl)

Parameters

http HttpClient
baseUrl Uri

Properties

BaseUrl

public Uri BaseUrl { get; }

Property Value

Uri

Methods

QueryAsync(string, CancellationToken)

The samples of a vector or scalar result. Throws HttpRequestException or TaskCanceledException when Prometheus cannot be reached in time.

public Task<IReadOnlyList<PrometheusSample>> QueryAsync(string query, CancellationToken cancellationToken)

Parameters

query string
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<PrometheusSample>>