diff --git a/CHANGELOG.md b/CHANGELOG.md index 72fb870..c0812a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.3.1 / 2024-06-01 + +* [ENHANCEMENT] Added a new webpage, Metrics Management, based on the `/metrics-lifecycle-policies` API. This feature allows +for directly defining and managing policies for retaining Prometheus metrics. #23 +* [ENHANCEMENT] Added support for dark mode on the Rules Management page. #16 +* [ENHANCEMENT] Added support of filtering of rules by their type from the UI. #15 + ## 0.3.0 / 2024-05-26 * [ENHANCEMENT] diff --git a/src/api/v1/endpoints/web.py b/src/api/v1/endpoints/web.py index 71b06ef..1b2d844 100644 --- a/src/api/v1/endpoints/web.py +++ b/src/api/v1/endpoints/web.py @@ -9,6 +9,7 @@ if arg_parser().get("web.enable_ui") == "true": rules_management = "ui/rules-management" + metrics_management = "ui/metrics-management" logger.info("Starting web management UI") @router.get("/", response_class=HTMLResponse, @@ -38,3 +39,25 @@ async def rules_management_files(path, request: Request): "method": request.method, "request_path": request.url.path}) return f"{sts} {msg}" + + @router.get("/metrics-management", + description="RRenders metrics management HTML page of this application", + include_in_schema=False) + async def metrics_management_page(): + return FileResponse(f"{metrics_management}/index.html") + + @router.get( + "/metrics-management/{path}", + description="Returns JavaScript and CSS files of the metrics management page", + include_in_schema=False) + async def metrics_management_files(path, request: Request): + if path in ["script.js", "style.css"]: + return FileResponse(f"{metrics_management}/{path}") + sts, msg = "404", "Not Found" + logger.info( + msg=msg, + extra={ + "status": sts, + "method": request.method, + "request_path": request.url.path}) + return f"{sts} {msg}" diff --git a/src/utils/openapi.py b/src/utils/openapi.py index b75645b..d8cd58e 100644 --- a/src/utils/openapi.py +++ b/src/utils/openapi.py @@ -16,7 +16,7 @@ def openapi(app: FastAPI): "providing additional features and addressing its limitations. " "Running as a sidecar alongside the Prometheus server enables " "users to extend the capabilities of the API.", - version="0.3.0", + version="0.3.1", contact={ "name": "Hayk Davtyan", "url": "https://hayk96.github.io", diff --git a/ui/homepage/index.html b/ui/homepage/index.html index ca8c482..69127a9 100644 --- a/ui/homepage/index.html +++ b/ui/homepage/index.html @@ -168,6 +168,7 @@
diff --git a/ui/metrics-management/index.html b/ui/metrics-management/index.html new file mode 100644 index 0000000..fe7e5ba --- /dev/null +++ b/ui/metrics-management/index.html @@ -0,0 +1,67 @@ + + +
+ + +
+ + +
+