A modern React-based Grafana datasource plugin for KairosDB, a time series database built on Cassandra.
- 📊 Complete KairosDB Integration: Query metrics with full aggregator support
- 📈 Histogram Visualization: Native support for KairosDB histogram data as heatmaps
- 🎯 Advanced Template Variables: Multi-value variables with proper alias handling
- 🏷️ Tag-based Filtering: Dynamic tag key/value selection and filtering
- ⏱️ Flexible Grouping: Time, value, and tag-based data grouping
- 🚀 Modern UI: Built with React and Grafana's latest UI components
- Open Grafana and navigate to Administration → Plugins
- Search for "KairosDB"
- Click Install and restart Grafana
# Clone into Grafana plugins directory
cd /var/lib/grafana/plugins
git clone https://github.com/grafana/kairosdb-datasource
cd kairosdb-datasource
# Install dependencies and build
npm install
npm run build:prod
# Restart Grafana
sudo systemctl restart grafana-server
# Using Grafana's plugin installation
docker run -d \
-p 3000:3000 \
--name=grafana \
-e "GF_INSTALL_PLUGINS=grafana-kairosdb-datasource" \
grafana/grafana
- Navigate to Administration → Data Sources
- Click Add data source
- Select KairosDB
- Configure connection settings:
- URL: Your KairosDB server URL (e.g.,
http://localhost:8080
) - Access: Server (default) or Browser
- Auth: Configure if using authentication
- URL: Your KairosDB server URL (e.g.,
- Snap to Intervals: Configure automatic time interval snapping
- Max Metrics: Limit metric name autocomplete results
- Request Timeout: Set query timeout duration
- Select a Metric Name (autocomplete available)
- Add Aggregators for data processing
- Configure Group By options for data grouping
- Set Tags for filtering specific time series
- Metrics:
metrics()
- List all available metrics - Tag Names:
tag_names(metric_name)
- Get tag keys for a metric - Tag Values:
tag_values(metric_name, tag_key)
- Get values for a tag
KairosDB histogram data is automatically detected and rendered as heatmaps:
- Use the merge aggregator with precision parameter
- Histograms appear as Grafana heatmap panels
- Automatic bin calculation and tooltip support
- Node.js 18+ and npm
- Docker (for development server)
# Clone and install dependencies
git clone https://github.com/grafana/kairosdb-datasource
cd kairosdb-datasource
npm install
# Start development server with live reload
npm run dev
# Start Grafana development environment
npm run server
# Access at http://localhost:3000 (admin/admin)
npm run build
- Development buildnpm run build:prod
- Production buildnpm run dev
- Watch mode with live reloadnpm run test
- Run unit testsnpm run test:ci
- Run tests in CI modenpm run e2e
- End-to-end tests with Playwrightnpm run lint
- Code lintingnpm run typecheck
- TypeScript type checking
# Unit tests
npm test
# E2E tests (requires server running)
npm run server # In one terminal
npm run e2e # In another terminal
This plugin uses modern Grafana plugin architecture:
- React Components: Modern UI built with React and TypeScript
- Webpack Build: Optimized bundling and development experience
- Jest Testing: Comprehensive unit test coverage
- Playwright E2E: End-to-end testing for UI interactions
src/datasource.ts
- Core datasource implementationsrc/components/
- React UI componentssrc/aggregators.ts
- KairosDB aggregator definitionssrc/utils/
- Utility functions and helpers
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes and add tests
- Run linting and tests (
npm run lint && npm test
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Grafana: 9.0+ (tested with 11.3.0)
- KairosDB: 1.2+ (supports all modern features)
- Browsers: Modern browsers supporting ES2018+
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Originally created for Angular, migrated to React in v4.0.0
- Built with Grafana's modern plugin development framework
- Special thanks to the KairosDB and Grafana communities