Documentation
¶
Index ¶
- type APIHandler
- type APIResponse
- type LogData
- type LogItem
- type SQLiteLogWriter
- type SQLiteSpanExporter
- type Service
- func (m *Service) CreateBlueprint(ctx context.Context, req *connect.Request[v1.CreateBlueprintRequest]) (*connect.Response[v1.CreateBlueprintResponse], error)
- func (m *Service) GetBlueprint(ctx context.Context, req *connect.Request[v1.GetBlueprintRequest]) (*connect.Response[v1.GetBlueprintResponse], error)
- func (m *Service) GetTrace(ctx context.Context, req *connect.Request[v1.GetTraceRequest]) (*connect.Response[v1.GetTraceResponse], error)
- func (m *Service) ListBlueprints(ctx context.Context, req *connect.Request[v1.ListBlueprintsRequest]) (*connect.Response[v1.ListBlueprintsResponse], error)
- func (m *Service) ListLogs(ctx context.Context, req *connect.Request[v1.ListLogsRequest]) (*connect.Response[v1.ListLogsResponse], error)
- func (m *Service) ListTraces(ctx context.Context, req *connect.Request[v1.ListTracesRequest]) (*connect.Response[v1.ListTracesResponse], error)
- type SpanData
- type SpanItem
- type TraceDetail
- type TraceListItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶ added in v0.1.4
type APIHandler struct {
// contains filtered or unexported fields
}
APIHandler handles HTTP requests for the counterspell API
func NewAPIHandler ¶ added in v0.1.4
func NewAPIHandler(database *sql.DB) *APIHandler
NewAPIHandler creates a new API handler
func (*APIHandler) GetTraceDetails ¶ added in v0.1.4
func (h *APIHandler) GetTraceDetails(c echo.Context) error
GetTraceDetails handles GET /counterspell/api/traces/:trace_id
func (*APIHandler) QueryLogs ¶ added in v0.1.4
func (h *APIHandler) QueryLogs(c echo.Context) error
QueryLogs handles GET /counterspell/api/logs
func (*APIHandler) QueryTraces ¶ added in v0.1.4
func (h *APIHandler) QueryTraces(c echo.Context) error
QueryTraces handles GET /counterspell/api/traces
type APIResponse ¶ added in v0.1.4
APIResponse represents the standard API response format
type LogData ¶ added in v0.1.4
type LogData struct {
Timestamp string
Level string
Message string
TraceID sql.NullString
SpanID sql.NullString
Attributes string
}
LogData represents a log entry for database insertion
type LogItem ¶ added in v0.1.4
type LogItem struct {
ID int64 `json:"id"`
Timestamp string `json:"timestamp"`
Level string `json:"level"`
Message string `json:"message"`
TraceID *string `json:"trace_id"`
SpanID *string `json:"span_id"`
Attributes map[string]any `json:"attributes"`
}
LogItem represents a log entry
type SQLiteLogWriter ¶ added in v0.1.4
type SQLiteLogWriter struct {
// contains filtered or unexported fields
}
SQLiteLogWriter writes logs to SQLite asynchronously
func NewSQLiteLogWriter ¶ added in v0.1.4
func NewSQLiteLogWriter(database *sql.DB) *SQLiteLogWriter
NewSQLiteLogWriter creates a new log writer
func (*SQLiteLogWriter) Close ¶ added in v0.1.4
func (w *SQLiteLogWriter) Close() error
Close shuts down the writer
type SQLiteSpanExporter ¶ added in v0.1.4
type SQLiteSpanExporter struct {
// contains filtered or unexported fields
}
SQLiteSpanExporter implements the OpenTelemetry SpanExporter interface and writes spans to SQLite database asynchronously
func NewSQLiteSpanExporter ¶ added in v0.1.4
func NewSQLiteSpanExporter(database *sql.DB) *SQLiteSpanExporter
NewSQLiteSpanExporter creates a new SQLite span exporter
func (*SQLiteSpanExporter) ExportSpans ¶ added in v0.1.4
func (e *SQLiteSpanExporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error
ExportSpans exports spans to the SQLite database This method is called by the OpenTelemetry SDK
func (*SQLiteSpanExporter) ForceFlush ¶ added in v0.1.4
func (e *SQLiteSpanExporter) ForceFlush(ctx context.Context) error
ForceFlush forces the exporter to flush any buffered spans
type Service ¶ added in v0.1.4
type Service struct {
// contains filtered or unexported fields
}
ServiceHandler handles HTTP requests for the counterspell API
func NewService ¶ added in v0.1.4
NewServiceHandler creates a new ServiceHandler
func (*Service) CreateBlueprint ¶ added in v0.1.4
func (*Service) GetBlueprint ¶ added in v0.1.4
func (m *Service) GetBlueprint(ctx context.Context, req *connect.Request[v1.GetBlueprintRequest]) (*connect.Response[v1.GetBlueprintResponse], error)
GetBlueprint
func (*Service) ListBlueprints ¶ added in v0.1.4
func (m *Service) ListBlueprints(ctx context.Context, req *connect.Request[v1.ListBlueprintsRequest]) (*connect.Response[v1.ListBlueprintsResponse], error)
GetBlueprints
func (*Service) ListTraces ¶ added in v0.1.4
type SpanData ¶ added in v0.1.4
type SpanData struct {
SpanID string
TraceID string
ParentSpanID sql.NullString
Name string
StartTime string
EndTime string
DurationNs int64
Attributes string
ServiceName string
HasError bool
}
SpanData represents a span ready to be inserted into the database
type SpanItem ¶ added in v0.1.4
type SpanItem struct {
SpanID string `json:"span_id"`
TraceID string `json:"trace_id"`
ParentSpanID *string `json:"parent_span_id"`
Name string `json:"name"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
DurationNs int64 `json:"duration_ns"`
Attributes map[string]any `json:"attributes"`
ServiceName string `json:"service_name"`
HasError bool `json:"has_error"`
}
SpanItem represents a span in the trace detail view
type TraceDetail ¶ added in v0.1.4
TraceDetail represents detailed trace information
type TraceListItem ¶ added in v0.1.4
type TraceListItem struct {
TraceID string `json:"trace_id"`
RootSpanName string `json:"root_span_name"`
TraceStartTime string `json:"trace_start_time"`
DurationMs float64 `json:"duration_ms"`
SpanCount int64 `json:"span_count"`
ErrorCount int64 `json:"error_count"`
HasError bool `json:"has_error"`
}
TraceListItem represents a trace in the list view