📊 Collecting Metrics
Laniakea Looking Glass includes a built-in Prometheus exporter that allows you to monitor your instance's usage and performance. The metrics endpoint is available at /metrics
. Also you could check example from our demo instance.
Available Metrics​
The following metrics are exposed:
laniakea_requests_total
- Total number of requests in the last 5 minuteslaniakea_error_requests_total
- Number of error requests in the last 5 minuteslaniakea_unique_ips_total
- Number of unique IP addresses making requests in the last 5 minuteslaniakea_metrics_error
- Indicates if there was an error collecting metrics (0 = no error, 1 = error occurred)
Setting up Prometheus​
To collect these metrics with Prometheus, add the following job to your prometheus.yml
configuration:
scrape_configs:
- job_name: 'laniakea'
metrics_path: '/metrics'
static_configs:
- targets: ['your-looking-glass-domain.com']
scrape_interval: 30s
Replace your-looking-glass-domain.com
with your actual domain name.
Grafana Dashboard​
You can create a Grafana dashboard to visualize these metrics. Here's an example of useful queries:
- Request Rate:
rate(laniakea_requests_total[5m])
- Error Rate:
rate(laniakea_error_requests_total[5m])
- Active Users (Unique IPs):
laniakea_unique_ips_total
- Error Percentage:
(rate(laniakea_error_requests_total[5m]) / rate(laniakea_requests_total[5m])) * 100