generation

package
v0.0.0-...-fee3e32 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrometheusAlertManagerFormat = iota
	PrometheusOperatorFormat
)
View Source
const AlertMetricsTemplate = `boulevard-alert-rules: "{{ .AlertsCount }}"
boulevard-unique-metrics: "{{ .UniqueMetricsCount }}"`
View Source
const BadPrefix = "__bad__"
View Source
const DefaultDashboardTemplate = `` /* 6283-byte string literal not displayed */
View Source
const PromenadePkg = "github.com/poblish/promenade/api.PrometheusMetrics"

Variables

This section is empty.

Functions

func FriendlyFileName

func FriendlyFileName(path string) string

Types

type AlertDefaults

type AlertDefaults struct {
	// contains filtered or unexported fields
}

type AlertMetrics

type AlertMetrics struct {
	Count int
}

type AlertMetricsOutput

type AlertMetricsOutput struct {
	AlertsCount        int
	UniqueMetricsCount int
}

func (AlertMetricsOutput) WriteToFile

func (a AlertMetricsOutput) WriteToFile(outputpath string)

type AlertRule

type AlertRule interface {
	// contains filtered or unexported methods
}

type AlertRuleOutput

type AlertRuleOutput struct {
	Alert       string
	Expr        string
	Duration    string
	Labels      map[string]string
	Annotations map[string]string
}

type AlertRulesGroup

type AlertRulesGroup struct {
	Name  string
	Rules []AlertRuleOutput
}

type DashboardGenerator

type DashboardGenerator struct {
	RuleGenerator

	DefaultMetricsPrefix string
	DashboardUid         string
	DashboardTitle       string
	// contains filtered or unexported fields
}

func (*DashboardGenerator) DiscoverMetrics

func (dg *DashboardGenerator) DiscoverMetrics(loadedPkgs []*packages.Package) ([]*metric, error)

func (*DashboardGenerator) GenerateAlertRules

func (dg *DashboardGenerator) GenerateAlertRules(filePath string, options OutputOptions) (AlertMetrics, error)

func (*DashboardGenerator) GenerateGrafanaDashboard

func (dg *DashboardGenerator) GenerateGrafanaDashboard(destFilePath string, metrics []*metric, dashboardTags []string, externalMetricNames []string) error

type ElevatedErrorRateAlertRule

type ElevatedErrorRateAlertRule struct {
	AlertRule
	// contains filtered or unexported fields
}

type OutputOptions

type OutputOptions struct {
	AlertRuleFormat int
	ExtraLabels     []string
}

type PrometheusOperatorAlertRuleOutput

type PrometheusOperatorAlertRuleOutput struct {
	Alert       string
	Expr        string
	For         string
	Labels      map[string]string
	Annotations map[string]string
}

type PrometheusOperatorAlertRulesGroup

type PrometheusOperatorAlertRulesGroup struct {
	Name  string
	Rules []PrometheusOperatorAlertRuleOutput
}

type RuleGenerator

type RuleGenerator struct {
	// contains filtered or unexported fields
}

type ZeroToleranceErrorAlertRule

type ZeroToleranceErrorAlertRule struct {
	AlertRule
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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