Defined Type: otelcol::extension

Defined in:
manifests/extension.pp

Summary

Add an extension to the OpenTelemetry Collector configuration

Overview

Examples:

Basic usage

otelcol::extension { 'namevar': }

Parameters:

  • name

    The name of the extension

  • config (Hash) (defaults to: {})

    The configuration for the extension

  • order (Integer[0,999]) (defaults to: 0)

    The order in which the extension should be loaded



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'manifests/extension.pp', line 12

define otelcol::extension (
  Hash $config = {},
  Integer[0,999] $order = 0,
) {
  $component = {
    'extensions' => {
      $name => $config,
    },
    'service' => {
      'extensions' => [$name],
    },
  }
  $real_order = 4000+$order
  concat::fragment { "otelcol-config-extension-${name}" :
    target  => 'otelcol-config',
    order   => $real_order,
    content => stdlib::to_yaml($component),
  }
}