Documentation
¶
Index ¶
- Constants
- func FilePathFromTarget(target string) (string, error)
- func GetBootTime() *time.Time
- func GetHostName() string
- type BatchRecord
- type DiscardSink
- type Exporter
- func (e *Exporter) Close() error
- func (e *Exporter) IngestAgentEvent(ctx context.Context, channel <-chan *RecordAgentEvent)
- func (e *Exporter) IngestEvents(ctx context.Context, endpoint string, producer func() ([]any, bool))
- func (e *Exporter) IngestExecEvent(ctx context.Context, channel <-chan *RawExec)
- func (e *Exporter) IngestFileOpEvent(ctx context.Context, channel <-chan *RawFileOp)
- func (e *Exporter) IngestPostgresEvent(ctx context.Context, channel <-chan *RawPostgres)
- func (e *Exporter) IngestRequestEvent(ctx context.Context, channel <-chan *RawRequest)
- func (e *Exporter) IngestResponseEvent(ctx context.Context, channel <-chan *RawResponse)
- func (e *Exporter) IngestStdIOEvent(ctx context.Context, channel <-chan *RawStdIO)
- func (e *Exporter) IngestTCPConnectEvent(ctx context.Context, channel <-chan *RawTCPConnect)
- type GatewaySink
- type JSONLRecord
- type JSONLSink
- type MCP
- type RawExec
- type RawFileOp
- type RawPostgres
- type RawRecord
- type RawRequest
- type RawResponse
- type RawStdIO
- type RawTCPConnect
- type RecordAgentEvent
- type RecordExec
- type RecordFileOp
- type RecordPostgres
- type RecordRequest
- type RecordResponse
- type RecordStdIO
- type RecordTCPConnect
- type Sink
Constants ¶
View Source
const (
ExportChannelSize = 4096
)
Variables ¶
This section is empty.
Functions ¶
func FilePathFromTarget ¶
func GetBootTime ¶
func GetHostName ¶
func GetHostName() string
Types ¶
type BatchRecord ¶
type BatchRecord struct {
Events []any `json:"events"`
}
type DiscardSink ¶
type DiscardSink struct{}
func NewDiscardSink ¶
func NewDiscardSink() *DiscardSink
func (*DiscardSink) Close ¶
func (s *DiscardSink) Close() error
func (*DiscardSink) WriteBatch ¶
type Exporter ¶
type Exporter struct {
Host string
// contains filtered or unexported fields
}
func (*Exporter) IngestAgentEvent ¶
func (e *Exporter) IngestAgentEvent(ctx context.Context, channel <-chan *RecordAgentEvent)
func (*Exporter) IngestEvents ¶
func (*Exporter) IngestExecEvent ¶
func (*Exporter) IngestFileOpEvent ¶
func (*Exporter) IngestPostgresEvent ¶
func (e *Exporter) IngestPostgresEvent(ctx context.Context, channel <-chan *RawPostgres)
func (*Exporter) IngestRequestEvent ¶
func (e *Exporter) IngestRequestEvent(ctx context.Context, channel <-chan *RawRequest)
func (*Exporter) IngestResponseEvent ¶
func (e *Exporter) IngestResponseEvent(ctx context.Context, channel <-chan *RawResponse)
func (*Exporter) IngestStdIOEvent ¶
func (*Exporter) IngestTCPConnectEvent ¶
func (e *Exporter) IngestTCPConnectEvent(ctx context.Context, channel <-chan *RawTCPConnect)
type GatewaySink ¶
type GatewaySink struct {
// contains filtered or unexported fields
}
func NewGatewaySink ¶
func NewGatewaySink(ctx context.Context, baseURL string) (*GatewaySink, error)
func (*GatewaySink) Close ¶
func (s *GatewaySink) Close() error
func (*GatewaySink) WriteBatch ¶
type JSONLRecord ¶
type JSONLSink ¶
type JSONLSink struct {
// contains filtered or unexported fields
}
func NewJSONLSink ¶
type MCP ¶
type MCP struct {
JSONRPC string `json:"jsonrpc"`
CorrID int `json:"id"`
Result json.RawMessage `json:"result"`
Error json.RawMessage `json:"error"`
Params json.RawMessage `json:"params"`
Method string `json:"method"`
}
type RawExec ¶
type RawFileOp ¶
type RawPostgres ¶
type RawRequest ¶
type RawResponse ¶
type RawStdIO ¶
type RawTCPConnect ¶
type RecordAgentEvent ¶
type RecordAgentEvent struct {
Timestamp time.Time `json:"timestamp"`
Tool string `json:"tool"`
EventName string `json:"event_name"`
EventType string `json:"event_type"`
ConversationID string `json:"conversation_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
Model string `json:"model,omitempty"`
Slug string `json:"slug,omitempty"`
AppVersion string `json:"app_version,omitempty"`
Host string `json:"host"`
Attributes json.RawMessage `json:"attributes"`
Prompt string `json:"prompt,omitempty"`
PromptLength int64 `json:"prompt_length,omitempty"`
ToolName string `json:"tool_name,omitempty"`
CallID string `json:"call_id,omitempty"`
Arguments string `json:"arguments,omitempty"`
Output string `json:"output,omitempty"`
Success bool `json:"success,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
Decision string `json:"decision,omitempty"`
StatusCode int64 `json:"status_code,omitempty"`
CostUSD float64 `json:"cost_usd,omitempty"`
ErrorMsg string `json:"error,omitempty"`
InputTokenCount int64 `json:"input_token_count,omitempty"`
OutputTokenCount int64 `json:"output_token_count,omitempty"`
CachedTokenCount int64 `json:"cached_token_count,omitempty"`
ReasoningTokenCount int64 `json:"reasoning_token_count,omitempty"`
}
type RecordExec ¶
type RecordExec struct {
Timestamp time.Time `json:"timestamp"`
Pid int32 `json:"pid"`
PPid int32 `json:"ppid"`
ExecId string `json:"exec_id"`
PExecId string `json:"p_exec_id"`
Cwd string `json:"cwd"`
Comm string `json:"comm"`
Args string `json:"args"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
}
type RecordFileOp ¶
type RecordFileOp struct {
Timestamp time.Time `json:"timestamp"`
Pid int32 `json:"pid"`
Tid int32 `json:"tid"`
Uid int32 `json:"uid"`
Gid int32 `json:"gid"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
Comm string `json:"comm"`
Op string `json:"op"`
Access string `json:"access,omitempty"`
Path string `json:"path"`
NewPath string `json:"new_path,omitempty"`
Bytes uint64 `json:"bytes,omitempty"`
Flags uint64 `json:"flags,omitempty"`
Create bool `json:"create,omitempty"`
Truncate bool `json:"truncate,omitempty"`
Append bool `json:"append,omitempty"`
}
type RecordPostgres ¶
type RecordPostgres struct {
Timestamp time.Time `json:"timestamp"`
Pid int32 `json:"pid"`
Tid int32 `json:"tid"`
Uid int32 `json:"uid"`
Gid int32 `json:"gid"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
Comm string `json:"comm"`
Data []byte `json:"data"`
MsgType string `json:"msg_type"`
}
type RecordRequest ¶
type RecordRequest struct {
Timestamp time.Time `json:"timestamp"`
// SessionKey is a best-effort correlation key for an observed HTTP exchange.
// It is normally created on the request side, but may be created on the response
// side when the request was not successfully captured or emitted.
SessionKey string `json:"session_key"`
Pid int32 `json:"pid"`
Tid int32 `json:"tid"`
Uid int32 `json:"uid"`
Gid int32 `json:"gid"`
Comm string `json:"comm"`
Method string `json:"method"`
URL string `json:"url"`
Protocol string `json:"protocol"`
ContentLength int64 `json:"content_length"`
Headers json.RawMessage `json:"headers"`
Body []byte `json:"body"`
Truncated bool `json:"truncated"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
}
type RecordResponse ¶
type RecordResponse struct {
Timestamp time.Time `json:"timestamp"`
// SessionKey is a best-effort correlation key for an observed HTTP exchange.
// A response may carry a SessionKey even when the matching request event was not emitted.
SessionKey string `json:"session_key"`
Pid int32 `json:"pid"`
Tid int32 `json:"tid"`
Uid int32 `json:"uid"`
Gid int32 `json:"gid"`
Comm string `json:"comm"`
StatusCode int32 `json:"status_code"`
Protocol string `json:"protocol"`
ContentLength int64 `json:"content_length"`
Headers json.RawMessage `json:"headers"`
Body []byte `json:"body"`
Truncated bool `json:"truncated"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
}
type RecordStdIO ¶
type RecordStdIO struct {
Timestamp time.Time `json:"timestamp"`
Pid int32 `json:"pid"`
Tid int32 `json:"tid"`
Uid int32 `json:"uid"`
Gid int32 `json:"gid"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
MessageType string `json:"message_type"`
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
Result json.RawMessage `json:"result"`
Error json.RawMessage `json:"error"`
CorrID string `json:"corr_id"`
}
type RecordTCPConnect ¶
type RecordTCPConnect struct {
Timestamp time.Time `json:"timestamp"`
Pid int32 `json:"pid"`
Tid int32 `json:"tid"`
Uid int32 `json:"uid"`
Gid int32 `json:"gid"`
Host string `json:"host"`
ContainerID string `json:"container_id"`
Comm string `json:"comm"`
Family uint16 `json:"family"`
TargetAddr string `json:"target_addr"`
TargetPort uint16 `json:"target_port"`
}
Click to show internal directories.
Click to hide internal directories.