event

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package event provides the event type and its serialization to the DD agent 5 intake format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertType added in v0.55.0

type AlertType string

AlertType represents the alert type of an event

const (
	AlertTypeError   AlertType = "error"
	AlertTypeWarning AlertType = "warning"
	AlertTypeInfo    AlertType = "info"
	AlertTypeSuccess AlertType = "success"
)

Enumeration of the existing event alert types, and their values

func GetAlertTypeFromString

func GetAlertTypeFromString(val string) (AlertType, error)

GetAlertTypeFromString returns the AlertType from its string representation

type Event

type Event struct {
	Title          string                 `json:"msg_title"`
	Text           string                 `json:"msg_text"`
	Ts             int64                  `json:"timestamp"`
	Priority       Priority               `json:"priority,omitempty"`
	Host           string                 `json:"host"`
	Tags           []string               `json:"tags,omitempty"`
	AlertType      AlertType              `json:"alert_type,omitempty"`
	AggregationKey string                 `json:"aggregation_key,omitempty"`
	SourceTypeName string                 `json:"source_type_name,omitempty"`
	EventType      string                 `json:"event_type,omitempty"`
	OriginInfo     taggertypes.OriginInfo `json:"-"` // OriginInfo is not serialized, it's used for origin detection
}

Event holds an event (w/ serialization to DD agent 5 intake format)

func (*Event) String

func (e *Event) String() string

Return a JSON string or "" in case of error during the Marshaling

type Events

type Events []*Event

Events is a collection of Event.

type Priority added in v0.55.0

type Priority string

Priority represents the priority of an event

const (
	PriorityNormal Priority = "normal"
	PriorityLow    Priority = "low"
)

Enumeration of the existing event priorities, and their values

func GetEventPriorityFromString

func GetEventPriorityFromString(val string) (Priority, error)

GetEventPriorityFromString returns the Priority from its string representation

Jump to

Keyboard shortcuts

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