Klasse PrometheusHTTPSpecApi

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

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

  • Methodendetails

    • cleanTombstones

      public void cleanTombstones(Consumer<CleanTombstonesOperationSpec> spec)
      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.

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • createSnapshot

      Creates Snapshot of current data

      Snapshot creates a snapshot of all current data into "snapshots/{datetime}-{rand}" 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 takes a spec to prepare the request for execution
    • deleteSeries

      public void deleteSeries(Consumer<DeleteSeriesOperationSpec> spec)
      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 takes a spec to prepare the request for execution
    • 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": {value} } " "{value}" 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 takes a spec to prepare the request for execution
    • evaluateQueryRange

      public ResponseQueryRange evaluateQueryRange(Consumer<EvaluateQueryRangeOperationSpec> spec)
      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": {value} } " For the format of the "{value}" placeholder, see the [range-vector result format](https://prometheus.io/docs/prometheus/latest/querying/api/#range-vectors).

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • metricMetadataReadResponse

      public MetadataReadResponse metricMetadataReadResponse(Consumer<MetricMetadataReadResponseOperationSpec> spec)
      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 takes a spec to prepare the request for execution
    • 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.

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • 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.

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • 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 takes a spec to prepare the request for execution
    • 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 takes a spec to prepare the request for execution
    • readQueryExemplars

      Returns list of Exemplars

      This is {b}experimental{/b} 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 takes a spec to prepare the request for execution
    • 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 takes a spec to prepare the request for execution
    • 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 takes a spec to prepare the request for execution
    • readServerBuildInfo

      Returns build information

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

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • 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.

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • readServerFlags

      public void readServerFlags(Consumer<ReadServerFlagsOperationSpec> spec)
      Returns flag values

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

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • readServerRuntimeInfo

      public RuntimeInfoResponse readServerRuntimeInfo(Consumer<ReadServerRuntimeInfoOperationSpec> spec)
      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

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • readServerTSDBStatus

      public TsdbStatus readServerTSDBStatus(Consumer<ReadServerTSDBStatusOperationSpec> spec)
      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: }**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.

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • 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

      Parameter:
      spec - a consumer that takes a spec to prepare the request for execution
    • readTargetMetadata

      public List<MetricMetadata> readTargetMetadata(Consumer<ReadTargetMetadataOperationSpec> spec)
      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 takes a spec to prepare the request for execution
    • 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 takes a spec to prepare the request for execution