Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query: Allow configuring telemetry.request options #299

Merged

Conversation

jacobbaungard
Copy link
Contributor

@jacobbaungard jacobbaungard commented Apr 24, 2023

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

With this commit we allow configuring the following Thanos query options:

  • query.telemetry.request-duration-seconds-quantiles
  • query.telemetry.request-samples-quantiles
  • query.telemetry.request-series-seconds-quantiles

Note that the jsonnet variable expects a comma seperated list, which will be expanded to the format required by Thanos. As an example the following jsonnet configuration:

telemetryDurationQuantiles: '1, 2, 3',
telemetrySamplesQuantiles: '100,1000,10000,100000',
telemetrySeriesQuantiles: '10,100,1000,10000',

Will result in the following command line arguments to Thanos

--query.telemetry.request-duration-seconds-quantiles=1
--query.telemetry.request-duration-seconds-quantiles=2
--query.telemetry.request-duration-seconds-quantiles=3
--query.telemetry.request-samples-quantiles=100
--query.telemetry.request-samples-quantiles=1000
--query.telemetry.request-samples-quantiles=10000
--query.telemetry.request-samples-quantiles=100000
--query.telemetry.request-series-seconds-quantiles=10
--query.telemetry.request-series-seconds-quantiles=100
--query.telemetry.request-series-seconds-quantiles=1000
--query.telemetry.request-series-seconds-quantiles=10000

Verification

  • Adjusted example.jsonnet to include the above options, built the manifests and confirmed that the query component starts correctly.

@jacobbaungard
Copy link
Contributor Author

I think the linter fails due to a bug in older version of jsonnet-lint. At least it seems to work OK on the latest version (see below). Can we update the tooling ?

❯ ~/go/bin/jsonnet-lint --version
Jsonnet linter v0.20.0
❯ ~/go/bin/jsonnet-lint  -J vendor ./jsonnet/kube-thanos/kube-thanos-query.libsonnet
❯ echo $?
0
❯ /home/jacobhansen/go/bin/jsonnet-lint-v0.17.1-0.20210101181740-31d71aaccda6 -J vendor ./jsonnet/kube-thanos/kube-thanos-query.libsonnet
./jsonnet/kube-thanos/kube-thanos-query.libsonnet:162:71-85 Indexed object has no field "stripChars"

            '--query.telemetry.request-duration-seconds-quantiles=' + std.stripChars(quantile, ' ')
....

With this commit we allow configuring the following Thanos query
options:
- query.telemetry.request-duration-seconds-quantiles
- query.telemetry.request-samples-quantiles
- query.telemetry.request-series-seconds-quantiles

Note that the jsonnet variable expects a comma seperated list, which
will be expanded to the format required by Thanos. As an example the
following jsonnet configuration:

```
telemetryDurationQuantiles: '1, 2, 3',
telemetrySamplesQuantiles: '100,1000,10000,100000',
telemetrySeriesQuantiles: '10,100,1000,10000',
```

Will result in the following command line arguments to Thanos

```
--query.telemetry.request-duration-seconds-quantiles=1
--query.telemetry.request-duration-seconds-quantiles=2
--query.telemetry.request-duration-seconds-quantiles=3
--query.telemetry.request-samples-quantiles=100
--query.telemetry.request-samples-quantiles=1000
--query.telemetry.request-samples-quantiles=10000
--query.telemetry.request-samples-quantiles=100000
--query.telemetry.request-series-seconds-quantiles=10
--query.telemetry.request-series-seconds-quantiles=100
--query.telemetry.request-series-seconds-quantiles=1000
--query.telemetry.request-series-seconds-quantiles=10000
```

Signed-off-by: Jacob Baungard Hansen <[email protected]>
@saswatamcode saswatamcode merged commit 3291d85 into thanos-io:main Apr 24, 2023
@jacobbaungard jacobbaungard deleted the query-telemetry-request-config branch May 4, 2023 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants