Prometheus Integration
Lunar.dev supports Prometheus integration for comprehensive traffic and system metrics collection. By exporting metrics to Prometheus, users can leverage visualization tools like Grafana and Datadog to monitor API performance and internal flow execution. This guide outlines how to configure Lunar.dev to expose metrics for Prometheus scraping.
Scraping Metrics from Prometheus
To scrape metrics from Lunar.dev with Prometheus, add the following to your prometheus.yml
configuration:
scrape_configs:
- job_name: "lunar-proxy"
scrape_interval: 5s
static_configs:
- targets: ["lunar-proxy-address:3000"]
labels:
group: "production"
Adjust the address and interval as per your system setup.
Scraping Metrics in Kubernetes
To scrape metrics in Kubernetes environments, use the Prometheus Operator’s serviceMonitor resource. Enable it in the Helm chart’s values.yaml
file:
serviceMonitor:
enabled: true