events

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCircuitEventHandler added in v0.16.92

func AddCircuitEventHandler(handler network.CircuitEventHandler)

func AddFilteredMetricsEventHandler added in v0.17.36

func AddFilteredMetricsEventHandler(sourceFilter *regexp.Regexp, metricFilter *regexp.Regexp, handler MetricsEventHandler) func()

func AddMetricsMapper added in v0.16.126

func AddMetricsMapper(mapper MetricsMapper)

func AddRouterEventHandler added in v0.16.56

func AddRouterEventHandler(handler RouterEventHandler)

func AddServiceEventHandler added in v0.16.23

func AddServiceEventHandler(handler ServiceEventHandler)

func AddTerminatorEventHandler added in v0.15.6

func AddTerminatorEventHandler(handler TerminatorEventHandler)

func AddTraceEventHandler

func AddTraceEventHandler(handler trace.EventHandler)

func ExtractId added in v0.16.10

func ExtractId(name string, prefix string, suffixLen int) (string, string)

func InitNetwork added in v0.16.126

func InitNetwork(n *network.Network)

func InitRouterEventRouter added in v0.16.56

func InitRouterEventRouter(n *network.Network)

func InitTerminatorEventRouter added in v0.15.6

func InitTerminatorEventRouter(n *network.Network)

func NewFileEventLogger added in v0.14.9

func NewFileEventLogger(formatterFactory LoggingHandlerFactory, stdout bool, config map[interface{}]interface{}) (interface{}, error)

func NewFilteredMetricsAdapter added in v0.17.142

func NewFilteredMetricsAdapter(sourceFilter *regexp.Regexp, metricFilter *regexp.Regexp, handler MetricsEventHandler) metrics.MessageHandler

func RegisterCircuitEventHandler added in v0.16.92

func RegisterCircuitEventHandler(handler CircuitEventHandler) func()

func RegisterEventHandler added in v0.14.9

func RegisterEventHandler(id interface{}, config map[interface{}]interface{})

func RegisterEventHandlerType added in v0.14.9

func RegisterEventHandlerType(eventHandlerType string, factory EventHandlerFactory)

func RegisterEventType added in v0.14.9

func RegisterEventType(eventType string, registrationHandler registrationHandler)

func RegisterUsageEventHandler added in v0.16.12

func RegisterUsageEventHandler(handler UsageEventHandler) func()

func RemoveCircuitEventHandler added in v0.16.92

func RemoveCircuitEventHandler(handler network.CircuitEventHandler)

func RemoveRouterEventHandler added in v0.16.56

func RemoveRouterEventHandler(handler RouterEventHandler)

func RemoveServiceEventHandler added in v0.16.23

func RemoveServiceEventHandler(handler ServiceEventHandler)

func RemoveTerminatorEventHandler added in v0.15.6

func RemoveTerminatorEventHandler(handler TerminatorEventHandler)

func RemoveTraceEventHandler

func RemoveTraceEventHandler(handler trace.EventHandler)

func WireEventHandlers added in v0.14.9

func WireEventHandlers(serviceEventInitializer func(handler metrics.Handler)) error

* Example configuration: events:

jsonLogger:
  subscriptions:
    - type: metrics
      sourceFilter: .*
      metricFilter: .*xgress.*tx*.m1_rate
    - type: fabric.circuits
      include:
        - created
    - type: edge.sessions
      include:
        - created
  handler:
    type: file
    format: json
    path: /tmp/ziti-events.log

Types

type BaseFormatter added in v0.14.9

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

func (*BaseFormatter) AcceptLoggingEvent added in v0.14.9

func (f *BaseFormatter) AcceptLoggingEvent(event LoggingEvent)

func (*BaseFormatter) Run added in v0.14.9

func (f *BaseFormatter) Run()

type CircuitEvent added in v0.16.92

type CircuitEvent struct {
	Namespace              string         `json:"namespace"`
	EventType              string         `json:"event_type"`
	CircuitId              string         `json:"circuit_id"`
	Timestamp              time.Time      `json:"timestamp"`
	ClientId               string         `json:"client_id"`
	ServiceId              string         `json:"service_id"`
	CreationTimespan       *time.Duration `json:"creation_timespan"`
	Path                   string         `json:"path"`
	TerminatorLocalAddress string         `json:"terminator_local_address"`
	LinkCount              int            `json:"link_count"`
	Cost                   *uint32        `json:"path_cost"`
}

func (*CircuitEvent) String added in v0.16.92

func (event *CircuitEvent) String() string

type CircuitEventHandler added in v0.16.92

type CircuitEventHandler interface {
	AcceptCircuitEvent(event *CircuitEvent)
}

type EventHandlerFactory added in v0.14.9

type EventHandlerFactory interface {
	NewEventHandler(config map[interface{}]interface{}) (interface{}, error)
}

type FileEventLoggerFactory added in v0.14.9

type FileEventLoggerFactory struct{}

func (FileEventLoggerFactory) NewEventHandler added in v0.14.9

func (FileEventLoggerFactory) NewEventHandler(config map[interface{}]interface{}) (interface{}, error)

type JsonFabricCircuitEvent added in v0.16.92

type JsonFabricCircuitEvent CircuitEvent

func (*JsonFabricCircuitEvent) WriteTo added in v0.16.92

func (event *JsonFabricCircuitEvent) WriteTo(output io.WriteCloser) error

type JsonFormatter added in v0.14.9

type JsonFormatter struct {
	BaseFormatter
}

func NewJsonFormatter added in v0.14.9

func NewJsonFormatter(queueDepth int, output io.WriteCloser) *JsonFormatter

func (*JsonFormatter) AcceptCircuitEvent added in v0.16.92

func (formatter *JsonFormatter) AcceptCircuitEvent(event *CircuitEvent)

func (*JsonFormatter) AcceptMetricsEvent added in v0.14.9

func (formatter *JsonFormatter) AcceptMetricsEvent(event *MetricsEvent)

func (*JsonFormatter) AcceptRouterEvent added in v0.16.56

func (formatter *JsonFormatter) AcceptRouterEvent(event *RouterEvent)

func (*JsonFormatter) AcceptServiceEvent added in v0.16.23

func (formatter *JsonFormatter) AcceptServiceEvent(event *ServiceEvent)

func (*JsonFormatter) AcceptTerminatorEvent added in v0.15.6

func (formatter *JsonFormatter) AcceptTerminatorEvent(event *TerminatorEvent)

func (*JsonFormatter) AcceptUsageEvent added in v0.14.9

func (formatter *JsonFormatter) AcceptUsageEvent(event *UsageEvent)

type JsonMetricsEvent added in v0.14.9

type JsonMetricsEvent MetricsEvent

func (*JsonMetricsEvent) WriteTo added in v0.14.9

func (event *JsonMetricsEvent) WriteTo(output io.WriteCloser) error

type JsonRouterEvent added in v0.16.56

type JsonRouterEvent RouterEvent

func (*JsonRouterEvent) WriteTo added in v0.16.56

func (event *JsonRouterEvent) WriteTo(output io.WriteCloser) error

type JsonServiceEvent added in v0.16.23

type JsonServiceEvent ServiceEvent

func (*JsonServiceEvent) WriteTo added in v0.16.23

func (event *JsonServiceEvent) WriteTo(output io.WriteCloser) error

type JsonTerminatorEvent added in v0.15.6

type JsonTerminatorEvent TerminatorEvent

func (*JsonTerminatorEvent) WriteTo added in v0.15.6

func (event *JsonTerminatorEvent) WriteTo(output io.WriteCloser) error

type JsonUsageEvent added in v0.14.9

type JsonUsageEvent UsageEvent

func (*JsonUsageEvent) WriteTo added in v0.14.9

func (event *JsonUsageEvent) WriteTo(output io.WriteCloser) error

type LoggingEvent added in v0.14.9

type LoggingEvent interface {
	WriteTo(output io.WriteCloser) error
}

type LoggingHandlerFactory added in v0.14.9

type LoggingHandlerFactory interface {
	NewLoggingHandler(format string, buffer int, out io.WriteCloser) (interface{}, error)
}

type MetricsEvent added in v0.14.9

type MetricsEvent struct {
	MetricType     string                 `json:"metric_type" mapstructure:"metric_type"`
	Namespace      string                 `json:"namespace"`
	SourceAppId    string                 `json:"source_id" mapstructure:"source_id"`
	SourceEntityId string                 `json:"source_entity_id,omitempty"  mapstructure:"source_entity_id,omitempty"`
	Version        uint32                 `json:"version"`
	Timestamp      *timestamppb.Timestamp `json:"timestamp"`
	Metric         string                 `json:"metric"`
	Metrics        map[string]interface{} `json:"metrics"`
	Tags           map[string]string      `json:"tags,omitempty"`
	SourceEventId  string                 `json:"source_event_id" mapstructure:"source_event_id"`
}

type MetricsEventHandler added in v0.14.9

type MetricsEventHandler interface {
	AcceptMetricsEvent(event *MetricsEvent)
}

type MetricsHandlerF added in v0.17.36

type MetricsHandlerF func(event *MetricsEvent)

func (MetricsHandlerF) AcceptMetricsEvent added in v0.17.36

func (self MetricsHandlerF) AcceptMetricsEvent(event *MetricsEvent)

type MetricsMapper added in v0.16.126

type MetricsMapper func(msg *metrics_pb.MetricsMessage, event *MetricsEvent)

type PlainTextFabricCircuitEvent added in v0.16.92

type PlainTextFabricCircuitEvent CircuitEvent

func (*PlainTextFabricCircuitEvent) WriteTo added in v0.16.92

func (event *PlainTextFabricCircuitEvent) WriteTo(output io.WriteCloser) error

type PlainTextFormatter added in v0.14.9

type PlainTextFormatter struct {
	BaseFormatter
}

func NewPlainTextFormatter added in v0.14.9

func NewPlainTextFormatter(queueDepth int, output io.WriteCloser) *PlainTextFormatter

func (*PlainTextFormatter) AcceptMetricsEvent added in v0.14.9

func (formatter *PlainTextFormatter) AcceptMetricsEvent(event *MetricsEvent)

func (*PlainTextFormatter) AcceptRouterEvent added in v0.16.56

func (formatter *PlainTextFormatter) AcceptRouterEvent(event *RouterEvent)

func (*PlainTextFormatter) AcceptServiceEvent added in v0.16.23

func (formatter *PlainTextFormatter) AcceptServiceEvent(event *ServiceEvent)

func (*PlainTextFormatter) AcceptSessionEvent added in v0.14.9

func (formatter *PlainTextFormatter) AcceptSessionEvent(event *CircuitEvent)

func (*PlainTextFormatter) AcceptTerminatorEvent added in v0.15.6

func (formatter *PlainTextFormatter) AcceptTerminatorEvent(event *TerminatorEvent)

func (*PlainTextFormatter) AcceptUsageEvent added in v0.14.9

func (formatter *PlainTextFormatter) AcceptUsageEvent(event *UsageEvent)

type PlainTextMetricsEvent added in v0.14.9

type PlainTextMetricsEvent MetricsEvent

func (*PlainTextMetricsEvent) WriteTo added in v0.14.9

func (event *PlainTextMetricsEvent) WriteTo(output io.WriteCloser) error

type PlainTextRouterEvent added in v0.16.56

type PlainTextRouterEvent RouterEvent

func (*PlainTextRouterEvent) WriteTo added in v0.16.56

func (event *PlainTextRouterEvent) WriteTo(output io.WriteCloser) error

type PlainTextServiceEvent added in v0.16.23

type PlainTextServiceEvent ServiceEvent

func (*PlainTextServiceEvent) WriteTo added in v0.16.23

func (event *PlainTextServiceEvent) WriteTo(output io.WriteCloser) error

type PlainTextTerminatorEvent added in v0.15.6

type PlainTextTerminatorEvent TerminatorEvent

func (*PlainTextTerminatorEvent) WriteTo added in v0.15.6

func (event *PlainTextTerminatorEvent) WriteTo(output io.WriteCloser) error

type PlainTextUsageEvent added in v0.14.9

type PlainTextUsageEvent UsageEvent

func (*PlainTextUsageEvent) WriteTo added in v0.14.9

func (event *PlainTextUsageEvent) WriteTo(output io.WriteCloser) error

type PrometheusMetricsEvent added in v0.17.142

type PrometheusMetricsEvent MetricsEvent

func (*PrometheusMetricsEvent) Marshal added in v0.17.142

func (event *PrometheusMetricsEvent) Marshal() ([]byte, error)

func (*PrometheusMetricsEvent) WriteTo added in v0.17.142

func (event *PrometheusMetricsEvent) WriteTo(output io.WriteCloser) error

type RouterEvent added in v0.16.56

type RouterEvent struct {
	Namespace    string    `json:"namespace"`
	EventType    string    `json:"event_type"`
	Timestamp    time.Time `json:"timestamp"`
	RouterId     string    `json:"router_id"`
	RouterOnline bool      `json:"router_online"`
}

func (*RouterEvent) String added in v0.16.56

func (event *RouterEvent) String() string

type RouterEventHandler added in v0.16.56

type RouterEventHandler interface {
	AcceptRouterEvent(event *RouterEvent)
}

type ServiceEvent added in v0.16.23

type ServiceEvent struct {
	Namespace        string `json:"namespace"`
	Version          uint32 `json:"version"`
	EventType        string `json:"event_type"`
	ServiceId        string `json:"service_id"`
	TerminatorId     string `json:"terminator_id"`
	Count            uint64 `json:"count"`
	IntervalStartUTC int64  `json:"interval_start_utc"`
	IntervalLength   uint64 `json:"interval_length"`
}

func (*ServiceEvent) String added in v0.16.23

func (event *ServiceEvent) String() string

type ServiceEventHandler added in v0.16.23

type ServiceEventHandler interface {
	AcceptServiceEvent(event *ServiceEvent)
}

type StdOutLoggerFactory added in v0.14.9

type StdOutLoggerFactory struct{}

func (StdOutLoggerFactory) NewEventHandler added in v0.14.9

func (StdOutLoggerFactory) NewEventHandler(config map[interface{}]interface{}) (interface{}, error)

type TerminatorEvent added in v0.15.6

type TerminatorEvent struct {
	Namespace                 string    `json:"namespace"`
	EventType                 string    `json:"event_type"`
	Timestamp                 time.Time `json:"timestamp"`
	ServiceId                 string    `json:"service_id"`
	TerminatorId              string    `json:"terminator_id"`
	RouterId                  string    `json:"router_id"`
	RouterOnline              bool      `json:"router_online"`
	Precedence                string    `json:"precedence"`
	StaticCost                uint16    `json:"static_cost"`
	DynamicCost               uint16    `json:"dynamic_cost"`
	TotalTerminators          int       `json:"total_terminators"`
	UsableDefaultTerminators  int       `json:"usable_default_terminators"`
	UsableRequiredTerminators int       `json:"usable_required_terminators"`
}

func (*TerminatorEvent) String added in v0.15.6

func (event *TerminatorEvent) String() string

type TerminatorEventHandler added in v0.15.6

type TerminatorEventHandler interface {
	AcceptTerminatorEvent(event *TerminatorEvent)
}

type UsageEvent added in v0.14.9

type UsageEvent struct {
	Namespace        string `json:"namespace"`
	Version          uint32 `json:"version"`
	EventType        string `json:"event_type"`
	SourceId         string `json:"source_id"`
	CircuitId        string `json:"circuit_id"`
	Usage            uint64 `json:"usage"`
	IntervalStartUTC int64  `json:"interval_start_utc"`
	IntervalLength   uint64 `json:"interval_length"`
}

func (*UsageEvent) String added in v0.14.9

func (event *UsageEvent) String() string

type UsageEventHandler added in v0.14.9

type UsageEventHandler interface {
	AcceptUsageEvent(event *UsageEvent)
}

Jump to

Keyboard shortcuts

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