observability

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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 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"`
	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"`
	ParentSpanID       string                 `json:"parentSpanId,omitempty"`
	StartTime          time.Time              `json:"startTime"`
	EndTime            time.Time              `json:"endTime"`
	DurationNs         int64                  `json:"durationNs"`
	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"`
}

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)
}

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

Jump to

Keyboard shortcuts

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