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

Commit 6df073f

Browse files
committed
Revert "Add new API metrics-lifecycle-policies (#19) #none"
Signed-off-by: hayk96 <hayko5999@gmail.com>
1 parent ece66d7 commit 6df073f

18 files changed

+9
-680
lines changed

CHANGELOG.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# Changelog
22

3-
## 0.3.0 / 2024-05-26
4-
5-
* [ENHANCEMENT]
6-
Introduced a new API `/metrics-lifecycle-policies` for managing metrics lifecycle in the Prometheus ecosystem. This
7-
flexible API allows users to define policies that specify which time-series should be retained and for how long in the
8-
Prometheus TSDB storage.
9-
* [BUGFIX] fixed description of 404 status code of the `DELETE /api/v1/rules` API in Redocli page.
10-
113
## 0.2.2 / 2024-05-12
124

135
* [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

docs/examples/docker/docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ services:
1111
command:
1212
- --config.file=/etc/prometheus/prometheus.yml
1313
- --web.enable-lifecycle
14-
- --web.enable-admin-api
1514
prometheus-api:
1615
image: hayk96/prometheus-api:latest
1716
container_name: prometheus-api

docs/examples/kubernetes/helm/values.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ server:
1717
readOnly: false
1818
extraFlags:
1919
- web.enable-lifecycle
20-
- web.enable-admin-api
2120
- web.listen-address=:9091
2221
extraVolumeMounts:
2322
- name: storage-volume

main.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from fastapi.middleware.cors import CORSMiddleware
22
from src.utils.arguments import arg_parser
3-
from src.utils.scheduler import schedule
43
from src.api.v1.api import api_router
54
from src.utils.openapi import openapi
65
from src.utils.metrics import metrics
@@ -16,9 +15,9 @@
1615
host, port = args.get("web.listen_address").split(":")
1716

1817
if not all([settings.check_prom_http_connection(prom_addr),
19-
settings.check_reload_api_status(prom_addr),
20-
settings.check_rules_directory(rule_path),
21-
settings.check_fs_permissions(rule_path)]):
18+
settings.check_reload_api_status(prom_addr),
19+
settings.check_rules_directory(rule_path),
20+
settings.check_fs_permissions(rule_path)]):
2221
sys.exit()
2322

2423

@@ -57,5 +56,4 @@ def main():
5756

5857

5958
if __name__ == "__main__":
60-
schedule()
6159
main()

requirements.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
prometheus-fastapi-instrumentator==6.1.0
22
python-json-logger==2.0.7
33
email-validator==2.0.0
4-
APScheduler==3.10.4
5-
pytimeparse2==1.7.1
6-
jsonschema==4.17.3
7-
requests==2.28.2
8-
pydantic==1.10.7
94
fastapi==0.109.0
105
uvicorn==0.21.1
6+
requests==2.28.2
7+
pydantic==1.10.7
118
PyYAML==6.0.1
9+
jsonschema==4.17.3
1210
httpx==0.24.0

src/api/v1/api.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from .. v1.endpoints import reverse_proxy, rules, policies, web
1+
from .. v1.endpoints import reverse_proxy, rules, web
22
from fastapi import APIRouter
33

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

0 commit comments

Comments
 (0)