-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/fileexporter] Enable appending as an option instead of always truncating #31364
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Thank you for your issue~ @OverOrion |
Hey @atingchen,
Yes, that is the problem I've described.
I do not see how that could be simpler (received messages scattered across multiple files or just having one file), could you please elaborate? |
This is indeed an issue that we should pay attention to and resolve. I have reviewed the code you submitted, and your solution is much simpler. @OverOrion. |
Thank you for your quick response @atingchen! Could you please allow the CI to run on the PR? (Not sure if you have the permission, just being hopeful that you do). |
Thank you very much for your work @OverOrion~ I have provided you with some suggestions, and you are more than welcome to create a PR. |
Hey @atingchen, |
Hi @OverOrion, |
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This adds a new option for configuring the append / truncate behavior of the fileexporter. **Link to tracking Issue:** #31364 **Testing:** Added `TestAppend` unit test and manually tested using `telemetrygen` and the following configuration: ```yaml receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 exporters: file: path: ./receiver_output_append.log append: true service: telemetry: metrics: level: detailed address: 0.0.0.0:9998 pipelines: logs: receivers: [otlp] exporters: [file] ``` **Documentation:** <Describe the documentation added.> TODO: - [x] add documentation once we reached agreement regarding implementation / naming Signed-off-by: Szilard Parrag <[email protected]>
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This adds a new option for configuring the append / truncate behavior of the fileexporter. **Link to tracking Issue:** open-telemetry#31364 **Testing:** Added `TestAppend` unit test and manually tested using `telemetrygen` and the following configuration: ```yaml receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 exporters: file: path: ./receiver_output_append.log append: true service: telemetry: metrics: level: detailed address: 0.0.0.0:9998 pipelines: logs: receivers: [otlp] exporters: [file] ``` **Documentation:** <Describe the documentation added.> TODO: - [x] add documentation once we reached agreement regarding implementation / naming Signed-off-by: Szilard Parrag <[email protected]>
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This adds a new option for configuring the append / truncate behavior of the fileexporter. **Link to tracking Issue:** open-telemetry#31364 **Testing:** Added `TestAppend` unit test and manually tested using `telemetrygen` and the following configuration: ```yaml receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 exporters: file: path: ./receiver_output_append.log append: true service: telemetry: metrics: level: detailed address: 0.0.0.0:9998 pipelines: logs: receivers: [otlp] exporters: [file] ``` **Documentation:** <Describe the documentation added.> TODO: - [x] add documentation once we reached agreement regarding implementation / naming Signed-off-by: Szilard Parrag <[email protected]>
Can this issue be closed now that #31369 is merged? |
Component(s)
exporter/file
Is your feature request related to a problem? Please describe.
It might be desirable to let the user configure the fileexporter's file opening mode so in the event of a restart it would continue writing to the same file without losing the previous progress.
Describe the solution you'd like
I think a simple
write_mode: append / truncate
orappend: true
configuration field would be the way to go.Describe alternatives you've considered
Using an external script to make a backup of the currently written file and only after that should the collector be restarted.
Additional context
If you agree with this proposal I would be happy to work on it once we agreed on how this option should be implemented 🚀.
The text was updated successfully, but these errors were encountered: