Puppet Class: thanos::receive

Defined in:
manifests/receive.pp

Summary

This class manages receiver service

Overview

This class install Receiver as service that implements the Prometheus Remote Write API.

Examples:

include thanos::downsample

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    State ensured from compact service.

  • user (String) (defaults to: $thanos::user)

    User running thanos.

  • group (String) (defaults to: $thanos::group)

    Group under which thanos is running.

  • bin_path (Stdlib::Absolutepath) (defaults to: $thanos::bin_path)

    Path where binary is located.

  • log_level (Thanos::Log_level) (defaults to: 'info')

    Only log messages with the given severity or above. One of: [debug, info, warn, error, fatal]

  • log_format (Enum['logfmt', 'json']) (defaults to: 'logfmt')

    Output format of log messages. One of: [logfmt, json]

  • tracing_config_file (Optional[Stdlib::Absolutepath]) (defaults to: $thanos::tracing_config_file)

    Path to YAML file with tracing configuration. See format details: thanos.io/tracing.md/#configuration

  • http_address (String) (defaults to: '0.0.0.0:10902')

    Listen host:port for HTTP endpoints.

  • http_grace_period (String) (defaults to: '2m')

    Time to wait after an interrupt received for HTTP Server.

  • grpc_address (String) (defaults to: '0.0.0.0:10901')

    Listen ip:port address for gRPC endpoints (StoreAPI). Make sure this address is routable from other components.

  • grpc_grace_period (String) (defaults to: '2m')

    Time to wait after an interrupt received for GRPC Server.

  • grpc_server_tls_cert (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS Certificate for gRPC server, leave blank to disable TLS

  • grpc_server_tls_key (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS Key for the gRPC server, leave blank to disable TLS

  • grpc_server_tls_client_ca (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert)

  • remote_write_address (String) (defaults to: '0.0.0.0:19291')

    Address to listen on for remote write requests.

  • remote_write_server_tls_cert (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS Certificate for HTTP server, leave blank to disable TLS.

  • remote_write_server_tls_key (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS Key for the HTTP server, leave blank to disable TLS.

  • remote_write_server_tls_client_ca (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert)

  • remote_write_client_tls_cert (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS Certificates to use to identify this client to the server.

  • remote_write_client_tls_key (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS Key for the client’s certificate.

  • remote_write_client_tls_ca (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    TLS CA Certificates to use to verify servers.

  • remote_write_client_server_name (Optional[String]) (defaults to: undef)

    Server name to verify the hostname on the returned gRPC certificates. See tools.ietf.org/html/rfc4366#section-3.1

  • tsdb_path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Data directory of TSDB.

  • objstore_config_file (Optional[Stdlib::Absolutepath]) (defaults to: $thanos::storage_config_file)

    Path to YAML file that contains object store configuration. See format details: thanos.io/storage.md/#configuration

  • tsdb_retention (String) (defaults to: '15d')

    How long to retain raw samples on local storage. 0d - disables this retention.

  • receive_hashrings_file (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Path to file that contains the hashring configuration.

  • receive_hashrings_file_refresh_interval (String) (defaults to: '5m')

    Refresh interval to re-read the hashring configuration file. (used as a fallback)

  • receive_local_endpoint (Optional[String]) (defaults to: undef)

    Endpoint of local receive node. Used to identify the local node in the hashring configuration.

  • receive_tenant_header (String) (defaults to: 'THANOS-TENANT')

    HTTP header to determine tenant for write requests.

  • receive_default_tenant_id (String) (defaults to: 'default-tenant')

    HDefault tenant ID to use when none is provided via a header.

  • receive_tenant_label_name (String) (defaults to: 'tenant_id')

    Label name through which the tenant will be announced.

  • receive_replica_header (String) (defaults to: 'THANOS-REPLICA')

    HTTP header specifying the replica number of a write request.

  • receive_replication_factor (Integer) (defaults to: 1)

    How many times to replicate incoming write requests.

  • tsdb_wal_compression (Boolean) (defaults to: false)

    Compress the tsdb WAL.

  • tsdb_no_lockfile (Boolean) (defaults to: false)

    Do not create lockfile in TSDB data directory.

    In any case, the lockfiles will be deleted on next startup.
    
  • labels (Array[String]) (defaults to: [])

    External labels to announce.

    This flag will be removed in the future when handling multiple tsdb instances is added.
    
  • extra_params (Hash) (defaults to: {})

    Parameters passed to the binary, ressently released in latest version of Thanos.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'manifests/receive.pp', line 83

class thanos::receive (
  Enum['present', 'absent']      $ensure                                  = 'present',
  String                         $user                                    = $thanos::user,
  String                         $group                                   = $thanos::group,
  Stdlib::Absolutepath           $bin_path                                = $thanos::bin_path,
  # Binary Parameters
  Thanos::Log_level              $log_level                               = 'info',
  Enum['logfmt', 'json']         $log_format                              = 'logfmt',
  Optional[Stdlib::Absolutepath] $tracing_config_file                     = $thanos::tracing_config_file,
  String                         $http_address                            = '0.0.0.0:10902',
  String                         $http_grace_period                       = '2m',
  String                         $grpc_address                            = '0.0.0.0:10901',
  String                         $grpc_grace_period                       = '2m',
  Optional[Stdlib::Absolutepath] $grpc_server_tls_cert                    = undef,
  Optional[Stdlib::Absolutepath] $grpc_server_tls_key                     = undef,
  Optional[Stdlib::Absolutepath] $grpc_server_tls_client_ca               = undef,
  String                         $remote_write_address                    = '0.0.0.0:19291',
  Optional[Stdlib::Absolutepath] $remote_write_server_tls_cert            = undef,
  Optional[Stdlib::Absolutepath] $remote_write_server_tls_key             = undef,
  Optional[Stdlib::Absolutepath] $remote_write_server_tls_client_ca       = undef,
  Optional[Stdlib::Absolutepath] $remote_write_client_tls_cert            = undef,
  Optional[Stdlib::Absolutepath] $remote_write_client_tls_key             = undef,
  Optional[Stdlib::Absolutepath] $remote_write_client_tls_ca              = undef,
  Optional[String]               $remote_write_client_server_name         = undef,
  Optional[Stdlib::Absolutepath] $tsdb_path                               = undef,
  Optional[Stdlib::Absolutepath] $objstore_config_file                    = $thanos::storage_config_file,
  String                         $tsdb_retention                          = '15d',
  Optional[Stdlib::Absolutepath] $receive_hashrings_file                  = undef,
  String                         $receive_hashrings_file_refresh_interval = '5m',
  Optional[String]               $receive_local_endpoint                  = undef,
  String                         $receive_tenant_header                   = 'THANOS-TENANT',
  String                         $receive_default_tenant_id               = 'default-tenant',
  String                         $receive_tenant_label_name               = 'tenant_id',
  String                         $receive_replica_header                  = 'THANOS-REPLICA',
  Integer                        $receive_replication_factor              = 1,
  Boolean                        $tsdb_wal_compression                    = false,
  Boolean                        $tsdb_no_lockfile                        = false,
  Array[String]                  $labels                                  = [],
  # Extra parametes
  Hash                           $extra_params                            = {},
) {
  $_service_ensure = $ensure ? {
    'present' => 'running',
    default   => 'stopped'
  }

  thanos::resources::service { 'receive':
    ensure       => $_service_ensure,
    user         => $user,
    group        => $group,
    bin_path     => $bin_path,
    params       => {
      'log.level'                               => $log_level,
      'log.format'                              => $log_format,
      'tracing.config-file'                     => $tracing_config_file,
      'http-address'                            => $http_address,
      'http-grace-period'                       => $http_grace_period,
      'grpc-address'                            => $grpc_address,
      'grpc-grace-period'                       => $grpc_grace_period,
      'grpc-server-tls-cert'                    => $grpc_server_tls_cert,
      'grpc-server-tls-key'                     => $grpc_server_tls_key,
      'grpc-server-tls-client-ca'               => $grpc_server_tls_client_ca,
      'remote-write.address'                    => $remote_write_address,
      'remote-write.server-tls-cert'            => $remote_write_server_tls_cert,
      'remote-write.server-tls-key'             => $remote_write_server_tls_key,
      'remote-write.server-tls-client-ca'       => $remote_write_server_tls_client_ca,
      'remote-write.client-tls-cert'            => $remote_write_client_tls_cert,
      'remote-write.client-tls-key'             => $remote_write_client_tls_key,
      'remote-write.client-tls-ca'              => $remote_write_client_tls_ca,
      'remote-write.client-server-name'         => $remote_write_client_server_name,
      'tsdb.path'                               => $tsdb_path,
      'objstore.config-file'                    => $objstore_config_file,
      'tsdb.retention'                          => $tsdb_retention,
      'receive.hashrings-file'                  => $receive_hashrings_file,
      'receive.hashrings-file-refresh-interval' => $receive_hashrings_file_refresh_interval,
      'receive.local-endpoint'                  => $receive_local_endpoint,
      'receive.tenant-header'                   => $receive_tenant_header,
      'receive.default-tenant-id'               => $receive_default_tenant_id,
      'receive.tenant-label-name'               => $receive_tenant_label_name,
      'receive.replica-header'                  => $receive_replica_header,
      'receive.replication-factor'              => $receive_replication_factor,
      'tsdb.wal-compression'                    => $tsdb_wal_compression,
      'tsdb.no-lockfile'                        => $tsdb_no_lockfile,
      'label'                                   => $labels,
    },
    extra_params => $extra_params,
  }
}