Documentation ¶
Overview ¶
Package scheduler exposes utilities for scheduling and running OpenTelemetry Collector components.
Index ¶
- type Host
- func (h *Host) GetExporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component
- func (h *Host) GetExtensions() map[otelcomponent.ID]otelextension.Extension
- func (h *Host) GetFactory(kind otelcomponent.Kind, componentType otelcomponent.Type) otelcomponent.Factory
- func (h *Host) ReportFatalError(err error)
- type HostOption
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host implements otelcomponent.Host for Grafana Agent Flow.
func (*Host) GetExporters ¶
func (h *Host) GetExporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component
GetExporters implements otelcomponent.Host.
func (*Host) GetExtensions ¶
func (h *Host) GetExtensions() map[otelcomponent.ID]otelextension.Extension
GetExtensions implements otelcomponent.Host.
func (*Host) GetFactory ¶
func (h *Host) GetFactory(kind otelcomponent.Kind, componentType otelcomponent.Type) otelcomponent.Factory
GetFactory implements otelcomponent.Host.
func (*Host) ReportFatalError ¶
ReportFatalError implements otelcomponent.Host.
type HostOption ¶
type HostOption func(*Host)
HostOption customizes behavior of the Host.
func WithHostExporters ¶
func WithHostExporters(exporters map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component) HostOption
WithHostExporters provides a custom set of exporters to the Host.
func WithHostExtensions ¶
func WithHostExtensions(extensions map[otelcomponent.ID]otelextension.Extension) HostOption
WithHostExtensions provides a custom set of extensions to the Host.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler implements manages a set of OpenTelemetry Collector components. Scheduler is intended to be used from Flow components which need to schedule OpenTelemetry Collector components; it does not implement the full component.Component interface.
Each OpenTelemetry Collector component has one instance per supported telemetry signal, which is why Scheduler supports multiple components. For example, when creating the otlpreceiver component, you would have three total instances: one for logs, one for metrics, and one for traces. Scheduler should only be used to manage the different signals of the same OpenTelemetry Collector component; this means that otlpreceiver and jaegerreceiver should not share the same Scheduler.
func New ¶
New creates a new unstarted Scheduler. Call Run to start it, and call Schedule to schedule components to run.
func (*Scheduler) CurrentHealth ¶
CurrentHealth implements component.HealthComponent. The component is reported as healthy when the most recent set of scheduled components were started successfully.
func (*Scheduler) Run ¶
Run starts the Scheduler. Run will watch for schedule components to appear and run them, terminating previously running components if they exist.
func (*Scheduler) Schedule ¶
func (cs *Scheduler) Schedule(h otelcomponent.Host, cc ...otelcomponent.Component)
Schedule schedules a new set of OpenTelemetry Components to run. Components will only be scheduled when the Scheduler is running.
Schedule completely overrides the set of previously running components; components which have been removed since the last call to Schedule will be stopped.