summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoravi robusta <avi@robusta.dev>2023-06-14 13:09:41 +0300
committeravi robusta <avi@robusta.dev>2023-06-14 13:09:41 +0300
commit44e8ba28e75c8ac0ec8d2b5a16f8cef0d0c7a31c (patch)
tree097719e016fd204a68f7f8d39c001dd7d464139d
parentb941fd20d1acf03f03235deb72ce07dcb6474207 (diff)
made the label not optional and look up label for cluster names
-rw-r--r--robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py2
-rw-r--r--robusta_krr/core/models/config.py2
-rw-r--r--robusta_krr/main.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py b/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py
index 4f1c6f2..382e887 100644
--- a/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py
+++ b/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py
@@ -160,7 +160,7 @@ class PrometheusMetricsService(MetricsService):
)
def get_cluster_names(self) -> Optional[List[str]]:
- return self.prometheus.get_label_values(label_name="cluster")
+ return self.prometheus.get_label_values(label_name=self.config.prometheus_label)
async def gather_data(
self,
diff --git a/robusta_krr/core/models/config.py b/robusta_krr/core/models/config.py
index 22a5d41..8f1efc4 100644
--- a/robusta_krr/core/models/config.py
+++ b/robusta_krr/core/models/config.py
@@ -26,7 +26,7 @@ class Config(pd.BaseSettings):
prometheus_auth_header: Optional[str] = pd.Field(None)
prometheus_ssl_enabled: bool = pd.Field(False)
prometheus_cluster_label: Optional[str] = pd.Field(None)
- prometheus_label: Optional[str] = pd.Field(None)
+ prometheus_label: str = pd.Field("cluster")
# Logging Settings
format: str
diff --git a/robusta_krr/main.py b/robusta_krr/main.py
index 968557a..7dad828 100644
--- a/robusta_krr/main.py
+++ b/robusta_krr/main.py
@@ -98,7 +98,7 @@ def load_commands() -> None:
help="The label in prometheus for your cluster.(Only relevant for centralized prometheus)",
rich_help_panel="Prometheus Settings",
),
- prometheus_label: Optional[str] = typer.Option(
+ prometheus_label: str = typer.Option(
'cluster',
"--prometheus-label",
help="The label in prometheus used to differentiate clusters. (Only relevant for centralized prometheus)",