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"
}
]