metrics
This commit is contained in:
65
prometheus.yml
Normal file
65
prometheus.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
# Prometheus configuration for knet application
|
||||
global:
|
||||
scrape_interval: 15s # How often to scrape targets
|
||||
evaluation_interval: 15s # How often to evaluate rules
|
||||
|
||||
# Attach these labels to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
external_labels:
|
||||
monitor: 'knet-monitor'
|
||||
|
||||
# Alertmanager configuration (optional)
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets:
|
||||
# - alertmanager:9093
|
||||
|
||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||
rule_files:
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'knet-app'
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
|
||||
# How often to scrape this target
|
||||
scrape_interval: 15s
|
||||
|
||||
# Timeout for scraping
|
||||
scrape_timeout: 10s
|
||||
|
||||
# Basic authentication for protected endpoints
|
||||
basic_auth:
|
||||
username: 'api'
|
||||
password: 'your-default-token' # This should match your API_TOKEN env var
|
||||
|
||||
static_configs:
|
||||
- targets: ['knet:54321'] # Your knet application
|
||||
labels:
|
||||
instance: 'knet-prod'
|
||||
environment: 'production'
|
||||
|
||||
# Only scrape metrics endpoint
|
||||
metrics_path: /metrics
|
||||
|
||||
# Optional: Add custom headers
|
||||
# headers:
|
||||
# X-Custom-Header: value
|
||||
|
||||
# Optional: Monitor Prometheus itself
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
# Storage configuration
|
||||
# Prometheus stores data in ./data by default
|
||||
# You can customize with command line flags:
|
||||
# --storage.tsdb.path=/prometheus
|
||||
# --storage.tsdb.retention.time=15d
|
||||
# --storage.tsdb.retention.size=10GB
|
||||
Reference in New Issue
Block a user