Documentation
¶
Overview ¶
Package observability provides public interfaces for component observability. External Go modules can implement these interfaces to provide custom logging adapters while the Observer handles authentication, authorization, and HTTP request handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentApplicationLogsParams ¶
type ComponentApplicationLogsParams struct {
ComponentID string `json:"componentId"`
EnvironmentID string `json:"environmentId"`
ProjectID string `json:"projectId"`
Namespace string `json:"namespace"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
SearchPhrase string `json:"searchPhrase"`
LogLevels []string `json:"logLevels"`
Versions []string `json:"versions"`
VersionIDs []string `json:"versionIds"`
Limit int `json:"limit"`
SortOrder string `json:"sortOrder"`
}
ComponentApplicationLogsParams holds parameters for component application log queries
type ComponentApplicationLogsResult ¶
type ComponentApplicationLogsResult struct {
Logs []LogEntry `json:"logs"`
TotalCount int `json:"totalCount"`
Took int `json:"took"`
}
ComponentApplicationLogsResult represents the result of a component log query
type LogEntry ¶
type LogEntry struct {
Timestamp time.Time `json:"timestamp"`
Log string `json:"log"`
LogLevel string `json:"logLevel"`
ComponentID string `json:"componentId"`
EnvironmentID string `json:"environmentId"`
ProjectID string `json:"projectId"`
Version string `json:"version"`
VersionID string `json:"versionId"`
Namespace string `json:"namespace"`
PodID string `json:"podId"`
ContainerName string `json:"containerName"`
Labels map[string]string `json:"labels"`
// Additional fields for logs API v1
ComponentName string `json:"componentName,omitempty"`
EnvironmentName string `json:"environmentName,omitempty"`
ProjectName string `json:"projectName,omitempty"`
NamespaceName string `json:"namespaceName,omitempty"`
PodNamespace string `json:"podNamespace,omitempty"`
PodName string `json:"podName,omitempty"`
}
LogEntry represents a parsed log entry for component logs
type LogsAdapter ¶ added in v0.17.0
type LogsAdapter interface {
// GetComponentApplicationLogs retrieves component application logs
GetComponentApplicationLogs(ctx context.Context,
params ComponentApplicationLogsParams) (*ComponentApplicationLogsResult, error)
// GetWorkflowLogs retrieves workflow run logs
GetWorkflowLogs(ctx context.Context,
params WorkflowLogsParams) (*WorkflowLogsResult, error)
}
LogsAdapter defines the interface for logs adapter implementations
type SpanDetail ¶ added in v1.0.0
type SpanDetail struct {
SpanID string `json:"spanId"`
SpanName string `json:"spanName"`
SpanKind string `json:"spanKind,omitempty"`
ParentSpanID string `json:"parentSpanId,omitempty"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
DurationNs int64 `json:"durationNs"`
Status string `json:"status,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
ResourceAttributes map[string]interface{} `json:"resourceAttributes,omitempty"`
}
SpanDetail represents detailed information about a single span
type SpansResult ¶ added in v1.0.0
type SpansResult struct {
Spans []TraceSpan `json:"spans"`
TotalCount int `json:"totalCount"`
Took int `json:"tookMs"`
}
SpansResult defines the result structure for span queries
type Trace ¶ added in v0.17.0
type Trace struct {
TraceID string `json:"traceId"`
TraceName string `json:"traceName"`
SpanCount int `json:"spanCount"`
RootSpanID string `json:"rootSpanId"`
RootSpanName string `json:"rootSpanName"`
RootSpanKind string `json:"rootSpanKind"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
DurationNs int64 `json:"durationNs"`
HasErrors bool `json:"hasErrors"`
Spans []TraceSpan `json:"spans,omitempty"`
}
Trace represents a distributed trace
type TraceSpan ¶ added in v0.17.0
type TraceSpan struct {
SpanID string `json:"spanId"`
Name string `json:"name"`
SpanKind string `json:"spanKind,omitempty"`
ParentSpanID string `json:"parentSpanId,omitempty"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
DurationNs int64 `json:"durationNs"`
Status string `json:"status,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
ResourceAttributes map[string]interface{} `json:"resourceAttributes,omitempty"`
}
TraceSpan represents a span within a trace with all details
type TracesQueryParams ¶ added in v0.17.0
type TracesQueryParams struct {
// Time range
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
// Resource identifiers
Namespace string `json:"namespace"`
ProjectID string `json:"projectId"`
ComponentID string `json:"componentId,omitempty"`
EnvironmentID string `json:"environmentId,omitempty"`
// Query options
TraceID string `json:"traceId,omitempty"`
Limit int `json:"limit"`
SortOrder string `json:"sortOrder"`
IncludeAttributes bool `json:"includeAttributes,omitempty"`
}
TracesQueryParams defines parameters for querying traces
type TracesQueryResult ¶ added in v0.17.0
type TracesQueryResult struct {
Traces []Trace `json:"traces"`
TotalCount int `json:"totalCount"`
Took int `json:"tookMs"`
}
TracesQueryResult defines the result structure for trace queries
type TracingAdapter ¶ added in v0.17.0
type TracingAdapter interface {
// GetTraces retrieves traces based on query parameters
GetTraces(ctx context.Context, params TracesQueryParams) (*TracesQueryResult, error)
// GetSpans retrieves spans for a specific trace
GetSpans(ctx context.Context, traceID string, params TracesQueryParams) (*SpansResult, error)
// GetSpanDetails retrieves detailed information about a specific span
GetSpanDetails(ctx context.Context, traceID string, spanID string) (*SpanDetail, error)
}
TracingAdapter defines the interface for retrieving traces from an external adapter
type WorkflowLogEntry ¶ added in v0.17.0
type WorkflowLogEntry struct {
Timestamp time.Time `json:"timestamp"`
Log string `json:"log"`
LogLevel string `json:"logLevel"`
PodNamespace string `json:"podNamespace,omitempty"`
PodID string `json:"podId,omitempty"`
PodName string `json:"podName,omitempty"`
ContainerName string `json:"containerName,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}
WorkflowLogEntry represents a parsed log entry for workflow logs
type WorkflowLogsParams ¶ added in v0.17.0
type WorkflowLogsParams struct {
Namespace string `json:"namespace"`
WorkflowRunName string `json:"workflowRunName"`
TaskName string `json:"taskName"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
SearchPhrase string `json:"searchPhrase"`
LogLevels []string `json:"logLevels"`
Limit int `json:"limit"`
SortOrder string `json:"sortOrder"`
}
WorkflowLogsParams holds parameters for workflow log queries
type WorkflowLogsResult ¶ added in v0.17.0
type WorkflowLogsResult struct {
Logs []WorkflowLogEntry `json:"logs"`
TotalCount int `json:"totalCount"`
Took int `json:"took"`
}
WorkflowLogsResult represents the result of a workflow log query