Download OpenAPI specification:Download
This project enhances the native Prometheus HTTP API by providing additional features and addressing its limitations. Running as a sidecar alongside the Prometheus server enables users to extend the capabilities of the API.
Creates a new rule with a randomly generated filename
file | string (File) Default: "" |
data | object (Data) Default: {} |
Creates Prometheus recording rule with the name ExampleRecordingRule
{- "data": {
- "groups": [
- {
- "name": "ExampleRecordingRule",
- "rules": [
- {
- "record": "code:prometheus_http_requests_total:sum",
- "expr": "sum by (code) (prometheus_http_requests_total)"
}
]
}
]
}
}
[- {
- "status": "success",
- "file": "example-rule.yml",
- "message": "The rule was created successfully"
}
]
Creates a new rule file with the provided filename
file required | string (File) |
recreate | string (Recreate) Default: "false" |
file | string (File) Default: "" |
data | object (Data) Default: {} |
Creates Prometheus recording rule with the name ExampleRecordingRule
{- "data": {
- "groups": [
- {
- "name": "ExampleRecordingRule",
- "rules": [
- {
- "record": "code:prometheus_http_requests_total:sum",
- "expr": "sum by (code) (prometheus_http_requests_total)"
}
]
}
]
}
}
[- {
- "status": "success",
- "message": "The rule was created successfully"
}
]
Exports data from Prometheus based on the provided PromQL
format | string (Format) Default: "csv" |
expr required | string (Expr) |
start | string (Start) |
end | string (End) |
step | string (Step) |
timestamp_format | string (Timestamp Format) Default: "unix" |
replace_fields | object (Replace Fields) Default: {} |
Count of successful logins by users per hour in a day
{- "expr": "users_login_count{status='success'}",
- "start": "2024-01-30T00:00:00Z",
- "end": "2024-01-31T23:59:59Z",
- "step": "1h"
}
null
Returns metrics lifecycle policy that match the provided name parameter
name required | string (Name) |
[- {
- "match": "{__name__=~'go_.*'}",
- "keep_for": "7d",
- "description": "This metrics lifecycle policy keeps GoLang metrics for 7 days"
}
]
Updates specific metrics lifecycle policy
name required | string (Name) |
pattern | string (Pattern) |
keep_for | string (Keep For) |
description | string (Description) |
Updates keep_for
setting only
{- "keep_for": "10d"
}
[- {
- "status": "success",
- "message": "Policy updated successfully"
}
]
[- {
- "GoLang Policy": {
- "match": "{__name__=~'go_.*'}",
- "keep_for": "7d",
- "message": "This policy keeps GoLang metrics for 7 days"
}, - "Kubernetes Policy": {
- "match": "{job='kubernetes-pods'}",
- "keep_for": "10d",
- "message": "This policy keeps series of job 'kubernetes-pods' for 10 days"
}
}
]
Creates a new metrics lifecycle policy
name required | string (Name) |
match required | string (Match) |
keep_for required | string (Keep For) |
description | string (Description) |
Time-series matching with regex will be kept for 7 days
{- "name": "Example Policy",
- "match": "{__name__=~'go_.*'}",
- "keep_for": "7d",
- "description": "Time-series matching with regex will be kept for 7 days."
}
[- {
- "status": "success",
- "policy_name": "GoLang Metrics Policy",
- "message": "Policy created successfully"
}
]
Get Prometheus configuration in various formats depending on the Content-Type
request header
{- "global": {
- "scrape_interval": "15s",
- "scrape_timeout": "10s",
- "evaluation_interval": "30s"
}, - "scrape_configs": [
- {
- "job_name": "prometheus",
- "scrape_interval": "15s",
- "scrape_timeout": "10s",
- "metrics_path": "/metrics",
- "scheme": "http",
- "static_configs": [
- {
- "targets": [
- "localhost:9090"
]
}
]
}
]
}
Update entire Prometheus configuration file
object (Global) The global configuration specifies parameters that are valid in all other configuration contexts. They also serve as defaults for other configuration sections. | |
object (RuntimeConfig) | |
rule_files | Array of strings (Rule Files) Rule files specifies a list of globs. Rules and alerts are read from all matching files. |
scrape_config_files | Array of strings (Scrape Config Files) Scrape config files specifies a list of globs. Scrape configs are read from all matching files and appended to the list of scrape configs. |
Array of objects (Scrape Configs) A list of scrape configurations. | |
object (Alerting) Alerting specifies settings related to the Alertmanager. | |
Array of objects (Remote Write) Settings related to the remote write feature. | |
Array of objects (Remote Read) Settings related to the remote read feature. | |
object (Storage) Storage related settings that are runtime reloadable. | |
object (Tracing) Configures exporting traces. |
Update entire Prometheus configuration file
{- "global": {
- "scrape_interval": "30s",
- "scrape_timeout": "30s",
- "evaluation_interval": "1m"
}, - "scrape_configs": [
- {
- "job_name": "prometheus",
- "metrics_path": "/metrics",
- "scheme": "http",
- "static_configs": [
- {
- "targets": [
- "localhost:9090"
], - "labels": {
- "instance": "prometheus-server",
- "env:": "production"
}
}
]
}
]
}
[- {
- "status": "success",
- "message": "Configuration updated successfully"
}
]
Update specific part of Prometheus configuration file
object (Global) The global configuration specifies parameters that are valid in all other configuration contexts. They also serve as defaults for other configuration sections. | |
object (RuntimeConfig) | |
rule_files | Array of strings (Rule Files) Rule files specifies a list of globs. Rules and alerts are read from all matching files. |
scrape_config_files | Array of strings (Scrape Config Files) Scrape config files specifies a list of globs. Scrape configs are read from all matching files and appended to the list of scrape configs. |
Array of objects (Scrape Configs) A list of scrape configurations. | |
object (Alerting) Alerting specifies settings related to the Alertmanager. | |
Array of objects (Remote Write) Settings related to the remote write feature. | |
Array of objects (Remote Read) Settings related to the remote read feature. | |
object (Storage) Storage related settings that are runtime reloadable. | |
object (Tracing) Configures exporting traces. |
Update Alertmanager configuration settings
{- "alerting": {
- "alertmanagers": [
- {
- "scheme": "https",
- "static_configs": [
- {
- "targets": [
- "example-alertmanager.com"
]
}
]
}
]
}
}
[- {
- "status": "success",
- "message": "Configuration updated successfully"
}
]