-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from robusta-dev/prometheus_resolution
Prometheus resolution
- Loading branch information
Showing
8 changed files
with
37 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Uninstalling Robusta | ||
##################### | ||
|
||
Everything Robusta installs is placed in the ``robusta`` namespace. To delete Robusta, just delete that namespace. | ||
Everything Robusta installs is placed in the ``robusta`` namespace. To delete Robusta, just delete that namespace. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
import logging | ||
|
||
from ...utils.service_discovery import find_service_url | ||
|
||
|
||
def find_prometheus_url(): | ||
""" | ||
Try to autodiscover the url of an in-cluster grafana service | ||
""" | ||
return find_service_url("app=kube-prometheus-stack-prometheus") | ||
class PrometheusDiscovery: | ||
prometheus_url = None | ||
@classmethod | ||
def find_prometheus_url(cls): | ||
""" | ||
Try to autodiscover the url of an in-cluster grafana service | ||
""" | ||
if cls.prometheus_url: | ||
return cls.prometheus_url | ||
prometheus_selectors = ["app=kube-prometheus-stack-prometheus", "app.kubernetes.io/name=prometheus"] | ||
for label_selector in prometheus_selectors: | ||
service_url = find_service_url(label_selector) | ||
if service_url: | ||
cls.prometheus_url = service_url | ||
return service_url | ||
logging.error("Prometheus url could not be found. Add 'prometheus_url' under global_config") | ||
return None |
This file contains 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
This file contains 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
This file contains 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