extdetectors

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoIncident       = "No Incidents"
	Anomalous        = "ANOMALOUS"
	ManuallyResolved = "MANUALLY_RESOLVED"
	Ok               = "OK"
	Stopped          = "STOPPED"
)
View Source
const (
	TargetType = "com.steadybit.extension_splunk.detector"
)

Variables

View Source
var (
	RestyClient *resty.Client
)

Functions

func DetectorCheckStatus

func DetectorCheckStatus(ctx context.Context, state *DetectorCheckState, client *resty.Client) (*action_kit_api.StatusResult, error)

func NewDetectorDiscovery

func NewDetectorDiscovery() discovery_kit_sdk.TargetDiscovery

func NewDetectorStateCheckAction

func NewDetectorStateCheckAction() action_kit_sdk.Action[DetectorCheckState]

Types

type AuthorizedWriters

type AuthorizedWriters struct {
	Teams []string `json:"teams"`
	Users []string `json:"users"`
}

type Detector

type Detector struct {
	AuthorizedWriters            AuthorizedWriters    `json:"authorizedWriters"`
	AutoOptimizationDisabled     bool                 `json:"autoOptimizationDisabled"`
	Created                      int64                `json:"created"`
	Creator                      string               `json:"creator"`
	CustomProperties             map[string]any       `json:"customProperties"`
	Description                  string               `json:"description"`
	DetectorOrigin               string               `json:"detectorOrigin"`
	ID                           string               `json:"id"`
	ImportQualifiers             []ImportQualifier    `json:"importQualifiers"`
	LabelResolutions             map[string]int       `json:"labelResolutions"`
	LastOptimized                int64                `json:"lastOptimized"`
	LastUpdated                  int64                `json:"lastUpdated"`
	LastUpdatedBy                string               `json:"lastUpdatedBy"`
	MaxDelay                     int64                `json:"maxDelay"`
	MinDelay                     *int64               `json:"minDelay"` // pointer to handle null values
	Name                         string               `json:"name"`
	OverMTSLimit                 bool                 `json:"overMTSLimit"`
	PackageSpecifications        string               `json:"packageSpecifications"`
	ProgramText                  string               `json:"programText"`
	Rules                        []Rule               `json:"rules"`
	SFMetricsInObjectProgramText []string             `json:"sf_metricsInObjectProgramText"`
	Status                       string               `json:"status"`
	Tags                         []string             `json:"tags"`
	Teams                        []string             `json:"teams"`
	Timezone                     *string              `json:"timezone"` // pointer to handle null values
	VisualizationOptions         VisualizationOptions `json:"visualizationOptions"`
}

type DetectorCheckState

type DetectorCheckState struct {
	DetectorId            string
	DetectorName          string
	CheckNewIncidentsOnly bool
	Start                 time.Time
	End                   time.Time
	ExpectedState         string
	StateCheckMode        string
	StateCheckSuccess     bool
	FailEarly             bool
	// DeviationSeen and DeviationTitle are used in 'fail at end' mode (FailEarly = false) to remember
	// that a deviating state was observed during the step so the failure can be reported once the step ends.
	DeviationSeen  bool
	DeviationTitle string
}

type DetectorStateCheckAction

type DetectorStateCheckAction struct{}

func (*DetectorStateCheckAction) Describe

func (*DetectorStateCheckAction) NewEmptyState

func (m *DetectorStateCheckAction) NewEmptyState() DetectorCheckState

func (*DetectorStateCheckAction) Start

func (*DetectorStateCheckAction) Status

type Event

type Event struct {
	AnomalyState     string           `json:"anomalyState"`
	DetectLabel      string           `json:"detectLabel"`
	DetectorId       string           `json:"detectorId"`
	DetectorName     string           `json:"detectorName"`
	EventAnnotations map[string]any   `json:"event_annotations"`
	ID               string           `json:"id"`
	IncidentId       string           `json:"incidentId"`
	Inputs           map[string]Input `json:"inputs"`
	LinkedTeams      []string         `json:"linkedTeams"`
	Severity         string           `json:"severity"`
	Timestamp        int64            `json:"timestamp"`
}

type Filter

type Filter struct {
	Not      bool     `json:"not"`
	Property string   `json:"property"`
	Values   []string `json:"values"`
}

type ImportQualifier

type ImportQualifier struct {
	Filters []Filter `json:"filters"`
	Metric  string   `json:"metric"`
}

ImportQualifier represents each import qualifier.

type Incident

type Incident struct {
	Active                      bool    `json:"active"`
	AnomalyState                string  `json:"anomalyState"`
	AnomalyStateUpdateTimestamp int64   `json:"anomalyStateUpdateTimestamp"`
	DetectLabel                 string  `json:"detectLabel"`
	DetectorId                  string  `json:"detectorId"`
	DetectorName                string  `json:"detectorName"`
	DisplayBody                 string  `json:"displayBody"`
	Events                      []Event `json:"events"`
	IncidentId                  string  `json:"incidentId"`
	IsMuted                     bool    `json:"isMuted"`
	Severity                    string  `json:"severity"`
	TriggeredNotificationSent   bool    `json:"triggeredNotificationSent"`
	TriggeredWhileMuted         bool    `json:"triggeredWhileMuted"`
}

type Input

type Input struct {
	Key   map[string]string `json:"key,omitempty"`
	Value string            `json:"value"`
}

type PublishLabelOption

type PublishLabelOption struct {
	DisplayName  string  `json:"displayName"`
	Label        string  `json:"label"`
	PaletteIndex *int    `json:"paletteIndex"` // pointer for null values
	ValuePrefix  *string `json:"valuePrefix"`
	ValueSuffix  *string `json:"valueSuffix"`
	ValueUnit    *string `json:"valueUnit"`
}

type Response

type Response struct {
	Count   int        `json:"count"`
	Results []Detector `json:"results"`
}

type Rule

type Rule struct {
	Description          string `json:"description"`
	DetectLabel          string `json:"detectLabel"`
	Disabled             bool   `json:"disabled"`
	Notifications        []any  `json:"notifications"`
	ParameterizedBody    string `json:"parameterizedBody,omitempty"`
	ParameterizedSubject string `json:"parameterizedSubject,omitempty"`
	Severity             string `json:"severity"`
}

type TimeOptions

type TimeOptions struct {
	Range    int64  `json:"range"`
	RangeEnd int64  `json:"rangeEnd"`
	Type     string `json:"type"`
}

type VisualizationOptions

type VisualizationOptions struct {
	DisableSampling     bool                 `json:"disableSampling"`
	PublishLabelOptions []PublishLabelOption `json:"publishLabelOptions"`
	ShowDataMarkers     bool                 `json:"showDataMarkers"`
	ShowEventLines      bool                 `json:"showEventLines"`
	Time                TimeOptions          `json:"time"`
}

Jump to

Keyboard shortcuts

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