Skip to content

Commit

Permalink
use the generic cloud integrator charm (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabello authored Jan 3, 2024
1 parent 37ab2b7 commit a086104
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/grafana_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,31 +588,29 @@ def _enrich_endpoints(self) -> Tuple[List[Dict[str, Any]], List[Dict[str, Any]]]
prometheus_endpoints: List[Dict[str, Any]] = self._remote_write.endpoints

if self._cloud.prometheus_ready:
prometheus_endpoints.append(
{
"url": self._cloud.prometheus_url,
"basic_auth": {
"username": self._cloud.credentials.username,
"password": self._cloud.credentials.password,
},
prometheus_endpoint = {"url": self._cloud.prometheus_url}
if self._cloud.credentials:
prometheus_endpoint["basic_auth"] = {
"username": self._cloud.credentials.username,
"password": self._cloud.credentials.password,
}
)
prometheus_endpoints.append(prometheus_endpoint)

loki_endpoints = self._loki_consumer.loki_endpoints

if self._cloud.loki_ready:
loki_endpoints.append(
{
"url": self._cloud.loki_url,
"headers": {
"Content-Encoding": "snappy",
},
"basic_auth": {
"username": self._cloud.credentials.username,
"password": self._cloud.credentials.password,
},
loki_endpoint = {
"url": self._cloud.loki_url,
"headers": {
"Content-Encoding": "snappy",
},
}
if self._cloud.credentials:
loki_endpoint["basic_auth"] = {
"username": self._cloud.credentials.username,
"password": self._cloud.credentials.password,
}
)
loki_endpoints.append(loki_endpoint)

for endpoint in prometheus_endpoints + loki_endpoints:
endpoint["tls_config"] = {
Expand Down

0 comments on commit a086104

Please sign in to comment.