Browse Source

push gateway

master
gsd 3 weeks ago
parent
commit
a70a2e2ea2
  1. 1
      .gitignore
  2. 14
      pushgateway/check.sh
  3. 25
      pushgateway/docker-compose.yaml
  4. 13
      pushgateway/srv.conf

1
.gitignore

@ -0,0 +1 @@
pushgateway/.htpasswd

14
pushgateway/check.sh

@ -0,0 +1,14 @@
#!/bin/sh
BASIC_U=
BASIC_P=
SOURCE=http://localhost:9101/metrics
DEST=http://localhost:9100/metrics
IWANNASLEEP=15
alias pushmetrics="curl -s \"${SOURCE}\" | curl -u \"${BASIC_U}:${BASIC_P}\" --data-binary @- \"${DEST}\" >> /dev/null"
pushmetrics
sleep $IWANNASLEEP
pushmetrics
sleep $IWANNASLEEP
pushmetrics

25
pushgateway/docker-compose.yaml

@ -0,0 +1,25 @@
#curl -s http://localhost:9100/metrics | curl --data-binary @- http://pushgateway.example.org:9091/metrics/job/some_job/instance/some_instance
services:
pushgateway:
image: docker.pblr-nyk.pro/prom/pushgateway:latest
container_name: p_gw
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.1"
memory: 128M
pushgateway_nginx:
image: docker.pblr-nyk.pro/nginx:1.27.4-alpine
container_name: p_gw_nginx
restart: unless-stopped
volumes:
- ./srv.conf:/etc/nginx/conf.d/srv.conf:ro
- ./.htpasswd:/etc/nginx/.htpasswd:ro
ports:
- 9091:9091
deploy:
resources:
limits:
cpus: "0.1"
memory: 128M

13
pushgateway/srv.conf

@ -0,0 +1,13 @@
upstream pushgateway {
server p_gw:9091;
}
server {
listen 0.0.0.0:9091;
server_name __;
location / {
auth_basic "Pushgateway server authentication";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://pushgateway;
}
}
Loading…
Cancel
Save