bundle

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

bundle.d

bundle.d refers to the embed.FS config directory made available by the bundle.BundledFS. It currently consists of all ./bundle.d/extensions/*.discovery.yaml and ./bundle.d/receivers/*.discovery.yaml files that are generated by the discoverybundler cmd as used by go:generate directives in bundle_gen.go.

To construct the latest bundle.d contents before building the collector run:

$ make bundle.d

*.discovery.yaml.tmpl

All discovery config component discovery.yaml files are generated from text/template discovery.yaml.tmpl files using built-in validators and property guidance helpers:

Example redis.discovery.yaml.tmpl:

{{ receiver "redis" }}:
  enabled: true
  rule:
    docker_observer: type == "container" and port == 6379
    <...>
  status:
    <...>
    statements:
      partial:
        - regexp: 'ERR AUTH.*'
          log_record:
            body: >-
              Please ensure your redis password is correctly specified with
              `--set {{ configProperty "password" "<password>" }}` or
              `{{ configPropertyEnvVar "password" "<username>" }}` environment variable.

After adding the required new component filename prefix to the Components instance in components.go and running make bundle.d, there's now a corresponding bundle.d/receivers/redis.discovery.yaml:

#####################################################################################
# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. #
#####################################################################################
redis:
  enabled: true
  rule:
    docker_observer: type == "container" and port == 6379
  <...>
  status:
  <...>
    statements:
      partial:
        - regexp: 'ERR AUTH.*'
          log_record:
            body: >-
              Please ensure your redis password is correctly specified with
              `--set splunk.discovery.receivers.redis.config.password="<password>"` or
              `SPLUNK_DISCOVERY_RECEIVERS_redis_CONFIG_password="<username>"` environment variable.

In order for this to be included in the Windows and Linux BundledFS be sure to include the component filename prefix in the corresponding Components.Linux and Components.Windows functions.

When building the collector afterward, this redis receiver discovery config is now made available to discovery mode, and it can be disabled by --set splunk.discovery.receivers.redis.enabled=false or SPLUNK_DISCOVERY_RECEIVERS_redis_ENABLED=false.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BundledFS embed.FS
View Source
var (
	Components = DiscoComponents{
		Extensions: func() []string {
			sort.Strings(extensions)
			return extensions
		}(),
		Receivers: func() []string {
			sort.Strings(receivers)
			return receivers
		}(),
		Linux: func() map[string]struct{} {
			linux := map[string]struct{}{}
			for _, extension := range extensions {
				linux[extension] = struct{}{}
			}
			for _, receiver := range receivers {
				linux[receiver] = struct{}{}
			}
			return linux
		}(),
		Windows: func() map[string]struct{} {
			windows := map[string]struct{}{
				"mongodb":               {},
				"mysql":                 {},
				"oracledb":              {},
				"postgresql":            {},
				"redis":                 {},
				"smartagent-postgresql": {},
			}
			for _, extension := range extensions {
				windows[extension] = struct{}{}
			}
			return windows
		}(),
	}
)

Functions

func FuncMap

func FuncMap() template.FuncMap

Types

type DiscoComponents added in v0.91.1

type DiscoComponents struct {
	Linux      map[string]struct{}
	Windows    map[string]struct{}
	Extensions []string
	Receivers  []string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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