Klasse PrometheusHTTPAsyncConsumerApi

java.lang.Object
io.github.primelib.prometheus4j.api.PrometheusHTTPAsyncConsumerApi

@Generated("io.github.primelib.primecodegen.javafeign.JavaFeignGenerator") public class PrometheusHTTPAsyncConsumerApi extends Object
  • Konstruktordetails

  • Methodendetails

    • cleanTombstones

      public CompletableFuture<Void> cleanTombstones()
      Removes deleted data

      CleanTombstones removes the deleted data from disk and cleans up the existing tombstones. This can be used after deleting series to free up space.

    • createSnapshot

      Creates Snapshot of current data

      Snapshot creates a snapshot of all current data into snapshots/&amp;lt;datetime&amp;gt;-&amp;lt;rand&amp;gt; under the TSDB's data directory and returns the directory as response. It will optionally skip snapshotting data that is only present in the head block, and which has not yet been compacted to disk.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • skipHead: Skip data present in the head block. Optional.
    • deleteSeries

      Deletes selected data

      DeleteSeries deletes data for a selection of series in a time range. The actual data still exists on disk and is cleaned up in future compactions or can be explicitly cleaned up by hitting the [Clean Tombstones](https://prometheus.io/docs/prometheus/latest/querying/api/#clean-tombstones) endpoint. **NOTE:** This endpoint marks samples from series as deleted, but will not necessarily prevent associated series metadata from still being returned in metadata queries for the affected time range (even after cleaning tombstones). The exact extent of metadata deletion is an implementation detail that may change in the future.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • match: Repeated label matcher argument that selects the series to delete. At least one match[] argument must be provided.
      • start: Start timestamp. Optional and defaults to minimum possible time.
      • end: End timestamp. Optional and defaults to maximum possible time. Not mentioning both start and end times would clear all the data for the matched series in the database.
    • evaluateQueryInstant

      Evaluates instant query

      The following endpoint evaluates an instant query at a single point in time You can URL-encode these parameters directly in the request body by using the POST method and Content-Type: application/x-www-form-urlencoded header. This is useful when specifying a large query that may breach server-side URL character limits. The data section of the query result has the following format ` { "resultType": "matrix" | "vector" | "scalar" | "string", "result": &lt;value&gt; } &lt;value&gt; refers to the query result data, which has varying formats depending on the resultType`. See the [expression query result formats](https://prometheus.io/docs/prometheus/latest/querying/api/#expression-query-result-formats).

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • query: Prometheus expression query string.
      • time: Evaluation timestamp. Optional. The current server time is used if the time parameter is omitted.
      • timeout: Evaluation timeout. Optional. Defaults to and is capped by the value of the -query.timeout flag.
    • evaluateQueryRange

      Evaluates query over range of time.

      The following endpoint evaluates an expression query over a range of time You can URL-encode these parameters directly in the request body by using the POST method and Content-Type: application/x-www-form-urlencoded header. This is useful when specifying a large query that may breach server-side URL character limits. The data section of the query result has the following format ` { "resultType": "matrix", "result": &lt;value&gt; } For the format of the &lt;value&gt;` placeholder, see the [range-vector result format](https://prometheus.io/docs/prometheus/latest/querying/api/#range-vectors).

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • query: Prometheus expression query string.
      • start: Start timestamp.
      • end: End timestamp.
      • step: Query resolution step width in duration format or float number of seconds.
      • timeout: Evaluation timeout. Optional. Defaults to and is capped by the value of the -query.timeout flag.
    • metricMetadataReadResponse

      Returns metric metadata

      It returns metadata about metrics currently scrapped from targets. However, it does not provide any target information. This is considered experimental and might change in the future. The data section of the query result consists of an object where each key is a metric name and each value is a list of unique metadata objects, as exposed for that metric name across all targets.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • limit: Maximum number of metrics to return.
      • metric: A metric name to filter metadata for. All metric metadata is retrieved if left empty.
    • readAlertManagers

      public CompletableFuture<AlertManagerReadResponse> readAlertManagers()
      Returns current alertmanager discovery

      Returns an overview of the current state of the Prometheus alertmanager discovery Both the active and dropped Alertmanagers are part of the response.

    • readAlerts

      public CompletableFuture<AlertReadResponse> readAlerts()
      Returns active alerts

      The /alerts endpoint returns a list of all active alerts. As the /alerts endpoint is fairly new, it does not have the same stability guarantees as the overarching API v1.

    • readLabelNames

      Returns label names

      The following endpoint returns a list of label names. The data section of the JSON response is a list of string label names. **NOTE:** These API endpoints may return metadata for series for which there is no sample within the selected time range, and/or for series whose samples have been marked as deleted via the deletion API endpoint. The exact extent of additionally returned series metadata is an implementation detail that may change in the future.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • start: Start timestamp.
      • end: End timestamp.
      • match: Repeated series selector argument that selects the series from which to read the label values. Optional.
    • readLabelValues

      Returns label values

      The following endpoint returns a list of label values for a provided label name The data section of the JSON response is a list of string label values. **NOTE:** These API endpoints may return metadata for series for which there is no sample within the selected time range, and/or for series whose samples have been marked as deleted via the deletion API endpoint. The exact extent of additionally returned series metadata is an implementation detail that may change in the future.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • labelName: Label name.
      • start: Start timestamp.
      • end: End timestamp.
      • match: Repeated series selector argument that selects the series from which to read the label values.
    • readQueryExemplars

      Returns list of Exemplars

      This is &lt;b&gt;experimental&lt;/b&gt; and might change in the future. The following endpoint returns a list of exemplars for a valid PromQL query for a specific time range

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • query: Prometheus expression query string.
      • start: Start timestamp.
      • end: End timestamp.
    • readRules

      Returns currently loaded rules

      The /rules API endpoint returns a list of alerting and recording rules that are currently loaded. In addition it returns the currently active alerts fired by the Prometheus instance of each alerting rule. As the /rules endpoint is fairly new, it does not have the same stability guarantees as the overarching API v1.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • type: Return only the alerting rules (e.g. type=alert) or the recording rules (e.g. type=record). When the parameter is absent or empty, no filtering is done.
    • readSeries

      Returns time series

      The following endpoint returns the list of time series that match a certain label set. You can URL-encode these parameters directly in the request body by using the POST method and Content-Type: application/x-www-form-urlencoded header. This is useful when specifying a large or dynamic number of series selectors that may breach server-side URL character limits. The data section of the query result consists of a list of objects that contain the label name/value pairs which identify each series.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • match: Repeated series selector argument that selects the series to return. At least one match[] argument must be provided.
      • start: Start timestamp. Optional.
      • end: End timestamp. Optional.
    • readServerBuildInfo

      public CompletableFuture<PrometheusBuildInfoReadResponse> readServerBuildInfo()
      Returns build information

      The following endpoint returns various build information properties about the Prometheus server.

    • readServerConfig

      public CompletableFuture<PrometheusConfigReadResponse> readServerConfig()
      Returns configuration file

      The following endpoint returns currently loaded configuration file The config is returned as dumped YAML file. Due to limitation of the YAML library, YAML comments are not included.

    • readServerFlags

      public CompletableFuture<Void> readServerFlags()
      Returns flag values

      The following endpoint returns flag values that Prometheus was configured with.

    • readServerRuntimeInfo

      public CompletableFuture<RuntimeInfoResponse> readServerRuntimeInfo()
      Returns runtime info

      The following endpoint returns various runtime information properties about the Prometheus server The returned values are of different types, depending on the nature of the runtime property --- **NOTE:** The exact returned runtime properties may change without notice between Prometheus versions. --- New in v2.14

    • readServerTSDBStatus

      public CompletableFuture<TsdbStatusReadResponse> readServerTSDBStatus()
      Returns statistics about TSBD

      The following endpoint returns various cardinality statistics about the Prometheus TSDB Response Data --- **headStats:** This provides the following data about the head block of the TSDB: &gt;**numSeries:** The number of series. **chunkCount:** The number of chunks. **minTime:** The current minimum timestamp in milliseconds. **maxTime:** The current maximum timestamp in milliseconds. **seriesCountByMetricName:** This will provide a list of metrics names and their series count. **labelValueCountByLabelName:** This will provide a list of the label names and their value count. **memoryInBytesByLabelName:** This will provide a list of the label names and memory used in bytes. Memory usage is calculated by adding the length of all values for a given label name. **seriesCountByLabelPair:** This will provide a list of label value pairs and their series count.

    • readServerWALReplayStatus

      public CompletableFuture<WalReplayStatusReadResponse> readServerWALReplayStatus()
      Returns info about WAL replay.

      The following endpoint returns information about the WAL replay Response Data --- **read:** The number of segments replayed so far. **total:** The total number segments needed to be replayed. **progress:** The progress of the replay (0 - 100%). **state:** The state of the replay. **Possible states:** - **waiting:** Waiting for the replay to start. - **in progress:** The replay is in progress. - **done:** The replay has finished. --- **NOTE:** This endpoint is available before the server has been marked ready and is updated in real time to facilitate monitoring the progress of the WAL replay. --- New in v2.28

    • readTargetMetadata

      Returns target metadata

      The following endpoint returns metadata about metrics currently scraped from targets. This is experimental and might change in the future. The data section of the query result consists of a list of objects that contain metric metadata and the target label set.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • matchTarget: Label selectors that match targets by their label sets. All targets are selected if left empty.
      • metric: A metric name to retrieve metadata for. All metric metadata is retrieved if left empty.
      • limit: Maximum number of targets to match.
    • readTargets

      Returns current target discovery.

      Both the active and dropped targets are part of the response by default. labels represents the label set after relabelling has occurred. discoveredLabels represent the unmodified labels retrieved during service discovery before relabelling has occurred.

      Parameter:
      spec - a consumer that creates the payload for this operation. Supports the following properties:
      • state: The state query parameter allows the caller to filter by active or dropped targets, (e.g., state=active, state=dropped, state=any).