dashboard

package
v0.1.64 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMetricsToDashboard

func ConvertMetricsToDashboard(input *DashboardOptions) ([]byte, error)

func ParseMetricsFile

func ParseMetricsFile(filePath string) (map[string]*dto.MetricFamily, error)

Types

type DashboardOptions

type DashboardOptions struct {
	File                string
	Prefix              string
	Title               string
	Description         string
	WidgetWidth         int
	WidgetHeight        int
	TemplateVars        []string
	TemplateVarDefaults []string
	StripPrefixes       []string
	Pretty              bool
	ShowHelp            bool
}

type DataDogDashboard

type DataDogDashboard struct {
	Title             string                     `json:"title,omitempty"`
	Description       string                     `json:"description,omitempty"`
	Widgets           []DataDogWidget            `json:"widgets,omitempty"`
	TemplateVariables []DataDogTemplateVariables `json:"template_variables,omitempty"`
	LayoutType        string                     `json:"layout_type,omitempty"`
	IsReadOnly        bool                       `json:"is_read_only,omitempty"`
	NotifyList        []interface{}              `json:"notify_list,omitempty"`
	ReflowType        string                     `json:"reflow_type,omitempty"`
	ID                string                     `json:"id,omitempty"`
}

func MetricsToDataDog

func MetricsToDataDog(dopts *DashboardOptions, metrics map[string]*dto.MetricFamily) (*DataDogDashboard, error)

type DataDogFormula

type DataDogFormula struct {
	Alias              string        `json:"alias,omitempty"`
	ConditionalFormats []interface{} `json:"conditional_formats,omitempty"`
	Limit              struct {
		Count int    `json:"count,omitempty"`
		Order string `json:"order,omitempty"`
	} `json:"limit,omitempty"`
	CellDisplayMode string `json:"cell_display_mode,omitempty"`
	Formula         string `json:"formula,omitempty"`
}

type DataDogLayout

type DataDogLayout struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width,omitempty"`
	Height int `json:"height,omitempty"`
}

type DataDogQuery

type DataDogQuery struct {
	Query      string `json:"query,omitempty"`
	DataSource string `json:"data_source,omitempty"`
	Name       string `json:"name,omitempty"`
	Aggregator string `json:"aggregator,omitempty"`
}

type DataDogRequest

type DataDogRequest struct {
	Formulas       []DataDogFormula `json:"formulas,omitempty"`
	ResponseFormat string           `json:"response_format,omitempty"`
	Queries        []DataDogQuery   `json:"queries,omitempty"`
	Style          struct {
		Palette   string `json:"palette"`
		LineType  string `json:"line_type"`
		LineWidth string `json:"line_width"`
	} `json:"style"`
}

type DataDogTemplateVariables

type DataDogTemplateVariables struct {
	Name            string   `json:"name,omitempty"`
	Prefix          string   `json:"prefix,omitempty"`
	AvailableValues []string `json:"available_values,omitempty"`
	Default         string   `json:"default,omitempty"`
}

type DataDogWidget

type DataDogWidget struct {
	ID         int64 `json:"id"`
	Definition struct {
		Title           string           `json:"title,omitempty"`
		TitleSize       string           `json:"title_size,omitempty"`
		TitleAlign      string           `json:"title_align,omitempty"`
		Type            string           `json:"type,omitempty"`
		Requests        []DataDogRequest `json:"requests,omitempty"`
		HasSearchBar    string           `json:"has_search_bar,omitempty"`
		ShowLegend      bool             `json:"show_legend,omitempty"`
		LegendLayout    string           `json:"legend_layout,omitempty"`
		LegendColumns   []string         `json:"legend_columns,omitempty"`
		Text            string           `json:"text,omitempty"`
		FontSize        string           `json:"font_size,omitempty"`
		Content         string           `json:"content,omitempty"`
		Widgets         DataDogWidgets   `json:"widgets,omitempty"`
		BackgroundColor string           `json:"background_color,omitempty"`
		LayoutType      string           `json:"layout_type,omitempty"`
		// contains filtered or unexported fields
	} `json:"definition"`
	Layout *DataDogLayout `json:"layout,omitempty"`
}

func NewDataDogCounterWidget

func NewDataDogCounterWidget(dopts *DashboardOptions, mf *dto.MetricFamily) *DataDogWidget

func NewDataDogGaugeWidget

func NewDataDogGaugeWidget(dopts *DashboardOptions, mf *dto.MetricFamily) *DataDogWidget

func NewDataDogGroupWidget

func NewDataDogGroupWidget(dopts *DashboardOptions, title, color string) *DataDogWidget

func NewDataDogHistogramWidget

func NewDataDogHistogramWidget(dopts *DashboardOptions, mf *dto.MetricFamily) *DataDogWidget

func NewDataDogNoteWidget

func NewDataDogNoteWidget(dopts *DashboardOptions, text string) *DataDogWidget

func NewDataDogTextWidget

func NewDataDogTextWidget(dopts *DashboardOptions, text string) *DataDogWidget

type DataDogWidgets

type DataDogWidgets []DataDogWidget

func (DataDogWidgets) Len

func (a DataDogWidgets) Len() int

func (DataDogWidgets) Less

func (a DataDogWidgets) Less(i, j int) bool

func (DataDogWidgets) Swap

func (a DataDogWidgets) Swap(i, j int)

Jump to

Keyboard shortcuts

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