mirror of
https://github.com/mii443/prometheus-android-exporter.git
synced 2025-08-22 23:25:40 +00:00
add file structure for server configuration
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
credentials/
|
2
server/README.md
Normal file
2
server/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Server configuration, intended use of this demo
|
||||||
|
#TODO demo , describe all files
|
4
server/ansible.cfg
Normal file
4
server/ansible.cfg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# ansible configuration file
|
||||||
|
|
||||||
|
[defaults]
|
||||||
|
inventory = ./ansible_inventory
|
2
server/ansible_inventory
Normal file
2
server/ansible_inventory
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[android-prometheus-exporter-target-server]
|
||||||
|
139.144.68.186
|
23
server/ansible_playbook.yaml
Normal file
23
server/ansible_playbook.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# run this playbook against new linux server
|
||||||
|
|
||||||
|
- name: Install example server stack for prometheus-exporter-android
|
||||||
|
hosts: android-prometheus-exporter-target-server
|
||||||
|
remote_user: root
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Assert linux distribution is Rocky Linux
|
||||||
|
|
||||||
|
- name: Install docker
|
||||||
|
|
||||||
|
- name: Install docker compose
|
||||||
|
|
||||||
|
- name: Create user androidexporter
|
||||||
|
|
||||||
|
- name:
|
||||||
|
|
||||||
|
|
||||||
|
#TODO create user androidexporter
|
||||||
|
#TODO install docker
|
||||||
|
#TODO install docker compose
|
||||||
|
#TODO copy files over
|
||||||
|
#TODO create folder structure
|
66
server/configuration/nginx.conf
Normal file
66
server/configuration/nginx.conf
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
# nginx configuration for pushprox, grafana and prometheus
|
||||||
|
http{
|
||||||
|
|
||||||
|
# Needed for grafana websockets
|
||||||
|
map $http_upgrade $connection_upgrade {
|
||||||
|
default upgrade;
|
||||||
|
'' close;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Upstream server definitions
|
||||||
|
upstream prometheus{
|
||||||
|
server http://prometheus:9090;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream pushprox{
|
||||||
|
server http://pushprox:8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream grafana{
|
||||||
|
server http://grafana:3000;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grafana server configuration
|
||||||
|
server {
|
||||||
|
listen 3000;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_pass http://grafana;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Proxy Grafana Live WebSocket connections
|
||||||
|
location /api/live/ {
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_pass http://grafana;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# PushProx server configuration
|
||||||
|
server {
|
||||||
|
listen 8080;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://pushprox;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Prometheus UI server configuration
|
||||||
|
server {
|
||||||
|
listen 9090;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://prometheus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
0
server/configuration/prometheus.yaml
Normal file
0
server/configuration/prometheus.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# nginx, pushprox, prometheus, grafana stack
|
||||||
|
|
||||||
|
version: '3.9'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
# monitoring dashboard for prometheus
|
||||||
|
grafana:
|
||||||
|
container_name: grafana
|
||||||
|
image: grafana/grafana:8.5.22
|
||||||
|
restart: on-failure
|
||||||
|
networks:
|
||||||
|
- common-network
|
||||||
|
|
||||||
|
# reverse proxy
|
||||||
|
nginx:
|
||||||
|
container_name: nginx
|
||||||
|
image: nginx:1.23.4
|
||||||
|
networks:
|
||||||
|
- common-network
|
||||||
|
|
||||||
|
# proxy for prometheus to traverse NAT
|
||||||
|
pushprox:
|
||||||
|
image: prometheuscommunity/pushprox:master
|
||||||
|
|
||||||
|
# prometheus time-series database
|
||||||
|
prometheus:
|
||||||
|
container_name: prometheus
|
||||||
|
image: bitnami/prometheus:2.43.0
|
||||||
|
volumes:
|
||||||
|
- ./
|
||||||
|
restart: on-failure
|
||||||
|
networks:
|
||||||
|
- common-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
common-network:
|
||||||
|
driver: bridge
|
||||||
|
Reference in New Issue
Block a user