Skip to content

feat: add staleSeriesCompactionThreshold field to TSDBSpec#8563

Merged
simonpasquier merged 1 commit into
prometheus-operator:mainfrom
kubeservice-stack:update-tsdbconfig
May 13, 2026
Merged

feat: add staleSeriesCompactionThreshold field to TSDBSpec#8563
simonpasquier merged 1 commit into
prometheus-operator:mainfrom
kubeservice-stack:update-tsdbconfig

Conversation

@dongjiang1989

Copy link
Copy Markdown
Member

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

Closes: #ISSUE-NUMBER

ref: prometheus/prometheus#16929

  • Add staleSeriesCompactionThreshold field to TSDBSpec in the Prometheus and PrometheusAgent CRDs
  • The threshold is a ratio (0.0–1.0) that triggers stale series compaction from memory into persistent blocks
  • Adds validation to ensure the threshold value is between 0 and 1
  • Generates Prometheus config with stale_series_compaction_threshold under storage.tsdb, requiring Prometheus >= v3.10.0
  • Includes unit tests and golden test files for both supported and unsupported versions

If you're contributing for the first-time, check our contribution guidelines.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

 add `staleSeriesCompactionThreshold` field to TSDBSpec

@dongjiang1989
dongjiang1989 requested a review from a team as a code owner May 9, 2026 08:59
Comment thread pkg/apis/monitoring/v1/prometheus_types.go Outdated
Comment thread pkg/apis/monitoring/v1/prometheus_types.go Outdated
Comment thread pkg/apis/monitoring/v1/prometheus_types.go Outdated
Comment thread pkg/prometheus/promcfg_test.go

@simonpasquier simonpasquier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could factorize the server and agent code but the current version is good enough.

Comment thread pkg/apis/monitoring/v1/prometheus_types.go Outdated
Signed-off-by: dongjiang <[email protected]>

@simonpasquier simonpasquier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@simonpasquier
simonpasquier merged commit bcbb597 into prometheus-operator:main May 13, 2026
22 checks passed
@dongjiang1989
dongjiang1989 deleted the update-tsdbconfig branch May 13, 2026 14:57
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Jul 22, 2026
…r to v0.92.1 (#1765)

##### [\`v0.92.1\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.92.1)

- \[BUGFIX] Fix "namespace not found" errors when the operator watches monitoring and workload resources in different resources. [#8658](prometheus-operator/prometheus-operator#8658)

---
##### [\`v0.92.0\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.92.0)

> \[!NOTE]
> The `PrometheusTopologySharding` and `PrometheusShardRetentionPolicy` feature gates have been promoted to **Beta** in this release and are now enabled by default. See the [sharding documentation](https://prometheus-operator.dev/docs/platform/sharding/) for details.

- \[CHANGE] Add URL validation for the `tokenUrl` field in OAuth2 configuration across all CRDs. [#8579](prometheus-operator/prometheus-operator#8579)
- \[CHANGE] Add URL validation for the `url` field in `RemoteReadSpec` in `Prometheus` CRD. [#8596](prometheus-operator/prometheus-operator#8596)
- \[FEATURE] Migrate retention options from CLI flags to the config file for `Prometheus` CRD (Prometheus >= v3 uses the config file; older versions continue to use CLI flags). [#8547](prometheus-operator/prometheus-operator#8547)
- \[FEATURE] Add `staleSeriesCompactionThreshold` field to `TSDBSpec` in `Prometheus` and `PrometheusAgent` CRDs. [#8563](prometheus-operator/prometheus-operator#8563)
- \[FEATURE] Add `labelNameUnderscoreSanitization` and `labelNamePreserveMultipleUnderscores` fields to `OTLPConfig` in `Prometheus` and `PrometheusAgent` CRDs. [#8562](prometheus-operator/prometheus-operator#8562)
- \[FEATURE] Add `payload` field to Webhook receiver in `AlertmanagerConfig` CRD. [#8507](prometheus-operator/prometheus-operator#8507)
- \[ENHANCEMENT] Use pod topology labels for zone sharding on Kubernetes >= 1.35 when the `PrometheusTopologySharding` feature gate is enabled (removes the need for `attachMetadata.node=true`). [#8564](prometheus-operator/prometheus-operator#8564)
- \[ENHANCEMENT] Add validation for the Slack `update_message` field in Alertmanager configuration Secret. [#8556](prometheus-operator/prometheus-operator#8556)
- \[BUGFIX] Validate target labels in `Probe` static configuration to prevent invalid Prometheus scrape configs. [#7901](prometheus-operator/prometheus-operator#7901)
- \[BUGFIX] Fix goroutine leak and data race in `pollBasedListerWatcher`. [#8593](prometheus-operator/prometheus-operator#8593)
- \[BUGFIX] Validate `ProxyConfig` in OAuth2 configuration. [#8610](prometheus-operator/prometheus-operator#8610)
- \[BUGFIX] Fix SMTP smarthost format error handling in Alertmanager configuration. [#8586](prometheus-operator/prometheus-operator#8586)
- \[BUGFIX] Fix missing `return` in admission webhook after marshal failure. [#8582](prometheus-operator/prometheus-operator#8582)
- \[BUGFIX] Fix `FindOwner` to return `nil` on `meta.Accessor` error. [#8585](prometheus-operator/prometheus-operator#8585)
- \[BUGFIX] Fix dropped gzip `Close` errors in `GzipConfig` and `GunzipConfig`. [#8573](prometheus-operator/prometheus-operator#8573)
- \[BUGFIX] Fix panic on malformed key=value flag input (e.g. `--labels "key"`). [#8560](prometheus-operator/prometheus-operator#8560)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants