Table: prometheus_series - Query Prometheus Time Series Data using SQL
Prometheus is an open-source system monitoring and alerting toolkit that collects and stores its metrics as time series data, i.e., metrics information that is output at a regular interval. This includes various system metrics such as CPU usage, memory utilization, disk I/O, network traffic, etc. It provides a multidimensional data model with time series data identified by metric name and key-value pairs.
Table Usage Guide
The prometheus_series
table provides insights into time series data within Prometheus. As a System Administrator or DevOps engineer, you can explore specific metrics details through this table, including the metric name, labels, and timestamp. Utilize it to uncover information about system performance over time, identify trends, and aid in capacity planning.
Examples
List all current prometheus_http_requests_total series
Explore the current series of Prometheus HTTP requests to understand the volume and nature of web traffic. This can be useful in monitoring server performance and identifying potential issues or areas for optimization.
select *from prometheus_serieswhere query = 'prometheus_http_requests_total';
select *from prometheus_serieswhere query = 'prometheus_http_requests_total';
List all prometheus_http_requests_total series present 24 hours ago
Explore the total number of HTTP requests made to your Prometheus server 24 hours ago. This can help in identifying any unusual spikes or drops in traffic, assisting in network monitoring and troubleshooting.
select *from prometheus_serieswhere query = 'prometheus_http_requests_total' and timestamp = now() - interval '24 hrs';
select *from prometheus_serieswhere query = 'prometheus_http_requests_total' and timestamp = datetime('now', '-24 hours');
List all prometheus_http_requests_total series for /metrics present 24 hours ago
Analyze the settings to understand the total number of HTTP requests made to the '/metrics' handler in Prometheus, exactly 24 hours ago. This can help in monitoring traffic patterns and identifying possible issues or anomalies in request volume.
select *from prometheus_serieswhere query = 'prometheus_http_requests_total{handler="/metrics"}' and timestamp = now() - interval '24 hrs';
select *from prometheus_serieswhere query = 'prometheus_http_requests_total{handler="/metrics"}' and timestamp = datetime('now', '-24 hours');
List all prometheus_http_requests_total series on 31st Oct 2021
Explore the total number of HTTP requests recorded by Prometheus on October 31st, 2021. This can help in analyzing the web traffic patterns and server load on that specific day.
select *from prometheus_serieswhere query = 'prometheus_http_requests_total' and timestamp > '2021-10-31' and timestamp < '2021-11-01';
select *from prometheus_serieswhere query = 'prometheus_http_requests_total' and timestamp > '2021-10-31' and timestamp < '2021-11-01';
Schema for prometheus_series
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
metric | jsonb | Metric details for the series. | |
name | text | Name of the metric for the series. | |
query | text | Query used to match the series. | |
sp_connection_name | text | Steampipe connection name. | |
sp_ctx | jsonb | Steampipe context in JSON form. | |
timestamp | timestamp with time zone | Timestamp when the series was found. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- prometheus
You can pass the configuration to the command with the --config
argument:
steampipe_export_prometheus --config '<your_config>' prometheus_series