e6data-grafana-datasource

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2026 License: Apache-2.0

README

e6data data source for Grafana

CI Security License

A production-grade backend Grafana data source plugin for the e6data distributed SQL engine.

Credentials never leave the Grafana server: the access token is stored in secureJsonData and used only by the Go backend, which speaks e6data's native gRPC protocol (QueryEngineService) directly — the same protocol used by the official Python connector and JDBC driver.

Highlights

  • Backend execution — works in Grafana OSS, Enterprise, and Cloud.
  • Native gRPC transport — full type fidelity (Decimal128, timezone-aware timestamps) with no intermediate gateway to operate.
  • Long-running & large queries — chunked result fetching with configurable row/byte caps; query cancellation wired to e6data cancelQuery.
  • Metadata-aware — catalog/schema/table/column discovery powers template variables, Explore, and SQL autocomplete.
  • Secure by default — TLS verification, custom CA bundles, SSRF guards, and log redaction baked into the backend.

Architecture

Grafana (browser)  ──► Grafana server ──► e6 backend plugin ──► E6Client ──► e6data engine
   React panels          DataSourceWithBackend     (Go)       (gRPC+Thrift)

See docs/architecture.md and the ADRs for the full design and the transport decision record.

Run it locally — one command (Docker only)

Try the plugin against your own e6data cluster with just Docker — no Go/Node toolchain needed. The image multi-stage-builds the plugin from source and serves it inside Grafana.

# 1. Point a gitignored local provisioning file at your cluster + paste a token
cp provisioning/datasources/local.yaml.example provisioning/datasources/local.yaml
$EDITOR provisioning/datasources/local.yaml   # fill in host, cluster, catalog, schema, username, accessToken

# 2. Build and start
docker compose up --build

Open http://localhost:3000 (anonymous admin). The "e6data (live)" datasource is provisioned and selected by default — open Explore and run e.g. SELECT * FROM date_dim LIMIT 100. (First Save & test after an idle cluster takes ~60–90 s while auto-resume spins it up; click it again if it times out.)

To also start the in-repo mock engine (for the "e6data (mock)" datasource):

docker compose --profile mock up --build

Quick start (development)

Prerequisites: Go 1.26+, Node 20+, Mage, Docker.

# backend
mage -v                 # build backend for the host platform
mage coverage           # run Go tests with coverage

# frontend
npm ci
npm run dev             # watch-build the frontend
npm test                # jest unit tests

Configuration

Field Stored in Notes
Host jsonData e6data engine/planner host
Port jsonData default 443
Database jsonData default database
Catalog jsonData catalog name
Cluster name jsonData e6data cluster UUID/name (gRPC cluster-name header)
Username jsonData e6data username (email)
Access token secureJsonData never sent to the browser
TLS enabled jsonData on by default
CA certificate secureJsonData optional custom CA bundle (PEM)

See docs/configuration.md and docs/security.md.

Contributing

Issues and PRs welcome — see CONTRIBUTING.md and the developer guide. Security reports: SECURITY.md.

License

Apache-2.0.

Directories

Path Synopsis
pkg
Command gpx_e6data is the e6data Grafana backend data source plugin binary.
Command gpx_e6data is the e6data Grafana backend data source plugin binary.
e6
Package e6 defines the transport-agnostic client abstraction the Grafana backend uses to talk to e6data.
Package e6 defines the transport-agnostic client abstraction the Grafana backend uses to talk to e6data.
e6/trino
Package trino is the alternate e6.E6Client transport that talks to e6data via the e6-trino-gateway (Trino REST API) using a standard Trino Go driver.
Package trino is the alternate e6.E6Client transport that talks to e6data via the e6-trino-gateway (Trino REST API) using a standard Trino Go driver.
e6sql
Package e6sql adapts the native gRPC e6.E6Client to Go's database/sql/driver interface.
Package e6sql adapts the native gRPC e6.E6Client to Go's database/sql/driver interface.
instrument
Package instrument exposes Prometheus metrics for the data source.
Package instrument exposes Prometheus metrics for the data source.
models
Package models defines the data source configuration and query models, plus their validation.
Package models defines the data source configuration and query models, plus their validation.
plugin
Package plugin wires e6data into Grafana via the shared grafana/sqlds framework: the e6Driver implements sqlds.Driver (backed by the e6sql database/sql driver over the native gRPC client) and sqlds.Completable for schema autocomplete.
Package plugin wires e6data into Grafana via the shared grafana/sqlds framework: the e6Driver implements sqlds.Driver (backed by the e6sql database/sql driver over the native gRPC client) and sqlds.Completable for schema autocomplete.
protocol/vector
Package vector mirrors proto/e6x_vector.thrift: the columnar result format the e6data engine returns inside GetNextResultBatchResponse.resultBatch (a Thrift TBinaryProtocol blob).
Package vector mirrors proto/e6x_vector.thrift: the columnar result format the e6data engine returns inside GetNextResultBatchResponse.resultBatch (a Thrift TBinaryProtocol blob).
security
Package security holds the cross-cutting controls the plugin must enforce before touching the network or emitting logs: SSRF validation, TLS setup, and secret redaction.
Package security holds the cross-cutting controls the plugin must enforce before touching the network or emitting logs: SSRF validation, TLS setup, and secret redaction.
tests
mocke6 command
Command mocke6 is an in-repo mock of the e6data QueryEngineService.
Command mocke6 is an in-repo mock of the e6data QueryEngineService.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL