Documentation
¶
Index ¶
- Constants
- type Config
- type Event
- func (e *Event) Clone() domain.Event
- func (e *Event) DecodeFromBytes(data []byte) error
- func (e *Event) GetComm() string
- func (e *Event) GetPid() uint64
- func (e *Event) GetQuery() string
- func (e *Event) GetTimestamp() uint64
- func (e *Event) IsTruncated() bool
- func (e *Event) PerfMonoNs() uint64
- func (e *Event) String() string
- func (e *Event) StringHex() string
- func (e *Event) Type() domain.EventType
- func (e *Event) UUID() string
- func (e *Event) Validate() error
- type Probe
Constants ¶
const (
// MaxDataSizePostgres is the maximum size of SQL query data captured
MaxDataSizePostgres = 256
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
*config.BaseConfig
PostgresPath string // Path to PostgreSQL binary
FuncName string // Function name to hook (default: exec_simple_query)
Offset uint64 // Function offset (optional, auto-discovered if not set)
}
Config extends BaseConfig with PostgreSQL-specific configuration
func (*Config) GetFuncName ¶
GetFuncName returns the function name to hook
func (*Config) GetPostgresPath ¶
GetPostgresPath returns the PostgreSQL binary path
func (*Config) SetFuncName ¶
SetFuncName sets the function name to hook
func (*Config) SetPostgresPath ¶
SetPostgresPath sets the PostgreSQL binary path
type Event ¶
type Event struct {
Pid uint64 `json:"pid"`
Timestamp uint64 `json:"timestamp"`
Query [MaxDataSizePostgres]uint8 `json:"query"`
Comm [16]uint8 `json:"comm"`
}
Event represents a PostgreSQL query event from eBPF This structure matches the C struct in postgres_kern.c:
struct postgres_event_t {
u64 pid;
u64 timestamp;
char Query[MAX_DATA_SIZE];
char Comm[TASK_COMM_LEN];
};
func (*Event) DecodeFromBytes ¶
DecodeFromBytes decodes the event from raw bytes
func (*Event) GetTimestamp ¶
GetTimestamp returns the event timestamp
func (*Event) IsTruncated ¶
IsTruncated checks if the query was truncated
func (*Event) PerfMonoNs ¶
PerfMonoNs implements domain.MonoNsEvent (ebpf timestamp / bpf_ktime_get_ns).
type Probe ¶
Probe implements PostgreSQL query monitoring using uprobe
func (*Probe) Initialize ¶
Initialize initializes the PostgreSQL probe with the provided configuration