Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics #31

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.molecule
.cache
**__pycache__**
.pytest_cache/
21 changes: 15 additions & 6 deletions tasks/metrics.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
---
- name: Download nginx_exporter from github and compile it locally
- name: get nginx exporter
become: no
shell: "export GOPATH=/tmp/nginx_exporter; go get github.com/discordianfish/nginx_exporter"
args:
creates: /tmp/nginx_exporter
get_url:
url: https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v0.1.0/nginx-prometheus-exporter-0.1.0-linux-amd64.tar.gz
dest: /tmp/nginx_exporter.tar.gz
mode: 0775
run_once: yes
delegate_to: localhost

- name: install prometheus exporter
- name: extract nginx_exporter
become: no
unarchive:
src: /tmp/nginx_exporter.tar.gz
dest: /tmp
run_once: yes
delegate_to: localhost

- name: install nginx exporter
copy:
src: /tmp/nginx_exporter/bin/nginx_exporter
src: /tmp/nginx-prometheus-exporter/
dest: /opt/nginx_exporter
mode: 0755

Expand Down
2 changes: 1 addition & 1 deletion templates/nginx_exporter.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ After=network.target
[Service]
Type=simple
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/opt/nginx_exporter -nginx.scrape_uri=http://127.0.0.1:{{ nginx_status_port }}/nginx_status
ExecStart=/opt/nginx_exporter -nginx.scrape-uri=http://127.0.0.1:{{ nginx_status_port }}/nginx_status

SyslogIdentifier=nginx_exporter
Restart=always
Expand Down