Add metrics

This commit is contained in:
Perflyst 2021-03-09 18:41:33 +01:00
parent 274df1b73a
commit bc603de866
No known key found for this signature in database
GPG Key ID: B0D9C8E56E999F68
5 changed files with 73 additions and 7 deletions

View File

@ -1,8 +1,13 @@
$ANSIBLE_VAULT;1.1;AES256
30613534346431333631646634333061336363386330343564323661356666663233656137343132
3034323166623230643138663761386234393537626262300a373139366231623230343361353937
37663037323733623561356130373834396136336433636338646635666330666437323564636537
3731636465626463300a613263333138613230346639646337313332366262613630643164666431
34636632643161383436326338646366323031363237343965336633343131353165613961653063
65316162613535353432613962353535333631326166383035366532366564653435613835356634
396466653535653563393632313736613735
39303330616163326665373337326635386164616335626366333638653464303532643530333762
6636626430613433623534373263633663303431316339640a613930623530623336373663323038
34666363393733363736323166343138656364373439366332623930633635616631386533306533
3666663833353931360a636163646163363661666330633636353532323333386432633037653131
65343530643931303834633961633934613037396336646439663163326635656238623936343165
66386165653839323231333761343663613965326538303032363935643433306366643763393665
30333033626162356564393439643866356266393362643664646365373535613764366130346438
33313330613163623339386130653032333962343235653135653431376165656163336531663162
61653763663162663933373236326365343365653233643830613237626639316666386530386434
33633136393637343863306261396334333533643233633236353531663066613637653236316632
31333435333835346364663638656266643230303163656362336566653638633361373532653834
34396162656135333337

View File

@ -1,3 +1,4 @@
---
ansible_python_interpreter: /usr/bin/python3
ansible_user: root
ansible_port: 233
@ -11,6 +12,7 @@ apt_packages:
- net-tools
- python3-setuptools
- jq
- prometheus-node-exporter
pip_install_packages:
- name: docker

View File

@ -0,0 +1,36 @@
---
prometheus_web_listen_address: "127.0.0.1:9090"
prometheus_scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ['localhost:9090']
- job_name: "node"
static_configs:
- targets: ['localhost:9100']
- job_name: "caddy"
static_configs:
- targets: ['127.0.0.1:2019']
grafana_url: "https://grafana.invidious.io"
grafana_domain: grafana.invidious.io
grafana_address: 127.0.0.1
grafana_port: 2000
grafana_security:
admin_user: admin
admin_password: "{{ vault_grafana_admin_password }}"
disable_gravatar: true
cookie_secure: true
grafana_auth:
anonymous:
enabled: true
grafana_datasources:
- name: Prometheus
type: prometheus
url: http://localhost:9090
grafana_dashboards:
- dashboard_id: '1860'
revision_id: '22'
datasource: 'Prometheus'
- dashboard_id: '13460'
revision_id: '2'
datasource: 'Prometheus'

View File

@ -27,11 +27,28 @@
name: "{{ apt_packages }}"
tags: [apt,base]
- name: Bind node exporter to localhost
ansible.builtin.lineinfile:
path: /etc/default/prometheus-node-exporter
regexp: '^ARGS='
line: ARGS=--web.listen-address=localhost:9100
tags: [apt,base]
- name: unattended-upgrades
import_role:
name: jvn.unattended-upgrades
tags: [unattended-upgrades]
- name: prometheus
import_role:
name: cloudalchemy.prometheus
tags: [prometheus]
- name: grafana
import_role:
name: cloudalchemy.grafana
tags: [grafana]
- name: pip
import_role:
name: geerlingguy.pip

View File

@ -6,6 +6,7 @@
body "User-agent: *
Disallow: /
"
}
log {
output file /var/log/caddy/access.log {
roll_size 500mb
@ -68,3 +69,8 @@ docs.invidious.io {
import common
reverse_proxy http://127.0.0.1:3001
}
grafana.invidious.io {
import common
reverse_proxy http://127.0.0.1:2000
}