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 7 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
8 changes: 8 additions & 0 deletions .pytest_cache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# pytest cache directory #

This directory contains data from the pytest's cache plugin,
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.

**Do not** commit this to version control.

See [the docs](https://docs.pytest.org/en/latest/cache.html) for more information.
3 changes: 3 additions & 0 deletions .pytest_cache/v/cache/lastfailed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add .pytest_cache/ to .gitignore

"tests/test_default.py": true
}
1 change: 1 addition & 0 deletions .pytest_cache/v/cache/nodeids
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
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