Skip to content

Add an interval setting to the k8sobjects preset - #2374

Closed
agagniere wants to merge 1 commit into
open-telemetry:mainfrom
agagniere:k8sobjects-preset-interval
Closed

Add an interval setting to the k8sobjects preset#2374
agagniere wants to merge 1 commit into
open-telemetry:mainfrom
agagniere:k8sobjects-preset-interval

Conversation

@agagniere

Copy link
Copy Markdown
Member

Description

Allows setting an interval to the pull-mode entries of the k8s_objects receiver via the kubernetesObjects preset.

Currently we cannot use the preset if we want a non-default pull interval. And the default interval is 1h.

This PR adds a single setting:

presets:
  kubernetesObjects:
    enabled: true
    watch: true
    interval: 30s # <- instead of 1h

Authorship

  • I, a human, wrote this pull request description myself.

@agagniere
agagniere marked this pull request as ready for review August 27, 2026 16:48

@TylerHelmuth TylerHelmuth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking because we shouldn't expose component config in a preset. Instead we could support meaningful duration presets.

# When enabled, watch mode is added alongside pull to stream real-time changes.
watch: false
# Sets the polling interval for objects collected in pull mode (e.g. "30m"). Defaults to the receiver's default (1h) when unset.
interval: ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We purposefully make the presets very very opinionated and we do not want to expose component config through them. In general presets should be all boolean configuration options.

The best way to achieve this same outcome while using the preset is to combine the preset with config:

presets:
  kubernetesObjects:
    enabled: true
config:
  receivers:
    k8sobjects:
      interval: 30m

@agagniere agagniere Aug 27, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good solution.
My previous attempt to set only certain values in the config and use presets at the same time resulted in the config getting overridden by the preset's config, which is why I had given up on it.
But in this case the field is unset by the preset, so it works nicely 👍

I'll just have to be on the lookout for when the chart will update the receiver name from k8sobjects to k8s_objects

@agagniere

Copy link
Copy Markdown
Member Author

There is a way to customize this setting while also benefiting from the preset

@agagniere agagniere closed this Aug 27, 2026
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