Skip to main content

Grafana

Grafana provides metrics visualization for the NeXuS platform. It runs at https://grafana.sebhosting.com.

Access

Configuration

Grafana runs as a Docker container with persistent storage:

grafana:
image: grafana/grafana:latest
container_name: nexus-grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
GF_SERVER_ROOT_URL: https://grafana.sebhosting.com
volumes:
- grafana_data:/var/lib/grafana
networks:
- traefik-public
- nexus-internal

Data Source

Prometheus is the primary data source, accessible at http://nexus-prometheus:9090 on the internal network.

Adding Prometheus Data Source

  1. Go to Grafana → Configuration → Data Sources
  2. Add data source → Prometheus
  3. URL: http://nexus-prometheus:9090
  4. Access: Server (default)
  5. Save & Test

Pre-configured Dashboards

  • Container Resources — CPU, memory, network I/O per container
  • API Metrics — Request rates, response times, error rates
  • Database Performance — Query times, connection pools, cache hit rates
  • Cache Hit Rates — Redis and Memcached performance

Dashboard Embed

The NeXuS frontend embeds Grafana dashboards at /dashboard/grafana using iFrames. This requires Pro plan or higher.

Useful Queries

# Container CPU usage
rate(container_cpu_usage_seconds_total[5m])

# Memory usage percentage
container_memory_usage_bytes / container_spec_memory_limit_bytes * 100

# HTTP request rate
rate(http_requests_total[5m])

# API response time (95th percentile)
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))