Documentation
¶
Index ¶
- Constants
- func CloneEvent(event core.Event) core.Event
- func CloneRawMessage(value json.RawMessage) json.RawMessage
- func NewEventFanoutSink(sinks ...core.EventSink) core.EventSink
- func NormalizeEvent(event core.Event, now time.Time) core.Event
- func ParentSpanFromContext(ctx context.Context) string
- func TraceFromContext(ctx context.Context) (traceID, spanID string)
- func WithTrace(ctx context.Context, traceID, spanID string) context.Context
- func WithTraceParent(ctx context.Context, traceID, spanID, parentSpanID string) context.Context
- type Attribute
- type EventHub
- type EventPublisher
- type EventQuery
- type EventRecord
- type EventStore
- type EventStoreSink
- type EventSubscription
- type EventSubscriptionFilter
- type MetricName
- type NoopRecorder
- type NoopTracer
- type Recorder
- type RecorderFunc
- type RunQuery
- type RunStatus
- type RunSummary
- type Span
- type SpanName
- type Tracer
Constants ¶
View Source
const ( DefaultRunQueryLimit = 50 MaxRunQueryLimit = 200 DefaultEventQueryLimit = 200 MaxEventQueryLimit = 1000 )
Variables ¶
This section is empty.
Functions ¶
func CloneRawMessage ¶
func CloneRawMessage(value json.RawMessage) json.RawMessage
func ParentSpanFromContext ¶ added in v0.2.2
ParentSpanFromContext returns the parent span ID stored in ctx, if any.
func TraceFromContext ¶ added in v0.1.1
TraceFromContext returns the trace and span IDs stored in ctx by WithTrace. Both values are empty strings when no trace context is present.
Types ¶
type EventHub ¶
type EventHub struct {
// contains filtered or unexported fields
}
func NewEventHub ¶
func NewEventHub() *EventHub
func (*EventHub) PublishEvent ¶
func (hub *EventHub) PublishEvent(ctx context.Context, record EventRecord) error
func (*EventHub) Subscribe ¶
func (hub *EventHub) Subscribe(ctx context.Context, filter EventSubscriptionFilter) EventSubscription
type EventPublisher ¶
type EventPublisher interface {
PublishEvent(ctx context.Context, record EventRecord) error
}
type EventQuery ¶
func NormalizeEventQuery ¶
func NormalizeEventQuery(query EventQuery) EventQuery
type EventRecord ¶
type EventRecord struct {
ID int64 `json:"id"`
Sequence int64 `json:"sequence"`
Event core.Event `json:"event"`
CreatedAt time.Time `json:"created_at"`
}
func CloneEventRecord ¶
func CloneEventRecord(record EventRecord) EventRecord
type EventStore ¶
type EventStore interface {
Append(ctx context.Context, event core.Event) (EventRecord, error)
ListRuns(ctx context.Context, query RunQuery) ([]RunSummary, error)
ListEvents(ctx context.Context, runID string, query EventQuery) ([]EventRecord, error)
}
type EventStoreSink ¶
type EventStoreSink struct {
// contains filtered or unexported fields
}
func NewEventStoreSink ¶
func NewEventStoreSink(store EventStore, publishers ...EventPublisher) *EventStoreSink
type EventSubscription ¶
type EventSubscription struct {
Events <-chan EventRecord
Cancel func()
}
type EventSubscriptionFilter ¶
type MetricName ¶
type MetricName string
const ( MetricRuntimeEventsTotal MetricName = "agentflow_runtime_events_total" MetricRunDurationSeconds MetricName = "agentflow_run_duration_seconds" MetricToolDurationSeconds MetricName = "agentflow_tool_duration_seconds" MetricQueueJobsTotal MetricName = "agentflow_queue_jobs_total" MetricQueueJobsQueued MetricName = "agentflow_queue_jobs_queued" MetricQueueJobsRunning MetricName = "agentflow_queue_jobs_running" MetricQueueJobsDeadLetter MetricName = "agentflow_queue_jobs_dead_letter" MetricMemoryTierRecords MetricName = "agentflow_memory_tier_records" MetricMemoryTierMigrationsTotal MetricName = "agentflow_memory_tier_migrations_total" MetricMemoryRecallLatencySeconds MetricName = "agentflow_memory_recall_latency_seconds" )
type NoopRecorder ¶
type NoopRecorder struct{}
func (NoopRecorder) IncCounter ¶
func (NoopRecorder) IncCounter(context.Context, MetricName, ...Attribute)
func (NoopRecorder) ObserveHistogram ¶
func (NoopRecorder) ObserveHistogram(context.Context, MetricName, float64, ...Attribute)
func (NoopRecorder) SetGauge ¶
func (NoopRecorder) SetGauge(context.Context, MetricName, float64, ...Attribute)
type NoopTracer ¶
type NoopTracer struct{}
type Recorder ¶
type Recorder interface {
IncCounter(ctx context.Context, name MetricName, attrs ...Attribute)
ObserveHistogram(ctx context.Context, name MetricName, value float64, attrs ...Attribute)
SetGauge(ctx context.Context, name MetricName, value float64, attrs ...Attribute)
}
type RecorderFunc ¶
type RecorderFunc func(ctx context.Context, name MetricName, attrs ...Attribute)
func (RecorderFunc) IncCounter ¶
func (fn RecorderFunc) IncCounter(ctx context.Context, name MetricName, attrs ...Attribute)
func (RecorderFunc) ObserveHistogram ¶
func (fn RecorderFunc) ObserveHistogram(context.Context, MetricName, float64, ...Attribute)
func (RecorderFunc) SetGauge ¶
func (fn RecorderFunc) SetGauge(context.Context, MetricName, float64, ...Attribute)
type RunQuery ¶
func NormalizeRunQuery ¶
type RunSummary ¶
type RunSummary struct {
RunID string `json:"run_id"`
ScenarioName string `json:"scenario_name,omitempty"`
Status RunStatus `json:"status"`
EventCount int64 `json:"event_count"`
FirstSeenAt time.Time `json:"first_seen_at"`
LastSeenAt time.Time `json:"last_seen_at"`
LastEventType core.EventType `json:"last_event_type"`
}
type SpanName ¶
type SpanName string
const ( SpanRuntimeEvent SpanName = "agentflow.runtime.event" SpanRun SpanName = "agentflow.run" SpanToolCall SpanName = "agentflow.tool.call" SpanQueueJob SpanName = "agentflow.queue.job" SpanMemoryTierRecall SpanName = "agentflow.memory.tier.recall" SpanMemoryTierMigrate SpanName = "agentflow.memory.tier.migrate" )
Click to show internal directories.
Click to hide internal directories.