|
8 | 8 | from typing import Any |
9 | 9 |
|
10 | 10 | from app.config import get_tracer_base_url |
| 11 | +from app.integrations.airflow import ( |
| 12 | + DEFAULT_AIRFLOW_BASE_URL, |
| 13 | + airflow_config_from_env, |
| 14 | + build_airflow_config, |
| 15 | +) |
11 | 16 | from app.integrations.azure_sql import build_azure_sql_config |
12 | 17 | from app.integrations.github_mcp import build_github_mcp_config |
13 | 18 | from app.integrations.gitlab import DEFAULT_GITLAB_BASE_URL, build_gitlab_config |
|
79 | 84 | "opensearch": "opensearch", |
80 | 85 | "open search": "opensearch", |
81 | 86 | "alertmanager": "alertmanager", |
| 87 | + "airflow": "airflow", |
| 88 | + "apache airflow": "airflow", |
82 | 89 | } |
83 | 90 |
|
84 | 91 |
|
@@ -558,6 +565,30 @@ def _classify_service_instance( |
558 | 565 | }, "rabbitmq" |
559 | 566 | return None, None |
560 | 567 |
|
| 568 | + if key == "airflow": |
| 569 | + try: |
| 570 | + airflow_config = build_airflow_config( |
| 571 | + { |
| 572 | + "base_url": credentials.get("base_url", DEFAULT_AIRFLOW_BASE_URL), |
| 573 | + "username": credentials.get("username", ""), |
| 574 | + "password": credentials.get("password", ""), |
| 575 | + "auth_token": credentials.get("auth_token", ""), |
| 576 | + "timeout_seconds": credentials.get("timeout_seconds", 15.0), |
| 577 | + "verify_ssl": credentials.get("verify_ssl", True), |
| 578 | + "max_results": credentials.get("max_results", 50), |
| 579 | + } |
| 580 | + ) |
| 581 | + except Exception: |
| 582 | + return None, None |
| 583 | + |
| 584 | + if airflow_config.is_configured: |
| 585 | + return { |
| 586 | + **airflow_config.model_dump(), |
| 587 | + "integration_id": record_id, |
| 588 | + }, "airflow" |
| 589 | + |
| 590 | + return None, None |
| 591 | + |
561 | 592 | if key == "azure_sql": |
562 | 593 | try: |
563 | 594 | azure_sql_config = build_azure_sql_config( |
@@ -1087,6 +1118,17 @@ def load_env_integrations() -> list[dict[str, Any]]: |
1087 | 1118 | } |
1088 | 1119 | ) |
1089 | 1120 |
|
| 1121 | + airflow_config = airflow_config_from_env() |
| 1122 | + if airflow_config is not None: |
| 1123 | + integrations.append( |
| 1124 | + { |
| 1125 | + "id": "env-airflow", |
| 1126 | + "service": "airflow", |
| 1127 | + "status": "active", |
| 1128 | + "credentials": airflow_config.model_dump(exclude={"integration_id"}), |
| 1129 | + } |
| 1130 | + ) |
| 1131 | + |
1090 | 1132 | atlas_pub = os.getenv("MONGODB_ATLAS_PUBLIC_KEY", "").strip() |
1091 | 1133 | atlas_priv = os.getenv("MONGODB_ATLAS_PRIVATE_KEY", "").strip() |
1092 | 1134 | atlas_project = os.getenv("MONGODB_ATLAS_PROJECT_ID", "").strip() |
|
0 commit comments