Skip to content

Commit

Permalink
Scrape IP instead of localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Oct 25, 2023
1 parent 003dfd1 commit 5da5ed0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def patroni_scrape_config(self) -> List[Dict]:
return [
{
"metrics_path": "/metrics",
"static_configs": [{"targets": ["localhost:8008"]}],
"static_configs": [{"targets": [f"{self._unit_ip}:8008"]}],
"tls_config": {"insecure_skip_verify": True},
"scheme": "https" if self.is_tls_enabled else "http",
}
Expand Down
2 changes: 1 addition & 1 deletion templates/patroni.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log:
file_size: 600

restapi:
listen: '0.0.0.0:8008'
listen: '{{ self_ip }}:8008'
connect_address: '{{ self_ip }}:8008'
{%- if enable_tls %}
cafile: {{ conf_path }}/ca.pem
Expand Down

0 comments on commit 5da5ed0

Please sign in to comment.