event

package
Version: v2.5.2-0...-f3a5e34 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category int32

Category define how to display the Category. Category enumerations need to be in sync with com_signalfx_metrics_protobuf

const (
	// USERDEFINED - Created by user via UI or API, e.g. a deployment event
	USERDEFINED Category = 1000000

	// ALERT - Output by anomaly detectors
	ALERT Category = 100000

	// AUDIT - Audit trail events
	AUDIT Category = 200000

	// JOB - Generated by analytics server
	JOB Category = 300000

	// COLLECTD - (deprecated in favor of agent) Event originated within collectd
	COLLECTD Category = 400000

	// SERVICEDISCOVERY - Service discovery event
	SERVICEDISCOVERY Category = 500000

	// EXCEPTION - Created by exception appenders to denote exceptional events
	EXCEPTION Category = 700000

	// AGENT - Event originated within an agent
	AGENT Category = 2000000
)

func ToProtoEC

ToProtoEC - Converts a protbuf EventCategory to type event.Category

type Event

type Event struct {
	// EventType encodes where the event came from and some of the meaning
	EventType string
	// Category of the event created
	Category Category
	// Dimensions of what is being measured.  They are intrinsic.  Contributes to the identity of
	// the metric. If this changes, we get a new metric identifier
	Dimensions map[string]string
	// Properties is information that's not particularly important to the event, but may be
	// important to the pipeline that uses the event.  They are extrinsic.  It provides additional
	// information about the metric. changes in this set doesn't change the metric identity
	Properties map[string]interface{}
	Timestamp  time.Time
	// Meta is for internal purposes, it does not come in or leave with it.
	Meta map[interface{}]interface{}
}

An Event is a noteworthy occurrence of something

func New

func New(eventType string, category Category, dimensions map[string]string, timestamp time.Time) *Event

New creates a new event with empty meta data

func NewWithProperties

func NewWithProperties(eventType string, category Category, dimensions map[string]string, properties map[string]interface{}, timestamp time.Time) *Event

NewWithProperties creates a new event with passed metadata

func (*Event) String

func (e *Event) String() string

Source Files

Jump to

Keyboard shortcuts

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