flying3615
11/28/2018 - 10:03 PM

Orchestrate prometheus and grafana in docker container to monitor spring-acturator application

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