Skip to content

Typesense Monitoring

Overview

This setup provides full monitoring of your Typesense cluster with:

  • Prometheus - Metrics collection and storage
  • Typesense Exporter - Converts Typesense metrics to Prometheus format
  • Grafana - Beautiful dashboards and visualizations

Services Added

1. Prometheus (Port 9090)

  • Scrapes metrics from the Typesense exporter every 15 seconds
  • Stores time-series data
  • Access at: http://localhost:9090

2. Typesense Exporter (Port 8908)

  • Exposes Typesense /metrics.json and /stats.json as Prometheus metrics
  • Collects:
    • CPU, Memory, Disk usage
    • Network activity
    • Query statistics
    • Indexed documents count
    • Search performance metrics

3. Grafana (Port 2290)

  • Visualizes Prometheus metrics
  • Pre-built dashboards available
  • Access at: http://localhost:2290
  • Default credentials: admin / admin

Getting Started

1. Start the Services

bash
docker-compose up -d

This will start:

  • wedissimo-prometheus - Metrics collection
  • wedissimo-typesense-exporter - Typesense metrics exporter
  • wedissimo-grafana - Visualization dashboard

2. Access Grafana

  1. Open http://localhost:2290
  2. Login with: admin / admin
  3. Change password when prompted

3. Add Prometheus Data Source

  1. Go to ConfigurationData Sources
  2. Click Add data source
  3. Select Prometheus
  4. Set URL to: http://wedissimo-prometheus:9090
  5. Click Save & Test

4. Import Typesense Dashboards

The Typesense exporter includes pre-built Grafana dashboards. To import them:

  1. Go to DashboardsImport
  2. Download dashboards from: https://github.com/akyriako/typesense-prometheus-exporter/tree/main/assets/grafana
  3. Upload the JSON files or paste their content
  4. Select Prometheus as the data source
  5. Click Import

Available Metrics

System Metrics

  • typesense_metrics_cpu_* - CPU usage per core
  • typesense_metrics_memory_* - Memory (active, allocated, retained)
  • typesense_metrics_disk_* - Disk usage
  • typesense_metrics_network_* - Network bytes sent/received

Typesense-Specific Metrics

  • typesense_stats_total_requests - Total requests
  • typesense_stats_requests_per_second - Request rate
  • typesense_stats_latency_* - Query latency
  • typesense_stats_documents_* - Document counts per collection

Troubleshooting

Prometheus not scraping metrics

bash
# Check Prometheus targets
curl http://localhost:9090/api/v1/targets

Exporter not connecting to Typesense

bash
# Check exporter logs
docker-compose logs wedissimo-typesense-exporter

Grafana can't connect to Prometheus

  • Ensure Prometheus is running: docker-compose ps
  • Check data source URL is: http://wedissimo-prometheus:9090

Ports Reference

ServicePortURL
Prometheus9090http://localhost:9090
Typesense Exporter8908http://localhost:8908/metrics
Grafana3000http://localhost:3000
Typesense2226http://localhost:2226

Next Steps

  1. Create custom dashboards for your specific metrics
  2. Set up alerts in Grafana for important thresholds
  3. Monitor query performance and optimize as needed
  4. Track indexed documents and collection growth

Wedissimo API Documentation