Skip to content

Instantly share code, notes, and snippets.

@flying3615
Last active April 22, 2021 21:16
Show Gist options
  • Save flying3615/c41d6991f3cfb241adfbba58b2cfb191 to your computer and use it in GitHub Desktop.
Save flying3615/c41d6991f3cfb241adfbba58b2cfb191 to your computer and use it in GitHub Desktop.
Orchestrate prometheus and grafana in docker container to monitor spring-acturator application
--------docker-compose.yml---------
version: '2'
services:
prometheus_cust:
image: prometheus_cust:openbet
networks:
- obnet
grafana_cust:
image: grafana/grafana
networks:
- obnet
networks:
obnet:
driver: bridge
ipam:
config:
- subnet: 13.5.0.0/16
gateway: 13.5.0.1
-------Dockerfile-------
FROM prom/prometheus
COPY prometheus.yml /etc/prometheus/prometheus.yml
------prometheus.yml-------
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
scrape_configs:
- job_name: prometheus
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- job_name: 'spring'
metrics_path: '/prometheus'
static_configs:
- targets:
- 13.5.0.1:22954
------application.yml-------
management:
port: 22954
security:
enabled: false
metrics:
distribution:
percentiles-histogram:
"[http.client.requests]": true
sla:
"[http.client.requests]": 10ms, 100ms
percentiles:
"[http.client.requests]": 0.5, 0.75, 0.95, 0.98, 0.99, 0.999, 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment