observerdb

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBatchAlreadyClosed = errors.New("batch already closed")
)

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
	SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
}

type GetGuardrailSubjectScopeRow added in v0.31.0

type GetGuardrailSubjectScopeRow struct {
	OrganizationID string `json:"organization_id"`
	WorkspaceID    string `json:"workspace_id"`
}

type GuardrailEventChangedParams added in v0.31.0

type GuardrailEventChangedParams struct {
	Evaluation []byte `json:"evaluation"`
	Revision   string `json:"revision"`
	ID         string `json:"id"`
}

type InsertAppOperationBatchResults added in v0.30.0

type InsertAppOperationBatchResults struct {
	// contains filtered or unexported fields
}

func (*InsertAppOperationBatchResults) Close added in v0.30.0

func (*InsertAppOperationBatchResults) QueryRow added in v0.30.0

func (b *InsertAppOperationBatchResults) QueryRow(f func(int, int64, error))

type InsertAppOperationParams added in v0.30.0

type InsertAppOperationParams struct {
	OrganizationID    string        `json:"organization_id"`
	WorkspaceID       string        `json:"workspace_id"`
	ClientID          string        `json:"client_id"`
	AppName           string        `json:"app_name"`
	GrantID           string        `json:"grant_id"`
	UserID            string        `json:"user_id"`
	ResourceKind      string        `json:"resource_kind"`
	ResourceNamespace string        `json:"resource_namespace"`
	ResourceName      string        `json:"resource_name"`
	ResourceUid       string        `json:"resource_uid"`
	TargetID          string        `json:"target_id"`
	TraceID           []byte        `json:"trace_id"`
	SpanID            []byte        `json:"span_id"`
	ParentSpanID      []byte        `json:"parent_span_id"`
	StartTime         time.Time     `json:"start_time"`
	EndTime           time.Time     `json:"end_time"`
	DurationNs        int64         `json:"duration_ns"`
	Name              string        `json:"name"`
	SpanClass         string        `json:"span_class"`
	OperationName     string        `json:"operation_name"`
	StatusCode        string        `json:"status_code"`
	ErrorType         string        `json:"error_type"`
	ErrorMessage      string        `json:"error_message"`
	Model             string        `json:"model"`
	ToolName          string        `json:"tool_name"`
	SessionID         string        `json:"session_id"`
	TurnID            string        `json:"turn_id"`
	AgentKind         string        `json:"agent_kind"`
	ToolCallID        string        `json:"tool_call_id"`
	InputTokens       pgtype.Int8   `json:"input_tokens"`
	OutputTokens      pgtype.Int8   `json:"output_tokens"`
	ReasoningTokens   pgtype.Int8   `json:"reasoning_tokens"`
	CachedInputTokens pgtype.Int8   `json:"cached_input_tokens"`
	CachedWriteTokens pgtype.Int8   `json:"cached_write_tokens"`
	CostUsd           pgtype.Float8 `json:"cost_usd"`
	OutputMessages    []byte        `json:"output_messages"`
	InputMessages     []byte        `json:"input_messages"`
	ToolArguments     []byte        `json:"tool_arguments"`
	ToolResult        []byte        `json:"tool_result"`
	ToolError         []byte        `json:"tool_error"`
}

type InsertFileEventsParams

type InsertFileEventsParams struct {
	TenantNamespace   string    `json:"tenant_namespace"`
	AgentName         string    `json:"agent_name"`
	EventTime         time.Time `json:"event_time"`
	PodNamespace      string    `json:"pod_namespace"`
	PodName           string    `json:"pod_name"`
	FilePathAccessed  string    `json:"file_path_accessed"`
	Process           string    `json:"process"`
	CommandInvocation string    `json:"command_invocation"`
	Action            string    `json:"action"`
	Source            string    `json:"source"`
}

type InsertGuardrailEventParams added in v0.31.0

type InsertGuardrailEventParams struct {
	ID             string    `json:"id"`
	OrganizationID string    `json:"organization_id"`
	WorkspaceID    string    `json:"workspace_id"`
	OccurredAt     time.Time `json:"occurred_at"`
	ExpiresAt      time.Time `json:"expires_at"`
	SandboxName    string    `json:"sandbox_name"`
	AgentName      string    `json:"agent_name"`
	ClientID       string    `json:"client_id"`
	SessionID      string    `json:"session_id"`
	Model          string    `json:"model"`
	TraceID        []byte    `json:"trace_id"`
	SpanID         []byte    `json:"span_id"`
	Revision       string    `json:"revision"`
	Phase          string    `json:"phase"`
	Action         string    `json:"action"`
	Evaluation     []byte    `json:"evaluation"`
}

type InsertGuardrailRequestParams added in v0.31.0

type InsertGuardrailRequestParams struct {
	TraceID   []byte    `json:"trace_id"`
	SpanID    []byte    `json:"span_id"`
	ExpiresAt time.Time `json:"expires_at"`
	Body      []byte    `json:"body"`
}

type InsertMCPToolInvocationBatchResults

type InsertMCPToolInvocationBatchResults struct {
	// contains filtered or unexported fields
}

func (*InsertMCPToolInvocationBatchResults) Close

func (*InsertMCPToolInvocationBatchResults) Exec

func (b *InsertMCPToolInvocationBatchResults) Exec(f func(int, error))

type InsertMCPToolInvocationParams

type InsertMCPToolInvocationParams struct {
	TenantNamespace   string    `json:"tenant_namespace"`
	AgentName         string    `json:"agent_name"`
	TraceID           []byte    `json:"trace_id"`
	SpanID            []byte    `json:"span_id"`
	StartTime         time.Time `json:"start_time"`
	EndTime           time.Time `json:"end_time"`
	DurationNs        int64     `json:"duration_ns"`
	McpConnectionName string    `json:"mcp_connection_name"`
	ToolName          string    `json:"tool_name"`
	SessionID         string    `json:"session_id"`
	Failed            bool      `json:"failed"`
}

type InsertNetworkEventsParams

type InsertNetworkEventsParams struct {
	TenantNamespace   string    `json:"tenant_namespace"`
	AgentName         string    `json:"agent_name"`
	EventTime         time.Time `json:"event_time"`
	PodNamespace      string    `json:"pod_namespace"`
	PodName           string    `json:"pod_name"`
	DestinationDomain string    `json:"destination_domain"`
	DestinationIp     string    `json:"destination_ip"`
	DestinationPort   int64     `json:"destination_port"`
	Protocol          string    `json:"protocol"`
	Action            string    `json:"action"`
	Source            string    `json:"source"`
}

type InsertProcessEventsParams

type InsertProcessEventsParams struct {
	TenantNamespace   string    `json:"tenant_namespace"`
	AgentName         string    `json:"agent_name"`
	EventTime         time.Time `json:"event_time"`
	PodNamespace      string    `json:"pod_namespace"`
	PodName           string    `json:"pod_name"`
	Process           string    `json:"process"`
	ParentProcess     string    `json:"parent_process"`
	CommandInvocation string    `json:"command_invocation"`
	Action            string    `json:"action"`
	Source            string    `json:"source"`
}

type InsertTraceSpanBatchResults

type InsertTraceSpanBatchResults struct {
	// contains filtered or unexported fields
}

func (*InsertTraceSpanBatchResults) Close

func (*InsertTraceSpanBatchResults) Exec

func (b *InsertTraceSpanBatchResults) Exec(f func(int, error))

type InsertTraceSpanParams

type InsertTraceSpanParams struct {
	TenantNamespace    string    `json:"tenant_namespace"`
	AgentName          string    `json:"agent_name"`
	SessionID          string    `json:"session_id"`
	TraceID            []byte    `json:"trace_id"`
	SpanID             []byte    `json:"span_id"`
	ParentSpanID       []byte    `json:"parent_span_id"`
	StartTime          time.Time `json:"start_time"`
	EndTime            time.Time `json:"end_time"`
	DurationNs         int64     `json:"duration_ns"`
	Name               string    `json:"name"`
	SpanClass          string    `json:"span_class"`
	OperationName      string    `json:"operation_name"`
	Kind               string    `json:"kind"`
	StatusCode         string    `json:"status_code"`
	ErrorType          string    `json:"error_type"`
	ErrorMessage       string    `json:"error_message"`
	Model              string    `json:"model"`
	ToolName           string    `json:"tool_name"`
	InputTokens        int64     `json:"input_tokens"`
	OutputTokens       int64     `json:"output_tokens"`
	CachedInputTokens  int64     `json:"cached_input_tokens"`
	CachedWriteTokens  int64     `json:"cached_write_tokens"`
	CostUsd            float64   `json:"cost_usd"`
	LlmFinishReason    string    `json:"llm_finish_reason"`
	ResourceAttributes []byte    `json:"resource_attributes"`
	SpanAttributes     []byte    `json:"span_attributes"`
}

type InsertTraceSpanPayloadBatchResults

type InsertTraceSpanPayloadBatchResults struct {
	// contains filtered or unexported fields
}

func (*InsertTraceSpanPayloadBatchResults) Close

func (*InsertTraceSpanPayloadBatchResults) Exec

func (b *InsertTraceSpanPayloadBatchResults) Exec(f func(int, error))

type InsertTraceSpanPayloadParams

type InsertTraceSpanPayloadParams struct {
	TraceID        []byte    `json:"trace_id"`
	SpanID         []byte    `json:"span_id"`
	StartTime      time.Time `json:"start_time"`
	InputMessages  []byte    `json:"input_messages"`
	OutputMessages []byte    `json:"output_messages"`
	ToolArguments  []byte    `json:"tool_arguments"`
	ToolResult     []byte    `json:"tool_result"`
}

type Querier

type Querier interface {
	AssignAppRuns(ctx context.Context, operationIds []int64) error
	AssignAppToolRuns(ctx context.Context, operationIds []int64) error
	DeleteExpiredGuardrailEvents(ctx context.Context) (int64, error)
	// ScopeNamespace hashes the typed scope and stable ID, separated by a NUL byte.
	GetGuardrailSubjectScope(ctx context.Context, namespace string) (GetGuardrailSubjectScopeRow, error)
	GuardrailEventChanged(ctx context.Context, arg GuardrailEventChangedParams) (bool, error)
	InsertAppOperation(ctx context.Context, arg []InsertAppOperationParams) *InsertAppOperationBatchResults
	InsertFileEvents(ctx context.Context, arg []InsertFileEventsParams) (int64, error)
	InsertGuardrailEvent(ctx context.Context, arg InsertGuardrailEventParams) (int64, error)
	InsertGuardrailRequest(ctx context.Context, arg InsertGuardrailRequestParams) error
	InsertMCPToolInvocation(ctx context.Context, arg []InsertMCPToolInvocationParams) *InsertMCPToolInvocationBatchResults
	InsertNetworkEvents(ctx context.Context, arg []InsertNetworkEventsParams) (int64, error)
	InsertProcessEvents(ctx context.Context, arg []InsertProcessEventsParams) (int64, error)
	InsertTraceSpan(ctx context.Context, arg []InsertTraceSpanParams) *InsertTraceSpanBatchResults
	InsertTraceSpanPayload(ctx context.Context, arg []InsertTraceSpanPayloadParams) *InsertTraceSpanPayloadBatchResults
	LockAppInvocationKeys(ctx context.Context, keys []string) error
	RefreshAppRunCorrelations(ctx context.Context, invocations []byte) error
	RefreshAppRunStatuses(ctx context.Context, arg RefreshAppRunStatusesParams) error
	RefreshAppToolResults(ctx context.Context, invocations []byte) error
	RefreshTraceSessionSummary(ctx context.Context, arg []RefreshTraceSessionSummaryParams) *RefreshTraceSessionSummaryBatchResults
	RefreshTraceSummary(ctx context.Context, traceID [][]byte) *RefreshTraceSummaryBatchResults
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AssignAppRuns added in v0.30.0

func (q *Queries) AssignAppRuns(ctx context.Context, operationIds []int64) error

func (*Queries) AssignAppToolRuns added in v0.30.0

func (q *Queries) AssignAppToolRuns(ctx context.Context, operationIds []int64) error

func (*Queries) DeleteExpiredGuardrailEvents added in v0.31.0

func (q *Queries) DeleteExpiredGuardrailEvents(ctx context.Context) (int64, error)

func (*Queries) GetGuardrailSubjectScope added in v0.31.0

func (q *Queries) GetGuardrailSubjectScope(ctx context.Context, namespace string) (GetGuardrailSubjectScopeRow, error)

ScopeNamespace hashes the typed scope and stable ID, separated by a NUL byte.

func (*Queries) GuardrailEventChanged added in v0.31.0

func (q *Queries) GuardrailEventChanged(ctx context.Context, arg GuardrailEventChangedParams) (bool, error)

func (*Queries) InsertAppOperation added in v0.30.0

func (*Queries) InsertFileEvents

func (q *Queries) InsertFileEvents(ctx context.Context, arg []InsertFileEventsParams) (int64, error)

func (*Queries) InsertGuardrailEvent added in v0.31.0

func (q *Queries) InsertGuardrailEvent(ctx context.Context, arg InsertGuardrailEventParams) (int64, error)

func (*Queries) InsertGuardrailRequest added in v0.31.0

func (q *Queries) InsertGuardrailRequest(ctx context.Context, arg InsertGuardrailRequestParams) error

func (*Queries) InsertNetworkEvents

func (q *Queries) InsertNetworkEvents(ctx context.Context, arg []InsertNetworkEventsParams) (int64, error)

func (*Queries) InsertProcessEvents

func (q *Queries) InsertProcessEvents(ctx context.Context, arg []InsertProcessEventsParams) (int64, error)

func (*Queries) InsertTraceSpan

func (*Queries) LockAppInvocationKeys added in v0.30.0

func (q *Queries) LockAppInvocationKeys(ctx context.Context, keys []string) error

func (*Queries) RefreshAppRunCorrelations added in v0.30.0

func (q *Queries) RefreshAppRunCorrelations(ctx context.Context, invocations []byte) error

func (*Queries) RefreshAppRunStatuses added in v0.30.0

func (q *Queries) RefreshAppRunStatuses(ctx context.Context, arg RefreshAppRunStatusesParams) error

func (*Queries) RefreshAppToolResults added in v0.30.0

func (q *Queries) RefreshAppToolResults(ctx context.Context, invocations []byte) error

func (*Queries) RefreshTraceSummary

func (q *Queries) RefreshTraceSummary(ctx context.Context, traceID [][]byte) *RefreshTraceSummaryBatchResults

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RefreshAppRunStatusesParams added in v0.30.0

type RefreshAppRunStatusesParams struct {
	Invocations  []byte  `json:"invocations"`
	OperationIds []int64 `json:"operation_ids"`
}

type RefreshTraceSessionSummaryBatchResults

type RefreshTraceSessionSummaryBatchResults struct {
	// contains filtered or unexported fields
}

func (*RefreshTraceSessionSummaryBatchResults) Close

func (*RefreshTraceSessionSummaryBatchResults) Exec

type RefreshTraceSessionSummaryParams

type RefreshTraceSessionSummaryParams struct {
	SessionID string `json:"session_id"`
	TraceID   []byte `json:"trace_id"`
}

type RefreshTraceSummaryBatchResults

type RefreshTraceSummaryBatchResults struct {
	// contains filtered or unexported fields
}

func (*RefreshTraceSummaryBatchResults) Close

func (*RefreshTraceSummaryBatchResults) Exec

func (b *RefreshTraceSummaryBatchResults) Exec(f func(int, error))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL