Skip to content

Commit

Permalink
feat(VictoriaMetricsDiscovery): set correct url for cluster version
Browse files Browse the repository at this point in the history
  • Loading branch information
chicocvenancio committed Dec 8, 2023
1 parent 34974bf commit 7527ad6
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ def find_metrics_url(self, *, api_client: Optional[ApiClient] = None) -> Optiona
Returns:
Optional[str]: The discovered Victoria Metrics URL, or None if not found.
"""
return super().find_url(
url = super().find_url(
selectors=[
"app.kubernetes.io/name=vmsingle",
"app.kubernetes.io/name=victoria-metrics-single",
"app.kubernetes.io/name=vmselect",
"app=vmselect",
]
)
if url is None:
url = super().find_url(
selectors=[
"app.kubernetes.io/name=vmselect",
"app=vmselect",
]
)
url = f"{url}/select/0/prometheus/"
return url


class VictoriaMetricsService(PrometheusMetricsService):
Expand Down

0 comments on commit 7527ad6

Please sign in to comment.