livedebugging

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

This service provides debug stream APIs for components.

Index

Constants

View Source
const ServiceName = "livedebugging"

ServiceName defines the name used for the livedebugging service.

Variables

This section is empty.

Functions

func NewLiveDebugging

func NewLiveDebugging() *liveDebugging

NewLiveDebugging creates a new instance of liveDebugging.

Types

type Arguments

type Arguments struct {
	Enabled bool `alloy:"enabled,attr,optional"`
}

type CallbackID

type CallbackID string

type CallbackManager

type CallbackManager interface {
	// AddCallback sets a callback for a given componentID.
	// The callback is used to send debugging data to live debugging consumers.
	AddCallback(host service.Host, callbackID CallbackID, componentID ComponentID, callback func(Data)) error
	// DeleteCallback deletes a callback for a given componentID.
	DeleteCallback(callbackID CallbackID, componentID ComponentID)
	// AddCallbackMulti sets a callback to all components.
	// The callbacks are used to send debugging data to live debugging consumers.
	AddCallbackMulti(host service.Host, callbackID CallbackID, moduleID ModuleID, callback func(Data)) error
	// DeleteCallbackMulti deletes callbacks for all components.
	DeleteCallbackMulti(host service.Host, callbackID CallbackID, moduleID ModuleID)
}

CallbackManager is used to manage live debugging callbacks.

type ComponentID

type ComponentID string

type Data added in v1.8.0

type Data struct {
	// ID of the component that created the data.
	ComponentID ComponentID
	// Ids of the components which will consume the data.
	// This is needed for components that can export different types of data (most Otel components) to know
	// where the data should go. When left empty, the data is expected to be sent to all components consuming data
	// from the component that created it.
	TargetComponentIDs []string
	Type               DataType
	// Count is the number of spans, metrics, logs that the data represent.
	Count uint64
	// The data string is passed as a function to only compute the string if needed.
	DataFunc func() string
}

func NewData added in v1.8.0

func NewData(componentID ComponentID, dataType DataType, count uint64, dataFunc func() string, opts ...DataOption) Data

type DataOption added in v1.8.0

type DataOption func(Data) Data

func WithTargetComponentIDs added in v1.8.0

func WithTargetComponentIDs(ids []string) DataOption

type DataType added in v1.8.0

type DataType string
const (
	Target           DataType = "target"
	PrometheusMetric DataType = "prometheus_metric"
	LokiLog          DataType = "loki_log"
	OtelMetric       DataType = "otel_metric"
	OtelLog          DataType = "otel_log"
	OtelTrace        DataType = "otel_trace"
)

type DebugDataPublisher

type DebugDataPublisher interface {
	// Publish sends debugging data for a given componentID if a least one consumer is listening for debugging data for the given componentID.
	PublishIfActive(data Data)
}

DebugDataPublisher is used by components to push information to live debugging consumers.

type ModuleID added in v1.8.0

type ModuleID string

type Service

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

func New

func New() *Service

func (*Service) Data

func (s *Service) Data() any

Data implements service.Service. It returns the liveDebugging for the components to stream.

func (*Service) Definition

func (*Service) Definition() service.Definition

Definition implements service.Service.

func (*Service) Run

func (s *Service) Run(ctx context.Context, host service.Host) error

Run implements service.Service.

func (*Service) Update

func (s *Service) Update(args any) error

Update implements service.Service.

Jump to

Keyboard shortcuts

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