Skip to content

Instantly share code, notes, and snippets.

@lemissel
Created July 3, 2021 01:19
Show Gist options
  • Save lemissel/774d2d983f4035f238c9fb224a76bfe7 to your computer and use it in GitHub Desktop.
Save lemissel/774d2d983f4035f238c9fb224a76bfe7 to your computer and use it in GitHub Desktop.
Micro tutorial how to up a Prometheus Docker container
sudo mkdir -p /docker/prometheus
docker run -d -p 9090:9090 \
--name prometheus \
-v /docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
docker stop prometheus
docker start prometheus
docker logs -f prometheus
global:
scrape_interval: 10s
evaluation_interval: 10s
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager: 9093
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
scrape_configs:
job_name: 'prometheus'
# metrics_path defaults to 'metrics'
# scheme defaults to 'http'
static_configs:
- targets: ['172.17.0.1:9090']
job_name: 'web'
static_configs:
- targets:['172.17.0.1:2112'] # suponds if your applications running in localhost with 2112 port and your metrics endpoit is http://localhost:2112/metrics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment