Grafana Foundation Go SDK: Is it possible to add raw / plugin datasource queries (e.g. ClickHouse) to dashboards?

6 days ago 7
ARTICLE AD BOX

I’m experimenting with Grafana Foundation SDK (Go) to define dashboards as code.

I can successfully create dashboards and panels using the builder APIs (e.g. dashboard.NewDashboardBuilder, stat.NewPanelBuilder) and also add queries for core datasources like testdata using their typed query builders.

However, I’m stuck when trying to add a raw query for a plugin datasource, specifically ClickHouse.

In Grafana UI, the panel query uses fields like:

rawSql

queryType

plugin-specific fields defined by the ClickHouse datasource

In the Go SDK, I could not find:

a generic Target type

any RawJSON / escape-hatch API

a ClickHouse-specific query builder

My questions:

Does the Grafana Foundation Go SDK currently support plugin datasource queries (like ClickHouse)?

Is there a supported way to add raw / untyped queries to a panel using the Go SDK?

If not, is this a known limitation of the SDK while it’s still in public preview, and is Grafonnet/Jsonnet the recommended approach for plugin-heavy dashboards?

I’m using Grafana v12.x and the next+cog-* preview version of the Go SDK.

Any guidance on current support or roadmap would be appreciated.

Read Entire Article