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
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
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- func LogFields(def integration.Definition) logrus.Fields
- func NewGroup(loadFn LoadFn, il integration.InstancesLookup, passthroughEnv []string, ...) (g Group, c FeaturesCache, err error)
- func NewRunner(intDef integration.Definition, emitter emitter.Emitter, ...) *runner
- type CmdFF
- type Features
- type FeaturesCache
- type Group
- type LoadFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogFields ¶
func LogFields(def integration.Definition) logrus.Fields
func NewGroup ¶
func NewGroup( loadFn LoadFn, il integration.InstancesLookup, passthroughEnv []string, emitter emitter.Emitter, cmdReqHandle cmdrequest.HandleFn, configHandle configrequest.HandleFn, cfgPath string, terminateDefinitionQ chan string, idLookup host.IDLookup, ) (g Group, c FeaturesCache, err error)
NewGroup configures a Group instance that is provided by the passed LoadFn cfgPath is used for caching to be consumed by cmd-channel FF enabler.
func NewRunner ¶
func NewRunner( intDef integration.Definition, emitter emitter.Emitter, dSources *databind.Sources, handleErrorsProvide func() runnerErrorHandler, cmdReqHandle cmdrequest.HandleFn, configHandle configrequest.HandleFn, terminateQ chan<- string, idLookup host.IDLookup, ) *runner
NewRunner creates an integration runner instance. args: discoverySources, handleErrorsProvide and cmdReqHandle are optional (nils allowed).
Types ¶
type CmdFF ¶
CmdFF DTO storing a request from the cmd-channel to enable or disable an integration feature.
func (*CmdFF) IsEnabledOHI ¶
IsEnabledOHI returns if enabled or nil in case it's unknown.
type Features ¶
type Features struct {
// contains filtered or unexported fields
}
Features carries the agent config features and a cmd-channel feature, to be able to determine a future OHI execution.
func NewFeatures ¶
NewFeatures creates a features object bundling features provided by agent and cmd-channel FF. If no matching feature is found nil is returned. Formats btw CC FF and config files:
- Cmd-Channel FF: | docker_enabled
- Agent yaml: | features: | docker_enabled: true
- OHI yaml: | - name: nri-docker | when: | feature: docker_enabled
func (*Features) IsOHIExecutable ¶
IsOHIExecutable determines the execution of an OHI given the features from config deps (agent & OHI) and cmd-channel. Rules: a. !ohi FF -> executed b. ohi FF + agent FF -> agent determines c. ohi FF + !agent FF + !CC -> not executed d. ohi FF + !agent FF + CC -> cmd-channel determines
type FeaturesCache ¶
FeaturesCache stores per feature name it's config path.
func (FeaturesCache) Update ¶
func (c FeaturesCache) Update(newFC FeaturesCache)
Update updates current cache merging from provided one.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a set of runnable integrations that are located in the same integration configuration file, and thus share a common discovery mechanism configuration. It also does the following tasks: - parses integration output and forwards it - parses standard error and logs it - catches errors and logs them - manages the cancellation of tasks, as this should-be hot-reloaded
type LoadFn ¶
type LoadFn func(dr integration.InstancesLookup, passthroughEnv []string, cfgPath string, cmdReqHandle cmdrequest.HandleFn, configHandle configrequest.HandleFn, terminateDefinitionQ chan string) (Group, FeaturesCache, error)
LoadFn provides a basic, incomplete Group instance to be configured by the NewGroup function. InstancesLookup is only required to load v3 integrations from an external definitions folder.