Puppet Class: thanos::store

Defined in:
manifests/store.pp

Summary

This class manages store service

Overview

This class install Store as service store node giving access to blocks in a bucket provider.

Now supported GCS, S3, Azure, Swift and Tencent COS..

Examples:

include thanos::store

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)

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

    Data directory in which to cache remote blocks.

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

    Path to YAML file that contains index cache configuration.

    See format details: https://thanos.io/components/store.md/#index-cache
    
  • index_cache_size (String) (defaults to: '250MB')

    Maximum size of items held in the index cache.

  • chunck_pool_size (String) (defaults to: '2GB')

    Maximum size of concurrently allocatable bytes for chunks.

  • store_grpc_series_sample_limit (Integer) (defaults to: 0)

    Maximum amount of samples returned via a single Series call. 0 means no limit.

    NOTE: for efficiency we take 120 as the number of samples in chunk (it cannot be bigger than that),
    so the actual number of samples might be lower, even
    though the maximum could be hit.
    
  • store_grpc_series_max_concurrency (Integer) (defaults to: 20)

    Maximum number of concurrent Series calls.

  • 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

  • sync_block_duration (String) (defaults to: '3m')

    Repeat interval for syncing the blocks between local and remote view.

  • block_sync_concurrency (Integer) (defaults to: 20)

    Number of goroutines to use when syncing blocks from object storage.

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

    Start of time range limit to serve. Thanos Store will serve only metrics, which happened later than this value.

    Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid
    duration units are ms, s, m, h, d, w, y.
    
  • max_time (Optional[String]) (defaults to: undef)

    End of time range limit to serve. Thanos Store will serve only blocks, which happened eariler than this value.

    Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid
    duration units are ms, s, m, h, d, w, y.
    
  • selector_relabel_config_file (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Path to YAML file that contains relabeling configuration that allows selecting blocks.

    It follows native Prometheus relabel-config syntax.
    See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
    
  • consistency_delay (String) (defaults to: '30m')

    Minimum age of all blocks before they are being read.

  • ignore_deletion_marks_delay (String) (defaults to: '24h')

    Duration after which the blocks marked for deletion will be filtered out while fetching blocks.

    The idea of ignore-deletion-marks-delay is to ignore blocks that are marked for deletion with some delay.
    This ensures store can still serve blocks that are meant to be deleted but do not have a replacement yet.
    If delete-delay duration is provided to compactor or bucket verify component,
    it will upload deletion-mark.json file to mark after what duration the block should be deleted rather than
    deleting the block straight away. If delete-delay is non-zero for compactor or bucket verify component,
    ignore-deletion-marks-delay should be set to (delete-delay)/2 so that blocks marked for deletion are filtered out
    while fetching blocks before being deleted from bucket. Default is 24h, half of the default value for --delete-delay on compactor.
    
  • web_external_prefix (Optional[String]) (defaults to: undef)

    Static prefix for all HTML links and redirect URLs in the UI query web interface.

    Actual endpoints are still served on / or the web.route-prefix.
    This allows thanos UI to be served behind a reverse proxy that strips a URL sub-path.
    
  • web_prefix_header (Optional[String]) (defaults to: undef)

    Name of HTTP request header used for dynamic prefixing of UI links and redirects.

    This option is ignored if web.external-prefix argument is set.
    Security risk: enable this option only if a reverse proxy in front of thanos is resetting the header.
    The --web.prefix-header=X-Forwarded-Prefix option can be useful, for example,
    if Thanos UI is served via Traefik reverse proxy with PathPrefixStrip option enabled, which sends the stripped
    prefix value in X-Forwarded-Prefix header. This allows thanos UI to be served on a sub-path.
    
  • max_open_files (Optional[Integer]) (defaults to: undef)

    Define how many open files the service is able to use In some cases, the default value (1024) needs to be increased

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

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



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
171
172
173
174
# File 'manifests/store.pp', line 97

class thanos::store (
  Enum['present', 'absent']      $ensure                            = 'present',
  String                         $user                              = $thanos::user,
  String                         $group                             = $thanos::group,
  Stdlib::Absolutepath           $bin_path                          = $thanos::bin_path,
  Optional[Integer]              $max_open_files                    = undef,
  # 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,
  Optional[Stdlib::Absolutepath] $data_dir                          = undef,
  String                         $index_cache_size                  = '250MB',
  Optional[Stdlib::Absolutepath] $index_cache_config_file           = undef,
  String                         $chunck_pool_size                  = '2GB',
  Integer                        $store_grpc_series_sample_limit    = 0,
  Integer                        $store_grpc_series_max_concurrency = 20,
  Optional[Stdlib::Absolutepath] $objstore_config_file              = $thanos::storage_config_file,
  String                         $sync_block_duration               = '3m',
  Integer                        $block_sync_concurrency            = 20,
  Optional[String]               $min_time                          = undef,
  Optional[String]               $max_time                          = undef,
  Optional[Stdlib::Absolutepath] $selector_relabel_config_file      = undef,
  String                         $consistency_delay                 = '30m',
  String                         $ignore_deletion_marks_delay       = '24h',
  Optional[String]               $web_external_prefix               = undef,
  Optional[String]               $web_prefix_header                 = undef,
  # Extra parametes
  Hash                           $extra_params                      = {},
) {
  $_service_ensure = $ensure ? {
    'present' => 'running',
    default   => 'stopped'
  }

  thanos::resources::service { 'store':
    ensure         => $_service_ensure,
    bin_path       => $bin_path,
    user           => $user,
    group          => $group,
    max_open_files => $max_open_files,
    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,
      'data-dir'                          => $data_dir,
      'index-cache.config-file'           => $index_cache_config_file,
      'index-cache-size'                  => $index_cache_size,
      'chunk-pool-size'                   => $chunck_pool_size,
      'store.grpc.series-sample-limit'    => $store_grpc_series_sample_limit,
      'store.grpc.series-max-concurrency' => $store_grpc_series_max_concurrency,
      'objstore.config-file'              => $objstore_config_file,
      'sync-block-duration'               => $sync_block_duration,
      'block-sync-concurrency'            => $block_sync_concurrency,
      'min-time'                          => $min_time,
      'max-time'                          => $max_time,
      'selector.relabel-config-file'      => $selector_relabel_config_file,
      'consistency-delay'                 => $consistency_delay,
      'ignore-deletion-marks-delay'       => $ignore_deletion_marks_delay,
      'web.external-prefix'               => $web_external_prefix,
      'web.prefix-header'                 => $web_prefix_header,
    },
    extra_params   => $extra_params,
  }
}