Skip to content

Commit

Permalink
Add grafana_agent_health_check endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
v-zhuravlev authored Sep 8, 2023
1 parent bcb432c commit b864517
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roles/grafana_agent/tasks/ga-started.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Health check Grafana Agent
ansible.builtin.uri:
url: "http://127.0.0.1:12345/-/ready"
url: "{{ _grafana_agent_healthcheck_endpoint }}"
follow_redirects: none
method: GET
register: _result
Expand Down
3 changes: 3 additions & 0 deletions roles/grafana_agent/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ _grafana_agent_download_binary_file: "grafana-agent-{{ _grafana_agent_os_family
# systemd info
_grafana_agent_systemd_dir: /lib/systemd/system/
_grafana_agent_systemd_unit: grafana-agent.service

# Server http address, used in self health check after start
_grafana_agent_healthcheck_endpoint: "http://{{ grafana_agent_flags_extra.server.http.address if ((grafana_agent_flags_extra.server|default({})).http|default({})).http.address is defined else '127.0.0.1:12345' }}/-/ready"

Check warning on line 36 in roles/grafana_agent/vars/main.yaml

View workflow job for this annotation

GitHub Actions / Perform Linting

36:151 [line-length] line too long (221 > 150 characters)

Check warning on line 36 in roles/grafana_agent/vars/main.yaml

View workflow job for this annotation

GitHub Actions / Perform Linting

jinja[spacing]

Jinja2 spacing could be improved: http://{{ grafana_agent_flags_extra.server.http.address if ((grafana_agent_flags_extra.server|default({})).http|default({})).http.address is defined else '127.0.0.1:12345' }}/-/ready -> http://{{ grafana_agent_flags_extra.server.http.address if ((grafana_agent_flags_extra.server | default({})).http | default({})).http.address is defined else '127.0.0.1:12345' }}/-/ready

0 comments on commit b864517

Please sign in to comment.