Class PrometheusClient
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
httpHttpClientbaseUrlUri
Properties
BaseUrl
public Uri BaseUrl { get; }
Property Value
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
querystringcancellationTokenCancellationToken