prometheus-configuration

Configure Prometheus YAML for metric scraping, alerting, and service discovery.

1|Updated Aug 31, 2024
One-click install
npx skills add https://github.com/aRustyDev/dotfiles --skill prometheus-configuration-arustydev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prometheus-configuration
Source: https://github.com/aRustyDev/dotfiles/tree/main/.ai/plugins/observability-monitoring/skills/prometheus-configuration
Command: npx skills add https://github.com/aRustyDev/dotfiles --skill prometheus-configuration-arustydev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) and scripts (resource) components.

What problem does it solve?

This Skill provides a complete guide to setting up Prometheus for comprehensive metric collection, storage, and monitoring, enabling robust observability for your infrastructure and applications.

Core Features & Use Cases

  • Scrape Configuration: Defines how Prometheus discovers and collects metrics from various targets (static, file-based, Kubernetes SD).
  • Recording Rules: Creates pre-computed metrics to optimize query performance and simplify complex expressions.
  • Alert Rules: Configures alerts for critical events like service downtime, high error rates, or resource exhaustion.
  • Use Case: Set up Prometheus to monitor a Kubernetes cluster, automatically discovering application pods and services, collecting their metrics, and firing alerts when predefined thresholds are breached.

Quick Start

Generate a basic prometheus.yml configuration to scrape metrics from a node-exporter running on node1:9100.

Frequently Asked Questions about prometheus-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Prometheus to scrape metrics from my applications and infrastructure?

Prometheus scrape configuration defines how the monitoring system discovers and collects metrics from targets. You define scrape_configs in prometheus.yml with target addresses, ports, and service discovery methods (static IPs, Kubernetes SD, file-based discovery) to automatically collect metrics at regular intervals from your applications and infrastructure.

Can I use Prometheus with Kubernetes for automatic service discovery?

Yes, Prometheus supports Kubernetes service discovery natively. Configure kubernetes_sd_config in your scrape_configs to automatically detect and monitor pods and services across your cluster, eliminating the need to manually manage target lists as your infrastructure scales.

How do I set up alerting rules to notify when metrics breach thresholds?

Alerting rules in Prometheus evaluate metric conditions and fire alerts when thresholds are breached. Define rules in YAML files referencing your rule_files configuration, then integrate with Alertmanager to route notifications. Rules support complex queries for events like service downtime or resource exhaustion.

What are recording rules and when should I use them?

Recording rules pre-compute and store frequently-used metric queries as new time series. They optimize query performance and simplify complex expressions, reducing computational overhead during dashboard queries and alert evaluation on large-scale monitoring deployments.

Does Prometheus work with TLS credentials for secure metric collection?

Yes, Prometheus supports TLS credentials in scrape configurations for encrypted metric collection from applications. Configure tls_config in scrape_configs with certificate files to securely authenticate and collect metrics over HTTPS from protected endpoints.

How do I deploy Prometheus monitoring across Kubernetes, Docker Compose, and bare-metal environments?

Prometheus deployment varies by environment: use Helm charts for Kubernetes clusters, docker-compose manifests for containerized stacks, and direct YAML configuration for bare-metal servers. Each environment requires adjusting service discovery methods and networking configuration in prometheus.yml to match your infrastructure topology.