Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Revert "Add new API metrics-lifecycle-policies" #20

Merged
merged 1 commit into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Changelog

## 0.3.0 / 2024-05-26

* [ENHANCEMENT]
Introduced a new API `/metrics-lifecycle-policies` for managing metrics lifecycle in the Prometheus ecosystem. This
flexible API allows users to define policies that specify which time-series should be retained and for how long in the
Prometheus TSDB storage.
* [BUGFIX] fixed description of 404 status code of the `DELETE /api/v1/rules` API in Redocli page.

## 0.2.2 / 2024-05-12

* [REVERT] Reverted schema validation mechanism of rules API. Use local schema validation instead of remote which was introduces in [v0.1.2](https://github.com/hayk96/prometheus-api/releases/tag/v0.1.2). #18
Expand Down
1 change: 0 additions & 1 deletion docs/examples/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services:
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
- --web.enable-admin-api
prometheus-api:
image: hayk96/prometheus-api:latest
container_name: prometheus-api
Expand Down
1 change: 0 additions & 1 deletion docs/examples/kubernetes/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ server:
readOnly: false
extraFlags:
- web.enable-lifecycle
- web.enable-admin-api
- web.listen-address=:9091
extraVolumeMounts:
- name: storage-volume
Expand Down
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from fastapi.middleware.cors import CORSMiddleware
from src.utils.arguments import arg_parser
from src.utils.scheduler import schedule
from src.api.v1.api import api_router
from src.utils.openapi import openapi
from src.utils.metrics import metrics
Expand All @@ -16,9 +15,9 @@
host, port = args.get("web.listen_address").split(":")

if not all([settings.check_prom_http_connection(prom_addr),
settings.check_reload_api_status(prom_addr),
settings.check_rules_directory(rule_path),
settings.check_fs_permissions(rule_path)]):
settings.check_reload_api_status(prom_addr),
settings.check_rules_directory(rule_path),
settings.check_fs_permissions(rule_path)]):
sys.exit()


Expand Down Expand Up @@ -57,5 +56,4 @@ def main():


if __name__ == "__main__":
schedule()
main()
8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
prometheus-fastapi-instrumentator==6.1.0
python-json-logger==2.0.7
email-validator==2.0.0
APScheduler==3.10.4
pytimeparse2==1.7.1
jsonschema==4.17.3
requests==2.28.2
pydantic==1.10.7
fastapi==0.109.0
uvicorn==0.21.1
requests==2.28.2
pydantic==1.10.7
PyYAML==6.0.1
jsonschema==4.17.3
httpx==0.24.0
3 changes: 1 addition & 2 deletions src/api/v1/api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from .. v1.endpoints import reverse_proxy, rules, policies, web
from .. v1.endpoints import reverse_proxy, rules, web
from fastapi import APIRouter

api_router = APIRouter()
api_router.include_router(rules.router, prefix="/api/v1")
api_router.include_router(policies.router, prefix="/api/v1")
api_router.include_router(web.router, prefix="")
api_router.add_route("/{path:path}", reverse_proxy._reverse_proxy, ["GET", "POST", "PUT"])
Loading
Loading