Documentation
¶
Index ¶
- Constants
- Variables
- func CursorOffset(scope string, query Query, digest string, now time.Time) (int, time.Time, error)
- func Identity(snapshot Snapshot) string
- func Level(text string) string
- func Merge(current *State, incoming []Snapshot, gaps []Gap, job string, now time.Time) error
- func NextCursor(scope string, query Query, digest string, offset int, observed time.Time) string
- func SettingsKey(org, cluster string) string
- func UpdateSettings(provider storage.Provider, key string, update func(*SettingsState) error) error
- type Alerts
- type CaptureSettings
- type ContainerObservation
- type Coverage
- type Fields
- type Gap
- type Health
- type Learning
- type Line
- type LinkedLine
- type LinkedQuery
- type LinkedReader
- type Query
- type Result
- type Scope
- type Settings
- type SettingsState
- type Snapshot
- type Source
- type State
Constants ¶
View Source
const AllContainers = "*"
AllContainers is the Container value that merges every container's lines.
View Source
const MaxBytes = 8 << 20
View Source
const MaxSnapshots = 2000
View Source
const Retention = 24 * time.Hour
Variables ¶
View Source
var ErrInvalid = errors.New("invalid break logs request")
Functions ¶
func CursorOffset ¶
func NextCursor ¶
func SettingsKey ¶
func UpdateSettings ¶
Types ¶
type CaptureSettings ¶
type ContainerObservation ¶
type Coverage ¶
type Coverage struct {
State string `json:"state"`
Gaps []Gap `json:"gaps"`
Reason string `json:"reason,omitempty"`
Tip bool `json:"tip"`
}
func Assess ¶
func Assess(from, to time.Time, snapshots []Snapshot, container ContainerObservation) Coverage
type Fields ¶
type Fields struct {
Namespace string `json:"namespace"`
Pod string `json:"pod"`
Container string `json:"container"`
Time string `json:"time,omitempty"`
Message string `json:"message,omitempty"`
}
func DefaultFields ¶
type Gap ¶
type Gap struct {
SnapshotID string `json:"snapshot_id,omitempty"`
ObservedAt time.Time `json:"observed_at,omitempty"`
From time.Time `json:"from"`
To time.Time `json:"to"`
Namespace string `json:"namespace,omitempty"`
RootUID string `json:"root_uid,omitempty"`
PodUID string `json:"pod_uid,omitempty"`
Container string `json:"container,omitempty"`
Reason string `json:"reason,omitempty"`
}
func ResolveBudgetGaps ¶
type LinkedLine ¶
type LinkedQuery ¶
type LinkedQuery struct {
Namespace string
PodPrefix string
Pods []string
Container string
From, To time.Time
Limit int
}
func (LinkedQuery) Validate ¶
func (query LinkedQuery) Validate() error
type LinkedReader ¶
type LinkedReader interface {
Read(context.Context, LinkedQuery) (Result, error)
Preview(LinkedQuery) string
}
type Query ¶
type Result ¶
type Result struct {
Lines []LinkedLine
Truncated bool
}
type Settings ¶
type Settings struct {
Learning Learning `json:"learning"`
BreakLogs CaptureSettings `json:"break_logs"`
Alerts Alerts `json:"alerts"`
}
type SettingsState ¶
type SettingsState struct {
Settings Settings `json:"settings"`
Health map[string]Health `json:"health"`
}
func LoadSettings ¶
func LoadSettings(provider storage.Provider, key string) (SettingsState, error)
type Snapshot ¶
type Snapshot struct {
BreakAt time.Time `json:"break_at,omitempty"`
ID string `json:"id"`
Cluster string `json:"cluster"`
Namespace string `json:"namespace"`
RootUID string `json:"root_uid"`
Pod string `json:"pod"`
PodUID string `json:"pod_uid"`
PodCreatedAt time.Time `json:"pod_created_at,omitempty"`
Container string `json:"container"`
Init bool `json:"init"`
Slot string `json:"slot"`
TerminationAt time.Time `json:"termination_at,omitempty"`
Restarts int32 `json:"restarts"`
CapturedAt time.Time `json:"captured_at"`
From time.Time `json:"from"`
To time.Time `json:"to"`
Lines []Line `json:"lines"`
Truncated bool `json:"truncated"`
}
Click to show internal directories.
Click to hide internal directories.