Prometheus Data Stream Parameters

The Prometheus plugin provides configurable data streams to use PromQL queries to fetch data.

Each configurable data stream exposes a set of parameters that lets you filter the data you retrieve. The following information describes the available configurable data streams and their parameters in detail.

PromQL

Parameter
Description
Query
Enter a PromQL query to return data, for example:
sum by (instance) (rate(kubedns_probe_dnsmasq_latency_ms_sum[1m])) / sum by (instance) (rate(kubedns_probe_dnsmasq_latency_ms_count[1m]))
See the Prometheus documentation for help writing queries.
Query type
Select the query type. Typically, Range queries are used for graphing results but some Instant queries can also return results over a time range:
  • Range: Evaluates over the timeframe at regular intervals.
  • Instant: Evaluates once. Typically this will be at the current time, but may be a past evaluation time if the timeframe is set to the past (for example, last month).
Interval
If Range is selected as the Query type, select the time interval for the query:
  • Automatic (based on timeframe): The interval is selected automatically based on the timeframe. For example, 60 seconds for a timeframe of the last hour, and 1 hour for a timeframe of the last 7 days.
  • Custom: Specify an interval in the Custom interval field. This can be specified as the number of seconds, or a Prometheus time duration (a number followed by s, m, h, d, w or y for seconds, minutes, days, weeks or years).

Simple Query

The simple query data stream lets you configure a query parameters using the data stream parameters, rather than entering one directly.

Depending on the Metric you select to query, different parameters are displayed.

Parameter
Description
Metric
Select a metric. If using the scoped data stream, the available metrics for the objects selected are listed, otherwise all metrics are listed. The list shows the metric name followed by the unit and metric type in brackets.
The remaining parameters depend on the type of metric selected. Prometheus supports four types of metrics- counter, gauge, histogram and summary.

Counter metric configuration

Parameter
Description
Counter query type
Select the type of query:
  • Total count: this uses the PromQL increase function.
  • Rate (per second) over time (typically used for graphing): this uses the PromQL rate function.
Filter by label
Specify a label to filter by then configure the following
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Filter by second label
Specify a second label to filter by then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the second label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Aggregation
Select the type of label aggregation for each timestamp:
  • None (default): No aggregation is applied.
  • Average: Calculates the mean of all values at a given timestamp.
  • Minimum: Selects the smallest value among all data points at the timestamp.
  • Maximum: Selects the largest value among all data points at the timestamp.
  • Sum: Computes the total sum of all values at the timestamp.
  • Top: Specify the top n results to return in the Top/bottom count field.
  • Bottom: Specify the bottom n results to return in the Top/bottom count field.
Group by
Choose which labels to aggregate:
  • None: Aggregates over all labels.
  • Selected labels: Aggregates by the labels you specify in the Labels field.
  • All labels except selected: Aggregates by all labels except the labels you specify in the Labels field.
Interval
If Rate per second over time is selected as the Counter query type, select the time interval for the query:
  • Automatic (based on timeframe): The interval is selected automatically based on the timeframe. For example, 60 seconds for a timeframe of the last hour, and 1 hour for a timeframe of the last 7 days.
  • Custom: Specify an interval in the Custom interval field. This can be specified as the number of seconds, or a Prometheus time duration (a number followed by s, m, h, d, w or y for seconds, minutes, days, weeks or years).

Gauge metric configuration

Parameter
Description
Gauge query type
Select the type of query
  • Single value: Equivalent to a PromQL instant query.
  • Values over time: Equivalent to a PromQL gauge query.
Aggregation over time interval
Select the time-based aggregation. For a single value query this is evaluated over the whole timeframe. For a values over time query this is evaluated over each time interval (step).
  • Latest (most recent, or last value in the timeframe or interval)
  • Average
  • Minimum
  • Maximum
Filter by label
Specify a label to filter by then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Filter by second label
Specify a second label to filter by then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the second label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Aggregation
Select the type of label aggregation for each timestamp:
  • None (default): No aggregation is applied.
  • Average: Calculates the mean of all values at a given timestamp.
  • Minimum: Selects the smallest value among all data points at the timestamp.
  • Maximum: Selects the largest value among all data points at the timestamp.
  • Sum: Computes the total sum of all values at the timestamp.
  • Top: Specify the top n results to return in the Top/bottom count field.
  • Bottom: Specify the bottom n results to return in the Top/bottom count field.
Group by
Choose which labels to aggregate:
  • None: Aggregates over all labels.
  • Selected labels: Aggregates by the labels you specify in the Labels field.
  • All labels except selected: Aggregates by all labels except the labels you specify in the Labels field.
Interval
If Values over time is selected as the Gauge query type, select the time interval for the query:
  • Automatic (based on timeframe): The interval is selected automatically based on the timeframe. For example, 60 seconds for a timeframe of the last hour, and 1 hour for a timeframe of the last 7 days.
  • Custom: Specify an interval in the Custom interval field. This can be specified as the number of seconds, or a Prometheus time duration (a number followed by s, m, h, d, w or y for seconds, minutes, days, weeks or years).

Histogram metric configuration

Parameter
Description
Histogram query type
Select the type of query:
  • Total count of samples
  • Rate per second of samples over time
  • Sample values over time
Aggregation over time interval
If Sample values over time is selected as the query type, choose how to aggregate the individual sample values over each time interval (step):
  • Average: The average value for the time interval.
  • Quantile: Determines the value for which a specified Quantile % of samples are within. For example, specifying 95% calculates the value that 95% of samples are within. The value calculated by Prometheus may be approximate.
Filter by label
Specify a label to filter by, then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Filter by second label
Specify a second label to filter by, then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the second label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Aggregation
Select the type of label aggregation for each timestamp:
  • None (default): No aggregation is applied.
  • Average: Calculates the mean of all values at a given timestamp.
  • Minimum: Selects the smallest value among all data points at the timestamp.
  • Maximum: Selects the largest value among all data points at the timestamp.
  • Sum: Computes the total sum of all values at the timestamp.
  • Top: Specify the top n results to return in the Top/bottom count field.
  • Bottom: Specify the bottom n results to return in the Top/bottom count field.
Group by
Choose which labels to aggregate:
  • None: Aggregates over all labels.
  • Selected labels: Aggregates by the labels you specify in the Labels field.
  • All labels except selected: Aggregates by all labels except the labels you specify in the Labels field.
Interval
If Values over time is selected as the Histogram query type, select the time interval for the query:
  • Automatic (based on timeframe): The interval is selected automatically based on the timeframe. For example, 60 seconds for a timeframe of the last hour, and 1 hour for a timeframe of the last 7 days.
  • Custom: Specify an interval in the Custom interval field. This can be specified as the number of seconds, or a Prometheus time duration (a number followed by s, m, h, d, w or y for seconds, minutes, days, weeks or years).

Summary metric configuration

Parameter
Description
Summary query type
Select the type of query:
  • Rate (per second) of samples over time
  • Sample values over time
  • Total count of samples
Aggregation over time interval
If Sample values over time is selected as the query type, choose how to aggregate the individual sample values over each time interval (step):
  • Average: The average value for the time interval.
  • Quantile: Determines the value for which a specified Quantile % of samples are within. For example, specifying 95% calculates the value that 95% of samples are within. The value calculated by Prometheus may be approximate.
Filter by label
Specify a label to filter by, then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Filter by second label
Specify a second label to filter by, then configure the following:
  1. Exclude values:
    Select this check box is you want to exclude the specified values for the second label from the results, instead of including them.
  2. Values:
    Select the label values to filter. The values will be logical ORed (the label may match any of the values). Regex expressions are supported.
Aggregation
Select the type of label aggregation for each timestamp:
  • None (default): No aggregation is applied.
  • Average: Calculates the mean of all values at a given timestamp.
  • Minimum: Selects the smallest value among all data points at the timestamp.
  • Maximum: Selects the largest value among all data points at the timestamp.
  • Sum: Computes the total sum of all values at the timestamp.
  • Top: Specify the top n results to return in the Top/bottom count field.
  • Bottom: Specify the bottom n results to return in the Top/bottom count field.
Group by
Choose which labels to aggregate:
  • None: Aggregates over all labels.
  • Selected labels: Aggregates by the labels you specify in the Labels field.
  • All labels except selected: Aggregates by all labels except the labels you specify in the Labels field.
Interval
If Values over time is selected as the Summary query type, select the time interval for the query:
  • Automatic (based on timeframe): The interval is selected automatically based on the timeframe. For example, 60 seconds for a timeframe of the last hour, and 1 hour for a timeframe of the last 7 days.
  • Custom: Specify an interval in the Custom interval field. This can be specified as the number of seconds, or a Prometheus time duration (a number followed by s, m, h, d, w or y for seconds, minutes, days, weeks or years).

Was this article helpful?


Have more questions or facing an issue?