The monitor reads its target from env vars, and exposes a Summary
with quantiles: 0.5
, 0.9
, 0.99
Running the monitor without setting variables will Monitor This project's docker hub page once every 10 seconds and expose the metrics on port 9100
scrapePort
- The port on which Prometheus will scrape the metrics (defautl 9100)subsystem
- The subsystem (i.e. server/website/store - defualt website)monitorUrl
- The URL that should be monitored (default https://hub.docker.com/repository/docker/tomgurdev/simple-go-http-monitor)monitorInterval
- how often the monitor should run in seconds (defautlt 10)componentName
- the name of the monitored service (default simple-http-monitor-docker-hub)go run monitor.go
go build monitor.go; ./monitor
docker build -t monitor:1 .; docker run --name monitor --restart always -d -p 9100:9100 -e "scrapePort=9100" -e "subsystem=website" -e "monitorUrl=https://hub.docker.com/repository/docker/tomgurdev/simple-go-http-monitor" -e "monitorInterval=10" -e "componentName=simple_http_monitor_docker_hub" mymonitor:1
scrapePort
at the /metrics
endpoint (i.e. 1.2.3.4:9100/metrics
)0.5
, 0.9
, 0.99
from
LabelWhen run on an AWS EC2 instance, a label will be added to all metrics from=<availability zone>
.
Whne run outside of AWS, the from label will be filled with the outgoing IP address of the server.