Skip to content

Instantly share code, notes, and snippets.

View synergit's full-sized avatar
🏠
Working from home

Chloe synergit

🏠
Working from home
View GitHub Profile
import http.server
import time
# (1) Make sure prometheus_client is installed
from prometheus_client import start_http_server, Gauge
REQUEST_INPROGRESS = Gauge('app_request_inprogress', 'application request in progress')
APP_PORT = 8000 # (2) define application port
METRICS_PORT = 8001 # (3) define metrics port
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- follow_redirects: true
scheme: http
timeout: 10s
api_version: v2