You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fileconsumer] Add compression:auto to support ingesting mixed file types (open-telemetry#38510)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This PR supports the use case of reading from mixed file types. To
support reading from both compressed and uncompressed file - configure
```
compression: auto
```
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixesopen-telemetry#37772
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Start otelcollector-contrib with following config file
```
receivers:
filelog:
include: [ "./test.log*" ] # Path to log file
start_at: beginning # Read from the start of the file
include_file_path: true
include_file_name: true
compression: auto
exporters:
debug/1:
verbosity: detailed
service:
telemetry:
logs:
level: debug
pipelines:
logs:
receivers: [filelog]
exporters: [debug/1]
```
Have `test.log` and `test.log.gz` in your path. We have two readers -
one for plain text and other for gzipped file.
---------
Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Co-authored-by: Daniel Jaglowski <[email protected]>
# Use this changelog template to create an entry for release notes.
2
+
3
+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4
+
change_type: enhancement
5
+
6
+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7
+
component: fileconsumer
8
+
9
+
10
+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
11
+
note: Support "`compression:auto`" which automatically detects file compression type and ingests data. Currently, only gzip compressed files are auto detected. This allows for mix of compressed and uncompressed files to be ingested with the same filelogreceiver.
12
+
13
+
14
+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
15
+
issues: [37772]
16
+
17
+
# (Optional) One or more lines of additional information to render under the primary note.
18
+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19
+
# Use pipe (|) for multiline entries.
20
+
subtext:
21
+
22
+
# If your change doesn't affect end users or the exported elements of any package,
23
+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
24
+
# Optional: The change log or logs in which this entry should be included.
25
+
# e.g. '[user]' or '[user, api]'
26
+
# Include 'user' if the change is relevant to end users.
27
+
# Include 'api' if there is a change to a library API.
Copy file name to clipboardExpand all lines: receiver/filelogreceiver/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ Tails and parses logs from files.
63
63
|`ordering_criteria.sort_by.location`|| Relevant if `sort_type` is set to `timestamp`. Defines the location of the timestamp of the file. |
64
64
|`ordering_criteria.sort_by.format`|| Relevant if `sort_type` is set to `timestamp`. Defines the strptime format of the timestamp being sorted. |
65
65
|`ordering_criteria.sort_by.ascending`|| Sort direction |
66
-
|`compression`|| Indicate the compression format of input files. If set accordingly, files will be read using a reader that uncompresses the file before scanning its content. Options are `` or `gzip`|
66
+
|`compression`|| Indicate the compression format of input files. If set accordingly, files will be read using a reader that uncompresses the file before scanning its content. Options are ``, `gzip`, or `auto`. `auto` auto-detects file compression type. Currently, gzip files are the only compressed files auto-detected, based on ".gz" filename extension. `auto` option is useful when ingesting a mix of compressed and uncompressed files with the same filelogreceiver.|
67
67
68
68
Note that _by default_, no logs will be read from a file that is not actively being written to because `start_at` defaults to `end`.
0 commit comments