github.com/cilium/cilium@v1.16.2/pkg/monitor/agent/consumer/consumer.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package consumer 5 6 // MonitorConsumer is a consumer of decoded monitor events 7 type MonitorConsumer interface { 8 // NotifyAgentEvent informs the consumer about a new monitor event 9 // sent from cilium-agent. The concrete type of the message parameter 10 // depends on the value of typ: 11 // - MessageTypeAccessLog: accesslog.LogRecord 12 // - MessageTypeAgent: api.AgentNotify 13 NotifyAgentEvent(typ int, message interface{}) 14 15 // NotifyPerfEvent informs the consumer about an datapath event obtained 16 // via perf events ring buffer. 17 // Data contains the raw binary encoded perf payload. The underlying type 18 // depends on the value of typ: 19 // - MessageTypeDrop: monitor.DropNotify 20 // - MessageTypeDebug: monitor.DebugMsg 21 // - MessageTypeCapture: monitor.DebugCapture 22 // - MessageTypeTrace: monitor.TraceNotify 23 // - MessageTypePolicyVerdict: monitor.PolicyVerdictNotify 24 NotifyPerfEvent(data []byte, cpu int) 25 26 // NotifyPerfEventLost informs the consumer that a number of events have 27 // been lost due to the perf event ring buffer not being read. 28 NotifyPerfEventLost(numLostEvents uint64, cpu int) 29 }