This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
scrape_timeout: 10s | |
evaluation_interval: 15s | |
alerting: | |
alertmanagers: | |
- follow_redirects: true | |
scheme: http | |
timeout: 10s | |
api_version: v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |