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

Simplifying stateful behavior #35011

Closed
VihasMakwana opened this issue Sep 4, 2024 · 2 comments
Closed

Simplifying stateful behavior #35011

VihasMakwana opened this issue Sep 4, 2024 · 2 comments
Labels
enhancement New feature or request needs triage New item requiring triage

Comments

@VihasMakwana
Copy link
Contributor

Component(s)

No response

Is your feature request related to a problem? Please describe.

Currently, the collector operates in a stateless mode by default, with stateful components storing offsets in memory. However, stateful components should persist their state during shutdown if a storage extension is available.

At present, enabling stateful behavior involves a somewhat lengthy process:

  1. Adding a filestorage entry to the extensions stanza in the configuration.
  2. Including filestorage under service::extensions.
  3. Ensuring that the storage directory exists.
  4. Adding storageID: filelogreceiver/xyz to individual components.

It would be beneficial to simplify this process by introducing a feature gate or a single configuration option. With this approach, users could enable stateful mode with a single setting, and the necessary steps would be handled automatically, achieving the same effect as the manual steps described.

Describe the solution you'd like

Here’s one way to tackle the issue:

  • Introduce a new configuration provider that provides us with a default filestorage extension.
    • We might also consider including some commonly used extensions, such as healtcheck, pprof, memorylimitter, etc.
  • Inject this new configuration.
  • Enable stateful receivers to automatically utilize the storage extension when the feature flag is turned on.

This is a high-level overview, and I expect it will require multiple pull requests to implement.

Describe alternatives you've considered

Please share if you have any thoughts!

Additional context

My solution would require open-telemetry/opentelemetry-collector#11046 to be merged or a similar workaround to be implemented to combine lists in config.

@VihasMakwana VihasMakwana added enhancement New feature or request needs triage New item requiring triage labels Sep 4, 2024
@VihasMakwana
Copy link
Contributor Author

^^ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-contrib-maintainers

@VihasMakwana
Copy link
Contributor Author

Closing this in favour of #35013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

1 participant