observability

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnavailable = errors.New("observability backend unavailable")
)

Functions

This section is empty.

Types

type ClickHouseClient

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

func NewClickHouseClient

func NewClickHouseClient(endpoint, database, username, password string, httpClient *http.Client) (*ClickHouseClient, error)

func (*ClickHouseClient) Events

func (c *ClickHouseClient) Events(ctx context.Context, scope Scope, query EventQuery) ([]Event, error)

func (*ClickHouseClient) LiveLogs

func (c *ClickHouseClient) LiveLogs(ctx context.Context, scope Scope, query LiveLogQuery) (LogBatch, error)

func (*ClickHouseClient) LogWatermark

func (c *ClickHouseClient) LogWatermark(ctx context.Context) (LogCursor, error)

func (*ClickHouseClient) Logs

func (c *ClickHouseClient) Logs(ctx context.Context, scope Scope, query LogQuery) (LogPage, error)

type CurrentEventReader

type CurrentEventReader interface {
	CurrentEvents(context.Context, Scope, EventQuery) ([]Event, bool, []string, error)
}

type CurrentLogReader

type CurrentLogReader interface {
	CurrentLogs(context.Context, Scope, time.Time, string, int) (LogBatch, error)
}

type CurrentMetricReader

type CurrentMetricReader interface {
	CurrentMetrics(context.Context, Scope, time.Time) (MetricSnapshot, error)
}

type Event

type Event struct {
	Timestamp time.Time `json:"timestamp"`
	Source    string    `json:"source"`
	Type      string    `json:"type"`
	Reason    string    `json:"reason"`
	Message   string    `json:"message"`
}

type EventQuery

type EventQuery struct {
	From  time.Time
	To    time.Time
	Limit int
}

type HistoricalEventReader

type HistoricalEventReader interface {
	Events(context.Context, Scope, EventQuery) ([]Event, error)
}

type HistoricalLogReader

type HistoricalLogReader interface {
	LogWatermark(context.Context) (LogCursor, error)
	Logs(context.Context, Scope, LogQuery) (LogPage, error)
}

type HistoricalMetricReader

type HistoricalMetricReader interface {
	Metrics(context.Context, Scope, MetricQuery) (Metrics, error)
}

type LiveLogQuery

type LiveLogQuery struct {
	After  LogCursor
	Search string
	Limit  int
}

type LogBatch

type LogBatch struct {
	Items  []LogEntry
	Cursor LogCursor
}

type LogCursor

type LogCursor struct {
	IngestedAt time.Time
	ID         string
}

func (LogCursor) Valid

func (cursor LogCursor) Valid() bool

type LogEntry

type LogEntry struct {
	ID        string    `json:"id"`
	Timestamp time.Time `json:"timestamp"`
	Body      string    `json:"body"`
	Severity  string    `json:"severity"`
	// contains filtered or unexported fields
}

type LogPage

type LogPage struct {
	Items      []LogEntry
	Next       *LogPosition
	LiveCursor LogCursor
}

type LogPosition

type LogPosition struct {
	Timestamp time.Time
	ID        string
}

func (LogPosition) Valid

func (position LogPosition) Valid() bool

type LogQuery

type LogQuery struct {
	From     time.Time
	To       time.Time
	Search   string
	Limit    int
	Snapshot LogCursor
	Before   *LogPosition
}

type MetricConformanceEvidence

type MetricConformanceEvidence struct {
	Conformant  bool
	ReasonCode  string
	Limitations []string
	ObservedAt  time.Time
}

type MetricPoint

type MetricPoint struct {
	Timestamp time.Time `json:"timestamp"`
	Value     float64   `json:"value"`
}

type MetricQuery

type MetricQuery struct {
	From time.Time
	To   time.Time
	Step time.Duration
}

type MetricSample

type MetricSample struct {
	Name      string    `json:"name"`
	Unit      string    `json:"unit"`
	Timestamp time.Time `json:"timestamp"`
	Value     float64   `json:"value"`
}

type MetricSeries

type MetricSeries struct {
	Name   string        `json:"name"`
	Unit   string        `json:"unit"`
	Points []MetricPoint `json:"points"`
}

type MetricSnapshot

type MetricSnapshot struct {
	ObservedAt  time.Time      `json:"observedAt"`
	Partial     bool           `json:"partial"`
	Unavailable []string       `json:"unavailable"`
	Samples     []MetricSample `json:"samples"`
}

type Metrics

type Metrics struct {
	From              time.Time      `json:"from"`
	To                time.Time      `json:"to"`
	Step              string         `json:"step"`
	ResolutionSeconds int            `json:"resolutionSeconds"`
	Partial           bool           `json:"partial"`
	Unavailable       []string       `json:"unavailable"`
	Series            []MetricSeries `json:"series"`
}

type PrometheusQueryAdapter

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

func NewPrometheusQueryAdapter

func NewPrometheusQueryAdapter(endpoint string, httpClient *http.Client) (*PrometheusQueryAdapter, error)

func (*PrometheusQueryAdapter) CheckConformance

func (c *PrometheusQueryAdapter) CheckConformance(ctx context.Context, scope Scope) (MetricConformanceEvidence, error)

func (*PrometheusQueryAdapter) Metrics

func (c *PrometheusQueryAdapter) Metrics(ctx context.Context, scope Scope, query MetricQuery) (Metrics, error)

type Scope

type Scope struct {
	ClusterID        string
	ClusterUID       string
	WorkspaceID      string
	AppEnvironmentID string
	Namespace        string
	RuntimeName      string
}

type UnavailableCurrentReader

type UnavailableCurrentReader struct{}

func (UnavailableCurrentReader) CurrentEvents

func (UnavailableCurrentReader) CurrentLogs

func (UnavailableCurrentReader) CurrentMetrics

type UnavailableHistoricalReader

type UnavailableHistoricalReader struct{}

func (UnavailableHistoricalReader) Events

func (UnavailableHistoricalReader) LogWatermark

func (UnavailableHistoricalReader) Logs

func (UnavailableHistoricalReader) Metrics

Jump to

Keyboard shortcuts

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