Help us shape the future of Go! Take the 2026 Go Developer Survey

observability

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEvent = errors.New("plugin observability event is invalid")

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {
	EventID           string         `json:"event_id,omitempty"`
	Type              string         `json:"type"`
	PluginID          string         `json:"plugin_id"`
	PluginInstanceID  string         `json:"plugin_instance_id,omitempty"`
	SurfaceID         string         `json:"surface_id,omitempty"`
	SurfaceInstanceID string         `json:"surface_instance_id,omitempty"`
	RequestID         string         `json:"request_id,omitempty"`
	Actor             string         `json:"actor,omitempty"`
	OccurredAt        time.Time      `json:"occurred_at,omitempty"`
	Details           map[string]any `json:"details,omitempty"`
}

type AuditLister

type AuditLister interface {
	ListPluginAudit(ctx context.Context, req ListAuditRequest) ([]AuditEvent, error)
}

type AuditSink

type AuditSink interface {
	AppendPluginAudit(ctx context.Context, event AuditEvent) error
}

type DiagnosticEvent

type DiagnosticEvent struct {
	EventID           string         `json:"event_id,omitempty"`
	Type              string         `json:"type"`
	Severity          string         `json:"severity"`
	Message           string         `json:"message"`
	PluginID          string         `json:"plugin_id,omitempty"`
	PluginInstanceID  string         `json:"plugin_instance_id,omitempty"`
	SurfaceID         string         `json:"surface_id,omitempty"`
	SurfaceInstanceID string         `json:"surface_instance_id,omitempty"`
	ActiveFingerprint string         `json:"active_fingerprint,omitempty"`
	RequestID         string         `json:"request_id,omitempty"`
	OccurredAt        time.Time      `json:"occurred_at,omitempty"`
	Details           map[string]any `json:"details,omitempty"`
}

type DiagnosticLister

type DiagnosticLister interface {
	ListPluginDiagnostics(ctx context.Context, req ListDiagnosticRequest) ([]DiagnosticEvent, error)
}

type DiagnosticsSink

type DiagnosticsSink interface {
	AppendPluginDiagnostic(ctx context.Context, event DiagnosticEvent) error
}

type ListAuditRequest

type ListAuditRequest struct {
	PluginID         string `json:"plugin_id,omitempty"`
	PluginInstanceID string `json:"plugin_instance_id,omitempty"`
	Type             string `json:"type,omitempty"`
	Limit            int    `json:"limit,omitempty"`
}

type ListDiagnosticRequest

type ListDiagnosticRequest struct {
	PluginID          string `json:"plugin_id,omitempty"`
	PluginInstanceID  string `json:"plugin_instance_id,omitempty"`
	SurfaceInstanceID string `json:"surface_instance_id,omitempty"`
	Type              string `json:"type,omitempty"`
	Severity          string `json:"severity,omitempty"`
	Limit             int    `json:"limit,omitempty"`
}

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore(opts ...MemoryStoreOptions) *MemoryStore

func (*MemoryStore) AppendPluginAudit

func (s *MemoryStore) AppendPluginAudit(_ context.Context, event AuditEvent) error

func (*MemoryStore) AppendPluginDiagnostic

func (s *MemoryStore) AppendPluginDiagnostic(_ context.Context, event DiagnosticEvent) error

func (*MemoryStore) ListPluginAudit

func (s *MemoryStore) ListPluginAudit(_ context.Context, req ListAuditRequest) ([]AuditEvent, error)

func (*MemoryStore) ListPluginDiagnostics

func (s *MemoryStore) ListPluginDiagnostics(_ context.Context, req ListDiagnosticRequest) ([]DiagnosticEvent, error)

type MemoryStoreOptions

type MemoryStoreOptions struct {
	Now                 func() time.Time
	MaxAuditEvents      int
	MaxDiagnosticEvents int
}

type SQLiteStore

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

func NewSQLiteStore

func NewSQLiteStore(ctx context.Context, path string, opts ...MemoryStoreOptions) (*SQLiteStore, error)

func (*SQLiteStore) AppendPluginAudit

func (s *SQLiteStore) AppendPluginAudit(ctx context.Context, event AuditEvent) error

func (*SQLiteStore) AppendPluginDiagnostic

func (s *SQLiteStore) AppendPluginDiagnostic(ctx context.Context, event DiagnosticEvent) error

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

func (*SQLiteStore) ListPluginAudit

func (s *SQLiteStore) ListPluginAudit(ctx context.Context, req ListAuditRequest) ([]AuditEvent, error)

func (*SQLiteStore) ListPluginDiagnostics

func (s *SQLiteStore) ListPluginDiagnostics(ctx context.Context, req ListDiagnosticRequest) ([]DiagnosticEvent, error)

Jump to

Keyboard shortcuts

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