-
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/file] add append mode #31369
[exporter/file] add append mode #31369
Conversation
|
bf85197
to
05e0920
Compare
05e0920
to
6cd7b8f
Compare
6cd7b8f
to
4a50bab
Compare
Does the append mode work together with compression? If no, this should be mentioned in the documentation. If yes (can it?), we should have unit tests for this. |
Perhaps just document in the README that the |
1e9ecb8
to
f7b2256
Compare
f7b2256
to
36204dd
Compare
@@ -673,3 +674,86 @@ func TestFlushing(t *testing.T) { | |||
assert.EqualValues(t, b, bbuf.Bytes()) | |||
assert.NoError(t, fe.Shutdown(ctx)) | |||
} | |||
|
|||
func TestAppend(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is a bit too low level to my taste, using fileWriter
directly. I think it's because it was based on the TestFlushing
test. Perhaps better to write this test more like the TestFileTracesExporter
and similar tests are written:
- create
newFileExporter()
- generate traces
- write telemetry with
consumeTraces
- check that traces written (check number of lines with JSON or sth)
- create a new instance of
newFileExporter
consumeTraces
- check the cumulative number of lines in file, or that the size of file has increased from point 4.
Signed-off-by: Szilard Parrag <[email protected]>
4d6582c
to
a7b43a5
Compare
So I changed |
**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]>
Description:
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 usingtelemetrygen
and the following configuration:Documentation:
TODO: