dashboard

package
v1.50.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultStatTextSize       = 12
	DefaultStatValueSize      = 20
	DefaultAlertEvaluateEvery = "10s"
	DefaultAlertFor           = "10s"
	DefaultDashboardUUID      = "Wasp"

	DefaultRequirementLabelKey = "requirement_name"
)
View Source
const (
	AlertTypeQuantile99 = "quantile_99"
	AlertTypeErrors     = "errors"
	AlertTypeTimeouts   = "timeouts"
)

Variables

This section is empty.

Functions

func AddVariables

func AddVariables(datasourceName string) []dashboard.Option

AddVariables generates standard dashboard options for common label variables using the provided datasourceName. It includes variables like go_test_name, gen_name, branch, commit, and call_group. Use this to easily incorporate these variables into your dashboard configuration.

func InlineLokiAlertParams

func InlineLokiAlertParams(queryType, testName, genName string) string

InlineLokiAlertParams generates a Loki query string based on the alert type, test name, and generator name. It is used to configure specific alert conditions for monitoring test metrics in dashboards.

func RPSPanel

func RPSPanel(dataSource string, query map[string]string) row.Option

RPSPanel creates a time series panel displaying responses per second grouped by generator and call group. It is used to monitor response rates in the dashboard.

func RPSVUPerScheduleSegmentsPanel

func RPSVUPerScheduleSegmentsPanel(dataSource string, query map[string]string) row.Option

RPSVUPerScheduleSegmentsPanel creates a dashboard panel displaying Requests Per Second and Virtual Users segmented by schedule. It is used to monitor performance metrics over time for different test configurations.

func WASPDebugDataRow

func WASPDebugDataRow(dataSource string, query map[string]string, collapse bool) dashboard.Option

WASPDebugDataRow returns a dashboard.Option containing a row with WASP debug metrics and logs. It uses the provided data source and query parameters. Use this function to include detailed debug information in your dashboard.

func WASPLoadStatsRow

func WASPLoadStatsRow(dataSource string, query map[string]string) dashboard.Option

WASPLoadStatsRow creates a "WASP Load Stats" dashboard row with widgets displaying real-time and total load metrics. It utilizes the provided data source and query parameters to configure the relevant statistics for monitoring.

Types

type Dashboard

type Dashboard struct {
	Name           string
	DataSourceName string
	Folder         string
	GrafanaURL     string
	GrafanaToken   string
	// contains filtered or unexported fields
}

Dashboard is a Wasp dashboard

func NewDashboard

func NewDashboard(reqs []WaspAlert, opts []dashboard.Option) (*Dashboard, error)

NewDashboard initializes a Dashboard with provided alerts and options, using environment variables for configuration. It prepares the dashboard for deployment and returns the instance or an error if setup fails.

func (*Dashboard) Build

func (m *Dashboard) Build(dashboardName, datasourceName string, requirements []WaspAlert) error

Build initializes the Dashboard with the specified name, data source, and alert requirements. It prepares the dashboard builder for further configuration and usage.

func (*Dashboard) Deploy

func (m *Dashboard) Deploy() (*grabana.Dashboard, error)

Deploy uploads the Dashboard to Grafana, creating the folder if necessary. It returns the deployed grabana.Dashboard and any encountered error.

func (*Dashboard) JSON

func (m *Dashboard) JSON() ([]byte, error)

JSON serializes the Dashboard into indented JSON format. It provides a human-readable representation, useful for exporting or inspecting the dashboard.

type WaspAlert

type WaspAlert struct {
	Name                 string
	AlertType            string
	TestName             string
	GenName              string
	RequirementGroupName string
	AlertIf              alert.ConditionEvaluator
	CustomAlert          timeseries.Option
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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