Puppet Class: opentelemetry::collector
- Defined in:
- modules/opentelemetry/manifests/collector.pp
Overview
SPDX-License-Identifier: Apache-2.0
Class: opentelemetry::collector
Collects and emits opentelemetry data.
Currently installed from the otelcol-contrib distribution .deb available at github.com/open-telemetry/opentelemetry-collector-releases/releases
Parameters
- ensure
-
present/absent
- otel_gateway_fqdn
-
otel gateway's FQDN default: undef
- otel_gateway_otlp_port
-
otel-gateway's otlp grpc port default: undef
19 20 21 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 |
# File 'modules/opentelemetry/manifests/collector.pp', line 19
class opentelemetry::collector(
Wmflib::Ensure $ensure = 'absent',
Optional[Stdlib::Host] $otel_gateway_fqdn = undef,
Optional[Stdlib::Port] $otel_gateway_otlp_port = undef,
) {
$otel_user = 'otelcol-contrib'
systemd::sysuser { $otel_user:
ensure => $ensure,
description => 'OpenTelemetry Collector user',
}
apt::package_from_component { 'opentelemetry':
component => 'thirdparty/otelcol-contrib',
packages => { 'otelcol-contrib' => $ensure },
ensure_packages => true,
}
$service_ensure = $ensure ? {
'present' => 'running',
default => 'stopped',
}
service { 'otelcol-contrib':
ensure => $service_ensure,
}
file { '/etc/otelcol-contrib/config.yaml':
ensure => $ensure,
content => template('opentelemetry/config.yaml.erb'),
owner => $otel_user,
group => $otel_user,
mode => '0640',
notify => Service['otelcol-contrib'],
}
}
|