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 ConnTuple
- type ConnectionFamily
- type ConnectionMetric
- type ConnectionMetricValue
- type ConnectionStats
- func (c ConnectionStats) ByteKey(buffer *bytes.Buffer) ([]byte, error)
- func (c ConnectionStats) Copy() ConnectionStats
- func (c ConnectionStats) GetConnection() ConnTuple
- 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 HTTPResponse
- type Histogram
- type MetricName
- 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 ConnTuple ¶
func (*ConnTuple) Matches ¶
func (ct *ConnTuple) Matches(stats *ConnectionStats) bool
type ConnectionFamily ¶
type ConnectionFamily uint8
const ( AF_INET ConnectionFamily = 0 AF_INET6 ConnectionFamily = 1 )
type ConnectionMetric ¶
type ConnectionMetric struct { Name MetricName `json:"name"` Tags map[string]string `json:"tags"` Value ConnectionMetricValue `json:"value"` }
func (ConnectionMetric) MarshalEasyJSON ¶
func (v ConnectionMetric) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConnectionMetric) MarshalJSON ¶
func (v ConnectionMetric) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConnectionMetric) UnmarshalEasyJSON ¶
func (v *ConnectionMetric) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConnectionMetric) UnmarshalJSON ¶
func (v *ConnectionMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConnectionMetricValue ¶
type ConnectionMetricValue struct {
Histogram *Histogram `json:"ddsketch"`
}
type ConnectionStats ¶
type ConnectionStats struct { Pid uint32 `json:"pid"` Type ConnectionType `json:"type"` Family ConnectionFamily `json:"family"` // 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"` ApplicationProtocol string `json:"app_proto"` Metrics []ConnectionMetric `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() ConnTuple
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 HTTPResponse ¶
type MetricName ¶
type MetricName string
const ( // HTTPResponseTime is for the metric that is sent with a connection HTTPResponseTime MetricName = "http_response_time_seconds" // HTTPRequestsPerSecond is for the metric that is sent with a connection HTTPRequestsPerSecond MetricName = "http_requests_per_second" // HTTPStatusCodeTagName Status Code tag name HTTPStatusCodeTagName = "code" )
type MySQLGreeting ¶
type MySQLGreeting struct {
ProtocolVersion int
}
type PerfEvent ¶
type PerfEvent struct { HTTPResponse *HTTPResponse MySQLGreeting *MySQLGreeting Connection *ConnTuple Timestamp time.Time }