Rundeck Metrics Exporter for Prometheus
100K+

Dashboard example can be found in: examples/grafana
This exporter uses the prometheus_client and requests Python module to expose Rundeck metrics found in:
Where version represents the Rundeck API version, like: 31,32,33,34,etc.
This code was tested on Rundeck API version 31+.
Warning
Since version 4.x.x, the
/api/<version>/metricsendpoint is disabled, so you need to enable it inrundeck-config.propertiesor by setting the environment variableRUNDECK_METRICS_ENABLED=truefor the exporter to work. See config-file-reference.html#metrics-capturingIf audit logs are enabled, consider changing the default
INFOlog level to prevent excessive log growth.
All metrics are exported with rundeck_ prefix.
More detailed information about the metrics can be found in Documentations
Although the
requirements.txtfile is still available, the project uses UV for Python package and management, which is highly recommended.
Python 3.10+
A Rundeck token with permissions to make API requests
The following steps for installing the dependencies:
uv sync
Or:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Rundeck token or username and password are required.
The token (RUNDECK_TOKEN) or password (RUNDECK_USERPASSWORD) must be passed as environment variables to work.
The ACL associated with the token/user must have the following policy rules as a minimum:
system:read (system context)project:read (system context)events:read (project context)Example ACL Policy allowing a user named exporter to get system metrics as well as execution metrics for any project:
by:
username: exporter
description: system:read
for:
resource:
- allow:
- read
equals:
kind: system
context:
application: rundeck
---
by:
username: exporter
description: project:read
for:
project:
- allow:
- read
match:
name: .*
context:
application: rundeck
---
by:
username: exporter
description: events:read
for:
resource:
- allow:
- read
equals:
kind: event
job:
- allow:
- read
- view
context:
project: .*
---
by:
username: exporter
description: Allow [read] for node
for:
node:
- allow:
- read
match:
nodename: .*
context:
project: .*
---
by:
username: exporter
description: Allow [read] for (All) node
for:
resource:
- allow:
- read
equals:
kind: node
context:
project: .*
The rundeck_exporter supports the following paramenters:
$ rundeck_exporter --help
usage: rundeck_exporter [-h] [--debug] [-v] [--host RUNDECK_EXPORTER_HOST] [--port RUNDECK_EXPORTER_PORT] [--no_checks_in_passive_mode] [--threadpool_max_workers RUNDECK_EXPORTER_THREADPOOL_MAX_WORKERS] [--rundeck.requests.timeout RUNDECK_EXPORTER_REQUESTS_TIMEOUT] [--rundeck.url RUNDECK_URL] [--rundeck.skip_ssl] [--rundeck.api.version RUNDECK_API_VERSION]
[--rundeck.username RUNDECK_USERNAME] [--rundeck.projects.executions] [--rundeck.projects.executions.filter RUNDECK_PROJECT_EXECUTIONS_FILTER] [--rundeck.projects.executions.limit RUNDECK_PROJECTS_EXECUTIONS_LIMIT] [--rundeck.projects.executions.cache] [--rundeck.projects.filter RUNDECK_PROJECTS_FILTER [RUNDECK_PROJECTS_FILTER ...]]
[--rundeck.projects.nodes.info] [--rundeck.cached.requests.ttl RUNDECK_CACHED_REQUESTS_TTL] [--rundeck.cpu.stats] [--rundeck.memory.stats]
Rundeck Metrics Exporter
required environment vars:
RUNDECK_TOKEN Rundeck API Token
RUNDECK_USERPASSWORD Rundeck User Password (RUNDECK_USERNAME or --rundeck.username are required too)
options:
-h, --help show this help message and exit
--debug Enable debug mode
-v, --version Shows rundeck_exporter current release version
--host RUNDECK_EXPORTER_HOST
Host binding address. Default: 127.0.0.1
--port RUNDECK_EXPORTER_PORT
Host binding port. Default: 9620
--no_checks_in_passive_mode
The rundeck_exporter will not perform any checks while the Rundeck host is in passive execution mode
--threadpool_max_workers RUNDECK_EXPORTER_THREADPOOL_MAX_WORKERS
The maximum number of workers in the threadpool to run rundeck_exporter asynchronous checks. Defaults to (number of CPUs) + 4
--rundeck.requests.timeout RUNDECK_EXPORTER_REQUESTS_TIMEOUT
The maximum number of seconds that requests to the Rundeck API should timeout
--rundeck.url RUNDECK_URL
Rundeck Base URL [ REQUIRED ]
--rundeck.skip_ssl Rundeck Skip SSL Cert Validate
--rundeck.api.version RUNDECK_API_VERSION
Defaults to 34
--rundeck.username RUNDECK_USERNAME
Rundeck User with access to the system information
--rundeck.projects.executions
Get projects executions metrics
--rundeck.projects.executions.filter RUNDECK_PROJECT_EXECUTIONS_FILTER
Get the latest project executions filtered by time period Can be in: [s]: seconds, [n]: minutes, [h]: hour, [d]: day, [w]: week, [m]: month, [y]: year Defaults to 5n
--rundeck.projects.executions.limit RUNDECK_PROJECTS_EXECUTIONS_LIMIT
Project executions max results per query. Defaults to 20
--rundeck.projects.executions.cache
Cache requests for project executions metrics query
--rundeck.projects.filter RUNDECK_PROJECTS_FILTER [RUNDECK_PROJECTS_FILTER ...]
Get executions only from listed projects (delimiter = space)
--rundeck.projects.nodes.info
Display Rundeck projects nodes info metrics, currently only the `rundeck_project_nodes_total` metric is available. May cause high CPU load depending on the number of projects
--rundeck.cached.requests.ttl RUNDECK_CACHED_REQUESTS_TTL
Rundeck cached requests expiration time. Defaults to 120
--rundeck.cpu.stats Show Rundeck CPU usage stats
--rundeck.memory.stats
Show Rundeck memory usage stats
Optionally, it's possible to pass the following environment variables to the rundeck_exporter:
| Variable | Options | Description |
|---|---|---|
| RUNDECK_EXPORTER_DEBUG |
| Enable debug mode |
| RUNDECK_EXPORTER_HOST | Default: 127.0.0.1 | Binding address |
| RUNDECK_EXPORTER_PORT | Default: 9620 | Binding port |
| RUNDECK_URL (required) | Rundeck base URL | |
| RUNDECK_TOKEN (required) | Rundeck access token | |
| RUNDECK_USERNAME | Rundeck User with access to the system information | |
| RUNDECK_USERPASSWORD | Rundeck User Password (RUNDECK_USERNAME or --rundeck.username are required too) | |
| RUNDECK_API_VERSION | Default: 41 | Rundeck API version |
| RUNDECK_SKIP_SSL |
| Skip SSL certificate check |
| RUNDECK_PROJECTS_EXECUTIONS |
| Get projects executions metrics |
| RUNDECK_PROJECTS_FILTER | Get executions only from listed projects e.g. "project-1 project-2 ..." | |
| RUNDECK_PROJECT_EXECUTIONS_FILTER | Default: 5n | Project executions filter by a period of time. Can be in: [s]: seconds, [n]: minutes, [h]: hour, [d]: day, [w]: week, [m]: month, [y]: year |
| RUNDECK_PROJECTS_EXECUTIONS_LIMIT | Default: 20 | Projects executions max results per query |
| RUNDECK_PROJECTS_EXECUTIONS_CACHE |
| Cache requests for project executions metrics query |
| RUNDECK_PROJECTS_NODES_INFO |
| Display Rundeck projects nodes info metrics, currently only the rundeck_project_nodes_total metric is available. May cause high CPU load depending on the number of projects |
| RUNDECK_CACHED_REQUESTS_TTL | Default: 120 | Rundeck cached requests expiration time |
| RUNDECK_CPU_STATS |
| Show Rundeck CPU usage stats |
| RUNDECK_MEMORY_STATS |
| Show Rundeck memory usage stats |
| RUNDECK_EXPORTER_NO_CHECKS_IN_PASSIVE_MODE |
| The rundeck_exporter will not perform any checks while the Rundeck host is in passive execution mode |
| RUNDECK_EXPORTER_THREADPOOL_MAX_WORKERS | Default: (number of CPUs) + 4 | The maximum number of workers in the threadpool to run rundeck_exporter asynchronous checks |
| RUNDECK_EXPORTER_REQUESTS_TIMEOUT | Default: 30 | The maximum number of seconds that requests to the Rundeck API should timeout |
$ RUNDECK_TOKEN=xxxxxxxx uv run rundeck_exporter \
--host=0.0.0.0 \
--rundeck.url=http://localhost:4440 \
--rundeck.skip_ssl \
--rundeck.cpu.stats \
--rundeck.memory.stats \
--rundeck.projects.filter="project-1 project-2 project-n" \
--rundeck.projects.executions \
--rundeck.projects.executions.filter=5n \
--rundeck.requests.timeout=10
pip install rundeck-exporter
rundeck_exporter -v
docker build -t rundeck-exporter .
docker run --rm -d -p 9620:9620 -e RUNDECK_TOKEN=$RUNDECK_TOKEN rundeck-exporter \
--host 0.0.0.0 \
--rundeck.url https://rundeck.test.com \
--rundeck.skip_ssl
cd examples/docker-compose
docker compose up -d
Docker Compose services:
After provisioning of the docker-compose services, access Rundeck from http://localhost:4440/user/profile and gerate a new API token. Place the token at RUNDECK_TOKEN environment variable in the docker-compose.yml and run docker compose up -d again.
Content type
Image
Digest
sha256:519c8b979…
Size
17.5 MB
Last updated
5 days ago
docker pull phsmith/rundeck-exporter