dashboard_lib

package module
v0.0.0-...-a34a17a Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 12 Imported by: 0

README

This library offers dashboard components and tools for constructing and testing Grafana dashboards at Chainlink.

Components structure is as follows:

dashboard
  |- lib
     |- component_1
        |- component.go
     |- component_2
        |- component.go
|- go.mod
|- go.sum

Each component should contain rows, logic and unique variables in component.go

Components should be imported from this module, see example

How to convert from JSON using Grabana codegen utility

  1. Download Grabana binary here
  2. ./bin/grabana convert-go -i dashboard.json > lib/my_new_component/rows.go
  3. Create a component

Documentation

Index

Constants

View Source
const (
	LogLevelEnvVar = "DASHBOARD_LOG_LEVEL"
)

Variables

Functions

func DecodeBasicAuth

func DecodeBasicAuth(authString string) (string, string, error)

Types

type Dashboard

type Dashboard struct {
	Name       string
	DeployOpts EnvConfig
	/* SDK panels that are missing in Grabana */
	SDKPanels []map[string]interface{}

	Opts []dashboard.Option
	// contains filtered or unexported fields
}

func NewDashboard

func NewDashboard(
	name string,
	deployOpts EnvConfig,
	opts []dashboard.Option,
) *Dashboard

func (*Dashboard) Add

func (m *Dashboard) Add(opts []dashboard.Option)

func (*Dashboard) AddSDKPanel

func (m *Dashboard) AddSDKPanel(panel map[string]interface{})

func (*Dashboard) Delete

func (m *Dashboard) Delete() error

func (*Dashboard) Deploy

func (m *Dashboard) Deploy() error

type DashboardOpts

type DashboardOpts struct {
	Tags        []string
	AutoRefresh string
}

type DataSources

type DataSources struct {
	Loki       string
	Prometheus string
}

type EnvConfig

type EnvConfig struct {
	Name                     string
	Platform                 string
	GrafanaURL               string
	GrafanaToken             string
	GrafanaBasicAuthUser     string
	GrafanaBasicAuthPassword string
	GrafanaFolder            string
	DataSources              DataSources
	PanelsIncluded           map[string]bool
}

func ReadEnvDeployOpts

func ReadEnvDeployOpts() EnvConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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