open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.9k stars 2.27k forks source link

[extension/filestorage] - Provide an option to the user to create a directory for them #34939

Closed VihasMakwana closed 2 days ago

VihasMakwana commented 2 weeks ago

Component(s)

extension/storage/filestorage

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

When using the filelog receiver with persistence enabled, I need to ensure that the directory exists before starting the collector; otherwise, it will throw an error. It would be a great help if collector could automate this part for me.

Describe the solution you'd like

It would be convenient if the file_storage option had a setting that, when enabled, would automatically create the directory for you. We can name the option auto_create_directory or create_directory and set it to false by default (existing behaviour), but if the user wants the collector to handle the directory creation, they can just turn this option on.

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 2 weeks ago

Pinging code owners:

andrzej-stencel commented 1 week ago

I think this would be a useful feature.

What would be the permissions on the created directory? Would 0750 (rwxr-x---) be a good default? Do we need to let the user customize the permissions?

VihasMakwana commented 1 week ago

@andrzej-stencel I think 0750 is a good default.

Do we need to let the user customize the permissions?

I think it would be sufficient to document that the default directory creation mode is 0750.

andrzej-stencel commented 1 week ago

Do we need to let the user customize the permissions?

I think it would be sufficient to document that the default directory creation mode is 0750.

Ok let's start with that. 👍

VihasMakwana commented 1 week ago

@andrzej-stencel can you assign this to me (or should we wait for @djaglowski to be back from vacation)?

Frapschen commented 1 week ago

@VihasMakwana assigned

VihasMakwana commented 2 days ago

Addressed via https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34985. Closing.