Defined Type: otelcol::component
- Defined in:
- manifests/component.pp
Summary
Define a component for the OpenTelemetry Collector ConfigurationOverview
Generic Type for defining a component for the OpenTelemetry Collector Configuration
}
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'manifests/component.pp', line 22
define otelcol::component (
Otelcol::Component::Name $component_name,
String $type,
Hash $config = {},
Integer[0,10999] $order = 0,
Array[String[1]] $pipelines = [],
) {
# assert_private()
$component = {
$type => {
$component_name => $config,
},
}
concat::fragment { "otelcol-config-${type}-${component_name}" :
target => 'otelcol-config',
order => $order,
content => stdlib::to_yaml($component),
}
$pipelines.each |String $pipeline| {
$component = {
'service' => {
'pipelines' => {
$pipeline => {
$type => [$component_name],
},
},
},
}
concat::fragment { "otelcol-config-${type}-${component_name}-${pipeline}" :
target => 'otelcol-config',
order => $order,
content => stdlib::to_yaml($component),
}
}
}
|