feat: Prometheus connector - #512
Draft
OlivierTrudeau wants to merge 17 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| logger.warning("[PROMETHEUS] Failed to clean up secrets during disconnect") | ||
| return jsonify({"success": False, "error": "Failed to delete stored credentials"}), 500 | ||
|
|
||
| logger.info("[PROMETHEUS] Disconnected user %s (deleted %d token rows)", user_id, deleted) |
| timeout=PROMETHEUS_TIMEOUT, | ||
| ) | ||
| except ValueError as exc: | ||
| return jsonify({"error": str(exc)}), 400 |
| build_info = client.validate_connection() | ||
| except PrometheusAPIError as exc: | ||
| logger.warning("[PROMETHEUS] Validation failed for user %s: %s", user_id, exc) | ||
| return jsonify({"error": f"Failed to connect to Prometheus: {exc}"}), 400 |
| logger.info("[PROMETHEUS] Alertmanager validated at %s for user %s", sanitize(alertmanager_url), sanitize(user_id)) | ||
| except (AMError, Exception) as exc: | ||
| logger.warning("[PROMETHEUS] Alertmanager validation failed for user %s: %s", user_id, exc) | ||
| return jsonify({"error": f"Prometheus connected, but cannot reach Alertmanager at {alertmanager_url}: {exc}"}), 400 |
OlivierTrudeau
force-pushed
the
prometheus
branch
from
June 16, 2026 15:25
c71ee5d to
2e4c46d
Compare
| # --- Prometheus Integration Routes --- | ||
| from routes.prometheus import bp as prometheus_bp # noqa: F401 | ||
| app.register_blueprint(prometheus_bp, url_prefix="/prometheus") | ||
| from routes.prometheus import tasks as _prometheus_tasks # noqa: F401 |
|
| import base64 | ||
| import logging | ||
| import time | ||
| from typing import Any, Dict, List, Optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds a Prometheus/VictoriaMetrics connector to Aurora — supports connecting to any Prometheus-compatible TSDB, ingesting Alertmanager webhooks for incident correlation, and on-demand PromQL querying via the AI agent.
Tested
testuser:testpass123Bearer aurora-test-token-2026X-Prometheus-Key: x-prometheus-secret-key-123136.109.73.175)/api/v1/status/buildinfoNot yet tested
Not covered (out of scope for v1)
Made with Cursor