bundle

package
v0.91.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 8 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.*'
          first_only: true
          log_record:
            severity_text: info
            body: >-
              Please ensure your redis password is correctly specified with
              `--set {{ configProperty "password" "<password>" }}` or
              `{{ configPropertyEnvVar "password" "<username>" }}` environment variable.

After adding the required generate directive to bundle_gen.go and running make bundle.d:

//go:generate discoverybundler -r -t bundle.d/receivers/redis.discovery.yaml.tmpl

There is now a corresponding bundle.d/receiver/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.*'
          first_only: true
          log_record:
            severity_text: info
            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.

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

BundledFS is the in-executable filesystem that contains all bundled discovery config.d components.

If you are bootstrapping bundle_gen.go or the `discoverybundler` cmd without any rendered files in bundle.d, comment out the below embed directives before installing to prevent "no matching files found" build errors.

Functions

func FuncMap

func FuncMap() template.FuncMap

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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