Skip to content

Commit

Permalink
feat/receive (#38)
Browse files Browse the repository at this point in the history
* fix: fix receiver tsdb.path var name

* feat: add labels flag

---------

Co-authored-by: Victor Varias <vvarias@veepee.com>
  • Loading branch information
victorvarias and Victor Varias committed Mar 8, 2023
1 parent 7ce787c commit f700a40
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
16 changes: 13 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ The following parameters are available in the `thanos::receive` class:
* [`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)
* [`data_dir`](#data_dir)
* [`tsdb_path`](#tsdb_path)
* [`objstore_config_file`](#objstore_config_file)
* [`tsdb_retention`](#tsdb_retention)
* [`receive_hashrings_file`](#receive_hashrings_file)
Expand All @@ -1634,6 +1634,7 @@ The following parameters are available in the `thanos::receive` class:
* [`receive_replication_factor`](#receive_replication_factor)
* [`tsdb_wal_compression`](#tsdb_wal_compression)
* [`tsdb_no_lockfile`](#tsdb_no_lockfile)
* [`labels`](#labels)
* [`extra_params`](#extra_params)

##### <a name="ensure"></a>`ensure`
Expand Down Expand Up @@ -1812,11 +1813,11 @@ Server name to verify the hostname on the returned gRPC certificates. See https:

Default value: ``undef``

##### <a name="data_dir"></a>`data_dir`
##### <a name="tsdb_path"></a>`tsdb_path`

Data type: `Optional[Stdlib::Absolutepath]`

Data directory in which to cache blocks and process downsamplings.
Data directory of TSDB.

Default value: ``undef``

Expand Down Expand Up @@ -1917,6 +1918,15 @@ Do not create lockfile in TSDB data directory.

Default value: ``false``

##### <a name="labels"></a>`labels`

Data type: `Array[String]`

External labels to announce.
This flag will be removed in the future when handling multiple tsdb instances is added.

Default value: `[]`

##### <a name="extra_params"></a>`extra_params`

Data type: `Hash`
Expand Down
13 changes: 9 additions & 4 deletions manifests/receive.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
# TLS CA Certificates to use to verify servers.
# @param remote_write_client_server_name
# Server name to verify the hostname on the returned gRPC certificates. See https://tools.ietf.org/html/rfc4366#section-3.1
# @param data_dir
# Data directory in which to cache blocks and process downsamplings.
# @param tsdb_path
# Data directory of TSDB.
# @param objstore_config_file
# Path to YAML file that contains object store configuration. See format details: https://thanos.io/storage.md/#configuration
# @param tsdb_retention
Expand All @@ -73,6 +73,9 @@
# @param tsdb_no_lockfile
# Do not create lockfile in TSDB data directory.
# In any case, the lockfiles will be deleted on next startup.
# @param labels
# External labels to announce.
# This flag will be removed in the future when handling multiple tsdb instances is added.
# @param extra_params
# Parameters passed to the binary, ressently released in latest version of Thanos.
# @example
Expand Down Expand Up @@ -101,7 +104,7 @@
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] $data_dir = 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,
Expand All @@ -114,6 +117,7 @@
Integer $receive_replication_factor = 1,
Boolean $tsdb_wal_compression = false,
Boolean $tsdb_no_lockfile = false,
Array[String] $labels = [],
# Extra parametes
Hash $extra_params = {},
) {
Expand Down Expand Up @@ -146,7 +150,7 @@
'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,
'data-dir' => $data_dir,
'tsdb.path' => $tsdb_path,
'objstore.config-file' => $objstore_config_file,
'tsdb.retention' => $tsdb_retention,
'receive.hashrings-file' => $receive_hashrings_file,
Expand All @@ -159,6 +163,7 @@
'receive.replication-factor' => $receive_replication_factor,
'tsdb.wal-compression' => $tsdb_wal_compression,
'tsdb.no-lockfile' => $tsdb_no_lockfile,
'label' => $labels,
},
extra_params => $extra_params,
}
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/receive_rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'remote-write.client-tls-key' => nil,
'remote-write.client-tls-ca' => nil,
'remote-write.client-server-name' => nil,
'data-dir' => nil,
'tsdb.path' => nil,
'objstore.config-file' => '/etc/thanos/storage.yaml',
'tsdb.retention' => '15d',
'receive.hashrings-file' => nil,
Expand All @@ -56,6 +56,7 @@
'receive.replication-factor' => 1,
'tsdb.wal-compression' => false,
'tsdb.no-lockfile' => false,
'label' => [],
},
)
}
Expand Down

0 comments on commit f700a40

Please sign in to comment.