Documentation ¶
Index ¶
- Variables
- func CurrentKernelVersion() (uint32, error)
- func LinuxKernelVersionCode(major, minor, patch uint32) uint32
- func V4IPString(addr uint32) string
- func V6IPString(addr_h, addr_l uint64) string
- type ConnTupleV4
- type ConnectionFamily
- type ConnectionStats
- func (c ConnectionStats) ByteKey(buffer *bytes.Buffer) ([]byte, error)
- func (c ConnectionStats) Copy() ConnectionStats
- func (c ConnectionStats) GetConnection() ConnTupleV4
- func (v ConnectionStats) MarshalEasyJSON(w *jwriter.Writer)
- func (v ConnectionStats) MarshalJSON() ([]byte, error)
- func (c ConnectionStats) String() string
- func (v *ConnectionStats) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *ConnectionStats) UnmarshalJSON(data []byte) error
- func (c ConnectionStats) WithNamespace(namespace string) ConnectionStats
- func (c ConnectionStats) WithOnlyLocal() ConnectionStats
- func (c ConnectionStats) WithUnknownDirection() ConnectionStats
- type ConnectionType
- type Connections
- type Direction
- type EventError
- type HTTPResponse
- type Metric
- type MySQLGreeting
- type PerfEvent
- type State
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotImplemented = errors.New("BPF-based network tracing not implemented on non-linux systems")
)
Functions ¶
func CurrentKernelVersion ¶
func LinuxKernelVersionCode ¶
func V4IPString ¶
func V6IPString ¶
Types ¶
type ConnTupleV4 ¶
func (*ConnTupleV4) Matches ¶
func (ct *ConnTupleV4) Matches(stats *ConnectionStats) bool
type ConnectionFamily ¶
type ConnectionFamily uint8
const ( AF_INET ConnectionFamily = 0 AF_INET6 ConnectionFamily = 1 )
type ConnectionStats ¶
type ConnectionStats struct { Pid uint32 `json:"pid"` Type ConnectionType `json:"type"` Family ConnectionFamily `json:"family"` ApplicationProtocol string `json:"app_proto"` // Local & Remote represented as a string to handle both IPv4 & IPv6 Local string `json:"local"` Remote string `json:"remote"` LocalPort uint16 `json:"lport"` RemotePort uint16 `json:"rport"` Direction Direction `json:"direction"` State State `json:"state"` NetworkNamespace string `json:"network_namespace"` SendBytes uint64 `json:"send_bytes"` RecvBytes uint64 `json:"recv_bytes"` Metrics []Metric `json:"metrics"` }
func (ConnectionStats) ByteKey ¶
func (c ConnectionStats) ByteKey(buffer *bytes.Buffer) ([]byte, error)
func (ConnectionStats) Copy ¶
func (c ConnectionStats) Copy() ConnectionStats
func (ConnectionStats) GetConnection ¶
func (c ConnectionStats) GetConnection() ConnTupleV4
func (ConnectionStats) MarshalEasyJSON ¶
func (v ConnectionStats) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConnectionStats) MarshalJSON ¶
func (v ConnectionStats) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (ConnectionStats) String ¶
func (c ConnectionStats) String() string
func (*ConnectionStats) UnmarshalEasyJSON ¶
func (v *ConnectionStats) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConnectionStats) UnmarshalJSON ¶
func (v *ConnectionStats) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (ConnectionStats) WithNamespace ¶
func (c ConnectionStats) WithNamespace(namespace string) ConnectionStats
enriches the connection stats with namespace if it's a localhost connection
func (ConnectionStats) WithOnlyLocal ¶
func (c ConnectionStats) WithOnlyLocal() ConnectionStats
func (ConnectionStats) WithUnknownDirection ¶
func (c ConnectionStats) WithUnknownDirection() ConnectionStats
type ConnectionType ¶
type ConnectionType uint8
const ( TCP ConnectionType = 0 UDP ConnectionType = 1 )
func (ConnectionType) String ¶
func (c ConnectionType) String() string
type Connections ¶
type Connections struct {
Conns []ConnectionStats `json:"connections"`
}
func (Connections) MarshalEasyJSON ¶
func (v Connections) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Connections) MarshalJSON ¶
func (v Connections) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Connections) UnmarshalEasyJSON ¶
func (v *Connections) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Connections) UnmarshalJSON ¶
func (v *Connections) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EventError ¶
type EventError struct {
Code int
}
type HTTPResponse ¶
type HTTPResponse struct { Connection ConnTupleV4 StatusCode int ResponseTime time.Duration }
type Metric ¶
func (Metric) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Metric) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Metric) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Metric) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type MySQLGreeting ¶
type MySQLGreeting struct { Connection ConnTupleV4 ProtocolVersion int }
type PerfEvent ¶
type PerfEvent struct { HTTPResponse *HTTPResponse MySQLGreeting *MySQLGreeting Timestamp time.Time Error *EventError }