GreptimeDB Datasource Go SDK

Constructor#

import "github.com/perses/plugins/greptimedb/sdk/go/datasource"

var options []datasource.Option
datasource.GreptimeDB(options...)

Need a list of options. At least direct URL or proxy URL, in order to work.

Default options#

  • None

Available options#

Direct URL#

import "github.com/perses/plugins/greptimedb/sdk/go/datasource"

datasource.DirectURL("http://localhost:4000")

Configure the access to the GreptimeDB datasource with a direct URL.

Proxy#

import "github.com/perses/plugins/greptimedb/sdk/go/datasource"

datasource.HTTPProxy("https://current-domain-name.io", httpProxyOptions...)

Configure the access to the GreptimeDB datasource with a proxy URL. More info at HTTP Proxy.

Example#

package main

import (
	"github.com/perses/perses/go-sdk/dashboard"

	gtDs "github.com/perses/plugins/greptimedb/sdk/go/datasource"
)

func main() {
	dashboard.New("GreptimeDB Dashboard",
		dashboard.AddDatasource("greptimeMain", gtDs.GreptimeDB(gtDs.DirectURL("http://localhost:4000"))),
	)
}