v4

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

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

This section is empty.

Variables

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

Functions

This section is empty.

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 FBSupervisorConfig

type FBSupervisorConfig struct {
	FluentBitExePath     string
	FluentBitNRLibPath   string
	FluentBitParsersPath string
	FluentBitVerbose     bool
}

func (*FBSupervisorConfig) IsLogForwarderAvailable

func (c *FBSupervisorConfig) IsLogForwarderAvailable() bool

IsLogForwarderAvailable checks whether all the required files for FluentBit execution are available

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
	// PassthroughEnvironment holds a copy of its homonym in config.Config.
	PassthroughEnvironment []string
}

func NewManagerConfig

func NewManagerConfig(verbose int, 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) 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.

Jump to

Keyboard shortcuts

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