telemetry

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventScopeSystem = EventScope("system")
	EventScopeRun    = EventScope("run")
)
View Source
const (
	EventTypeOp        = EventType("op")
	EventTypeLog       = EventType("log")
	EventTypeAnalytics = EventType("analytics")
)

Variables

This section is empty.

Functions

func NewWriter added in v0.6.3

func NewWriter(t *Telemetry) progrock.Writer

Types

type Event

type Event struct {
	Version   string    `json:"v"`
	Timestamp time.Time `json:"ts"`

	RunID string `json:"run_id,omitempty"`

	Type    EventType `json:"type"`
	Payload Payload   `json:"payload"`
}

type EventScope added in v0.5.2

type EventScope string

type EventType

type EventType string

type LegacyIDInternalizer added in v0.10.0

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

func NewLegacyIDInternalizer added in v0.10.0

func NewLegacyIDInternalizer(w progrock.Writer) LegacyIDInternalizer

func (LegacyIDInternalizer) Close added in v0.10.0

func (f LegacyIDInternalizer) Close() error

func (LegacyIDInternalizer) WriteStatus added in v0.10.0

func (f LegacyIDInternalizer) WriteStatus(status *progrock.StatusUpdate) error

WriteStatus marks any vertexes with a label "id" as internal so that they are hidden from interfaces that predate Zenith.

type LogPayload

type LogPayload struct {
	OpID   string `json:"op_id"`
	Data   string `json:"data"`
	Stream int    `json:"stream"`
}

func (LogPayload) Scope added in v0.5.2

func (LogPayload) Scope() EventScope

func (LogPayload) Type

func (LogPayload) Type() EventType

type OpPayload

type OpPayload struct {
	OpID     string        `json:"op_id"`
	OpName   string        `json:"op_name"`
	Pipeline pipeline.Path `json:"pipeline"`
	Internal bool          `json:"internal"`
	Inputs   []string      `json:"inputs"`

	Started   *time.Time `json:"started"`
	Completed *time.Time `json:"completed"`
	Cached    bool       `json:"cached"`
	Error     string     `json:"error"`
}

func (OpPayload) Scope added in v0.5.2

func (OpPayload) Scope() EventScope

func (OpPayload) Type

func (OpPayload) Type() EventType

type Payload

type Payload interface {
	Type() EventType
	Scope() EventScope
}

type PipelinedVertex added in v0.6.3

type PipelinedVertex struct {
	*progrock.Vertex

	// Groups stores the group IDs that this vertex is a member of. Each entry
	// has a corresponding entry in Pipelines.
	Groups []string

	// Pipelines stores the pipeline paths computed from Progrock groups.
	Pipelines []pipeline.Path
}

PipelinedVertex is a Progrock vertex paired with all of its pipeline paths.

type Pipeliner added in v0.6.3

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

Pipeliner listens to events and collects pipeline paths for vertices based on groups and group memberships.

func NewPipeliner added in v0.6.3

func NewPipeliner() *Pipeliner

func (*Pipeliner) Close added in v0.6.3

func (t *Pipeliner) Close() error

func (*Pipeliner) TrackUpdate added in v0.8.5

func (t *Pipeliner) TrackUpdate(ev *progrock.StatusUpdate)

func (*Pipeliner) Vertex added in v0.6.3

func (t *Pipeliner) Vertex(id string) (*PipelinedVertex, bool)

func (*Pipeliner) Vertices added in v0.6.3

func (t *Pipeliner) Vertices() []*PipelinedVertex

type Telemetry

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

func New

func New() *Telemetry

func (*Telemetry) Close added in v0.6.3

func (t *Telemetry) Close()

func (*Telemetry) Enabled added in v0.6.3

func (t *Telemetry) Enabled() bool

func (*Telemetry) Push

func (t *Telemetry) Push(p Payload, ts time.Time)

func (*Telemetry) URL added in v0.6.3

func (t *Telemetry) URL() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳