14
15
16
17
18
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
|
# File 'modules/profile/manifests/thanos/sidecar.pp', line 14
define profile::thanos::sidecar (
Stdlib::Port::Unprivileged $prometheus_port,
String $prometheus_instance,
Boolean $enable_upload = false,
Optional[String] $min_time = '-15d',
Integer $limits_request_series = lookup('thanos_limits_request_series', { 'default_value' => 0 }), # lint:ignore:wmf_styleguide
) {
$http_port = $prometheus_port + 10000
$grpc_port = $prometheus_port + 20000
# XXX refactor to move the lookup() inside a class instead
$objstore_account = lookup('profile::thanos::objstore_account') # lint:ignore:wmf_styleguide
$objstore_password = lookup('profile::thanos::objstore_password') # lint:ignore:wmf_styleguide
include profile::opentelemetry::collector
thanos::sidecar { $title :
prometheus_port => $prometheus_port,
prometheus_instance => $prometheus_instance,
http_port => $http_port,
grpc_port => $grpc_port,
min_time => $min_time,
tracing_enabled => true,
limits_request_series => $limits_request_series,
}
if $enable_upload {
Thanos::Sidecar[$title] {
objstore_account => $objstore_account,
objstore_password => $objstore_password,
}
}
firewall::service { "thanos_sidecar_${title}":
proto => 'tcp',
port => [$grpc_port, $http_port],
src_sets => ['DOMAIN_NETWORKS'], # XXX more restrictive
}
}
|