Puppet Class: thanos::compact

Defined in:
manifests/compact.pp

Summary

This class manages compact service

Overview

This class install Compact as service to continuously compacts blocks in an object store bucket.

Examples:

include thanos::compact

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.

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

    Data directory in which to cache blocks and process compactions.

  • 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

  • consistency_delay (String) (defaults to: '30m')

    Minimum age of fresh (non-compacted) blocks before they are being processed.

    Malformed blocks older than the maximum of consistency-delay and 30m0s will be removed.
    
  • retention_resolution_raw (String) (defaults to: '0d')

    How long to retain raw samples in bucket. 0d - disables this retention

  • retention_resolution_5m (String) (defaults to: '0d')

    How long to retain samples of resolution 1 (5 minutes) in bucket. 0d - disables this retention

  • retention_resolution_1h (String) (defaults to: '0d')

    How long to retain samples of resolution 2 (1 hour) in bucket. 0d - disables this retention

  • wait (Boolean) (defaults to: false)

    Do not exit after all compactions have been processed and wait for new work.

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

    Wait interval between consecutive compaction runs and bucket refreshes.

    Only works when --wait flag specified.
    
  • downsampling_disable (Boolean) (defaults to: false)

    Disables downsampling. This is not recommended as querying long time ranges without non-downsampled data is

    not efficient and useful e.g it is not possible to render all samples for a human eye anyway
    
  • block_viewer_global_sync_block_interval (String) (defaults to: '1m')

    Repeat interval for syncing the blocks between local and remote view for /global Block Viewer UI.

  • compact_concurrency (Integer) (defaults to: 1)

    Number of goroutines to use when compacting groups.

  • delete_delay (String) (defaults to: '48h')

    Time before a block marked for deletion is deleted from bucket.

    If delete-delay is non zero, blocks will be marked for deletion and compactor component will
    delete blocks marked for deletion from the bucket. If delete-delay is 0, blocks will be deleted straight away.
    Note that deleting blocks immediately can cause query failures, if store gateway still has the block loaded,
    or compactor is ignoring the deletion because it's compacting the block at the same time.
    
  • 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
    
  • web_external_prefix (Optional[String]) (defaults to: undef)

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

    Actual endpoints are still served on / or the web.route-prefix.
    This allows thanos bucket web 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.
    
  • bucket_web_label (Optional[String]) (defaults to: undef)

    Prometheus label to use as timeline title in the bucket web UI

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

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



75
76
77
78
79
80
81
82
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
# File 'manifests/compact.pp', line 75

class thanos::compact (
  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',
  Optional[Stdlib::Absolutepath] $data_dir                                = undef,
  Optional[Stdlib::Absolutepath] $objstore_config_file                    = $thanos::storage_config_file,
  String                         $consistency_delay                       = '30m',
  String                         $retention_resolution_raw                = '0d',
  String                         $retention_resolution_5m                 = '0d',
  String                         $retention_resolution_1h                 = '0d',
  Boolean                        $wait                                    = false,
  String                         $wait_interval                           = '5m',
  Boolean                        $downsampling_disable                    = false,
  String                         $block_viewer_global_sync_block_interval = '1m',
  Integer                        $compact_concurrency                     = 1,
  String                         $delete_delay                            = '48h',
  Optional[Stdlib::Absolutepath] $selector_relabel_config_file            = undef,
  Optional[String]               $web_external_prefix                     = undef,
  Optional[String]               $web_prefix_header                       = undef,
  Optional[String]               $bucket_web_label                        = undef,
  # Extra parametes
  Hash                           $extra_params                            = {},
) {
  $_service_ensure = $ensure ? {
    'present' => 'running',
    default   => 'stopped'
  }

  thanos::resources::service { 'compact':
    ensure       => $_service_ensure,
    bin_path     => $bin_path,
    user         => $user,
    group        => $group,
    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,
      'data-dir'                                => $data_dir,
      'objstore.config-file'                    => $objstore_config_file,
      'consistency-delay'                       => $consistency_delay,
      'retention.resolution-raw'                => $retention_resolution_raw,
      'retention.resolution-5m'                 => $retention_resolution_5m,
      'retention.resolution-1h'                 => $retention_resolution_1h,
      'wait'                                    => $wait,
      'wait-interval'                           => $wait_interval,
      'downsampling.disable'                    => $downsampling_disable,
      'block-viewer.global.sync-block-interval' => $block_viewer_global_sync_block_interval,
      'compact.concurrency'                     => $compact_concurrency,
      'delete-delay'                            => $delete_delay,
      'selector.relabel-config-file'            => $selector_relabel_config_file,
      'web.external-prefix'                     => $web_external_prefix,
      'web.prefix-header'                       => $web_prefix_header,
      'bucket-web-label'                        => $bucket_web_label,
    },
    extra_params => $extra_params,
  }
}