What is Prometheus?
· Category: DevOps & CI/CD
Short answer
Prometheus is an open-source monitoring and alerting toolkit. It collects metrics via HTTP pull requests, stores them as time-series data, and evaluates alerting rules.
How it works
Prometheus scrapes metrics from instrumented applications and exporters at regular intervals. Data is stored locally in a custom time-series database. PromQL is used to query the data.
Example
scrape_configs:
- job_name: 'app'
static_configs:
- targets: ['app:8080']
Why it matters
Prometheus is the de facto standard for cloud-native monitoring. It integrates with Kubernetes, supports dynamic service discovery, and has a rich ecosystem of exporters.
Tips
- Use recording rules for expensive queries.
- Set appropriate retention periods.
- Use remote storage for long-term data.
Common issues
- High cardinality labels can cause performance issues.
- Scraping failures may be due to network issues.
- Alert fatigue occurs with poorly tuned rules.