v4

package
v1.67.3 Latest Latest
Warning

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

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

README

Fluentbit supervisor

td-agent-bit is becoming fluent-bit in version 2.x, so the binary name and paths are changing. To prevent any issue we will handle this under a Feature Flag.

Update 2023-03-13

This change will be only done for Windows for now as there is a bug present in FB 2.0.6 that is not fixed yet. The changes needed for Windows will be left in a draft PR

fb_1_vs_2_ff.png

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	FbConfTempFolderNameDefault = "fb"

	MaxNumberOfFbConfigTempFiles int = 50
)

Variables

View Source
var ObserverName = "LogForwarderSupervisor" // nolint:gochecknoglobals

Functions

func NewFBSupervisorConfig added in v1.67.3

func NewFBSupervisorConfig(
	ffRetriever feature_flags.Retriever,
	agentDir string,
	integrationsDir string,
	loggingBinDir string,
	fluentBitExePath string,
	fluentBitNRLibPath string,
	fluentBitParsersPath string,
	fluentBitVerbose bool,
	confTempFolder string,
) fBSupervisorConfig

NewFBSupervisorConfig creates a new fBSupervisorConfig that will contain the FF retriever not exported to force using the constructor and ensuring it contains all necessary dependencies nolint:revive

Types

type Executor

type Executor interface {
	// When writable a PID channel is provided, generated PID will be written.
	Execute(ctx context.Context, pidChan, exitCodeCh chan<- int) executor.OutputReceive
}

type Manager

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

func NewManager

func NewManager(
	cfg ManagerConfig,
	configLoader v4Config.Loader,
	emitter emitter.Emitter,
	il integration.InstancesLookup,
	definitionQ chan integration.Definition,
	configEntryQ chan configrequest.Entry,
	tracker *track.Tracker,
	idLookup host.IDLookup,
) *Manager

NewManager loads all the integration configuration files from the given folders. It discards the integrations not belonging to the protocol V4. Usually, "configFolders" will be the value of the "pluginInstanceDir" configuration option The "definitionFolders" refer to the v3 definition yaml configs, placed here for v3 integrations backwards-support

func (*Manager) DisableOHIFromFF

func (mgr *Manager) DisableOHIFromFF(featureFlag string) error

DisableOHIFromFF disables an integration coming from CC request. Formats btw CC FF and config files: see EnableOHIFromCmd

func (*Manager) EnableOHIFromFF

func (mgr *Manager) EnableOHIFromFF(ctx context.Context, featureFlag string) error

EnableOHIFromFF enables an integration coming from CC request.

func (*Manager) RunOnce

func (mgr *Manager) RunOnce(ctx context.Context)

RunOnce will run all the integration groups for one time and then exit.

func (*Manager) Start

func (mgr *Manager) Start(ctx context.Context)

Start in background the v4 integrations lifecycle management, including hot reloading, interval and timeout management

type ManagerConfig

type ManagerConfig struct {
	// ConfigPaths store the YAML integrations configurations.
	// They may also contain -config.yml files from v3 integrations
	ConfigPaths   []string
	AgentFeatures map[string]bool // features from agent config file
	// DefinitionFolders store the v3 -definition.yml plugins (legacy support)
	// and the executables where the agent will look for if only the 'name' property is specified for an integration
	DefinitionFolders []string
	// Defines verbosity level in v3 legacy integrations
	Verbose int
	// Defines TempDir folder in v3 legacy integrations
	TempDir string
	// PassthroughEnvironment holds a copy of its homonym in config.Config.
	PassthroughEnvironment []string
}

func NewManagerConfig

func NewManagerConfig(verbose int, tempDir string, features map[string]bool, passthroughEnvs, configFolders, definitionFolders []string) ManagerConfig

type ParseProcessOutput

type ParseProcessOutput func(line string) (sanitizedLine string, severity logrus.Level)

type SendEventFn

type SendEventFn func(event sample.Event, entityKey entity.Key)

SendEventFn wrapper for sending events to nr.

type Supervisor

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

Supervisor is a wrapper for starting and supervising external processes.

func NewFBSupervisor

func NewFBSupervisor(fbIntCfg fBSupervisorConfig, cfgLoader *logs.CfgLoader, agentIDNotifier id.UpdateNotifyFn, notifier hostname.ChangeNotifier, sendEventFn SendEventFn) *Supervisor

NewFBSupervisor builds a Fluent Bit supervisor which forwards the output to agent logs.

func (*Supervisor) Restart added in v1.67.3

func (s *Supervisor) Restart() error

func (*Supervisor) Run

func (s *Supervisor) Run(ctx ctx2.Context)

type SupervisorEvent

type SupervisorEvent struct {
	sample.BaseEvent
	Summary    string `json:"summary"`
	ExitStatus string `json:"exitStatus"`
}

SupervisorEvent will be used to create an InfrastructureEvent when fb start/stop.

func NewSupervisorEvent

func NewSupervisorEvent(eventSummary string, status cmdExitStatus) *SupervisorEvent

NewSupervisorEvent create a new SupervisorEvent instance. For running ongoing pass -1.

Directories

Path Synopsis
dm
cumulative
Package cumulative creates Count metrics from cumulative values.
Package cumulative creates Count metrics from cumulative values.
cfgreq command
cmdreq command
environment command
huge command
longrunning_hb command
longtime command
protocol_v4 command
simple command
validyaml command

Jump to

Keyboard shortcuts

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