The VictoriaMetrics datasource for Grafana is a plugin that enables users to query and visualize metrics from VictoriaMetrics directly within Grafana. Written in TypeScript, this plugin bridges the gap between VictoriaMetrics and Grafana's visualization capabilities, providing native support for VictoriaMetrics-specific features that go beyond what the generic Prometheus datasource offers.
The primary motivation for this dedicated plugin stems from the increasing divergence between Prometheus and VictoriaMetrics APIs. While VictoriaMetrics maintains Prometheus API compatibility, the plugin unlocks VictoriaMetrics-specific functionality including full MetricsQL support, query tracing capabilities in Explore mode and panel expressions, WITH expression templates for complex query construction, and integration with vmui. Additionally, the plugin addresses a label names validation issue present in Grafana's standard Prometheus datasource.
Core capabilities include querying metrics using MetricsQL, leveraging Grafana's Explore mode for data investigation, building dashboards and configuring alerts, applying Ad Hoc filters, creating template queries and expressions, obtaining query execution insights through tracing, and automatically formatting queries via a Prettify button. The plugin is available for testing at the VictoriaMetrics playground environment.
Installation options are flexible and accommodate various deployment scenarios. Users can install via Docker by specifying the GF_INSTALL_PLUGINS environment variable, provision through Grafana's datasource configuration files, deploy in Kubernetes using Grafana Helm charts or the Grafana operator, or install development releases manually. The repository includes comprehensive documentation for each installation method.
The WITH templates feature represents a significant capability for managing complex queries. These templates are stored as hidden dashboard variables and automatically included during dashboard export and import. Users can incorporate Grafana variables like $instance and $job within WITH template expressions, with panels automatically refreshing when variable values change. The feature includes markdown comment support for hints during auto-completion.
Development setup is well-documented, supporting both frontend and backend plugin development. The project uses Mage for building, with separate commands for building frontend components, backend components, or both together. Multi-platform backend builds target linux/amd64, linux/arm64, linux/arm, linux/386, amd64, arm64, and windows. Docker Compose support enables building and running the plugin in containerized environments.
Activity data shows this is an actively maintained project with median issue and pull request response latency of 1.1 hours and mean latency of 875.5 hours across 109 tracked items. The most prevalent issue labels are bug (60 occurrences), vm-datasource (38 occurrences), and enhancement (25 occurrences). Primary contributors tracked by GitGenius include arturminchukov with 274 events, dmitryk-dk with 154 events, and hagen1778 with 142 events. The repository shares contributors with major projects including Microsoft's VSCode and TypeScript repositories, as well as the Rust language repository, indicating involvement from developers across the broader open-source ecosystem.
The plugin is licensed under AGPL-3.0-only. Release management follows a structured process involving security review, version updates in package.json, and automated release pipelines that generate binaries and checksums for distribution through GitHub releases.