tiup icon indicating copy to clipboard operation
tiup copied to clipboard

cluster: support retention by size for prometheus

Open AstroProfundis opened this issue 2 months ago • 3 comments

What problem does this PR solve?

Add support of retention by size for Prometheus. Default value is empty to keep former behavior unchanged. The storage.tsdb.retention.size and storage.tsdb.retention.time can be set together.

If both time and size retention policies are specified, whichever triggers first will be used.

See Prometheus doc for details.

Also close #2058

Check List

Tests

  • [x] Unit test
  • [ ] Integration test
  • [x] Manual test (add detailed scripts or steps below)
    • Tested with TiDB v8.5.2, which uses Prometheus v2.49.1
  • [ ] No code

Code changes

  • [ ] Has exported function/method change
  • [x] Has exported variable/fields change
  • [ ] Has interface methods change
  • [x] Has persistent data change

Side effects

  • [ ] Possible performance regression
  • [ ] Increased code complexity
  • [ ] Breaking backward compatibility

Related changes

  • [ ] Need to cherry-pick to the release branch
  • [x] Need to update the documentation

Release notes:

NONE

AstroProfundis avatar Oct 10 '25 08:10 AstroProfundis

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign xhebox for approval. For more information see the Code Review Process. Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ti-chi-bot[bot] avatar Oct 10 '25 08:10 ti-chi-bot[bot]

@dveeden: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

ti-chi-bot[bot] avatar Oct 31 '25 07:10 ti-chi-bot[bot]

Codecov Report

:x: Patch coverage is 44.44444% with 10 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 41.46%. Comparing base (2dea252) to head (b2b2026).

Files with missing lines Patch % Lines
pkg/cluster/spec/monitoring.go 44.44% 8 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2612      +/-   ##
==========================================
+ Coverage   41.39%   41.46%   +0.07%     
==========================================
  Files         363      363              
  Lines       37182    37198      +16     
==========================================
+ Hits        15391    15424      +33     
+ Misses      19898    19871      -27     
- Partials     1893     1903      +10     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Nov 18 '25 06:11 codecov-commenter