-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feature-gate to delete original time field from parsed container …
…logs (#33946) **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 PR adds support for removing the original `time` attribute/field from the parsed log record as it was suggested at #33389. Users should use the `Timestamp` field which holds the parsed time. This patch introduces this change behind a feature flag called `filelog.container.removeOriginalTimeField` which is disabled by default following the [feature lifecycle](https://github.com/open-telemetry/opentelemetry-collector/tree/main/featuregate#feature-lifecycle). **Link to tracking Issue:** <Issue number if applicable> #33389 **Testing:** <Describe what testing was performed and which tests were added.> 1. Added unit-test 2. Run with `./bin/otelcontribcol_linux_amd64 --config container_config.yaml --feature-gates=filelog.container.removeOriginalTimeField ` and verify the output: ```console 2024-07-08T14:26:50.936+0300 info LogsExporter {"kind": "exporter", "data_type": "logs", "name": "debug", "resource logs": 1, "log records": 2} 2024-07-08T14:26:50.936+0300 info ResourceLog #0 Resource SchemaURL: Resource attributes: -> k8s.namespace.name: Str(some) -> k8s.pod.name: Str(kube-controller-kind-control-plane) -> k8s.container.restart_count: Str(1) -> k8s.pod.uid: Str(49cc7c1fd3702c40b2686ea7486091d6) -> k8s.container.name: Str(kube-controller) ScopeLogs #0 ScopeLogs SchemaURL: InstrumentationScope LogRecord #0 ObservedTimestamp: 2024-07-08 11:26:50.836517638 +0000 UTC Timestamp: 2029-03-30 08:31:20.545192187 +0000 UTC SeverityText: SeverityNumber: Unspecified(0) Body: Str(INFO: log line here) Attributes: -> logtag: Str(F) -> log.file.path: Str(/var/log/pods/some_kube-controller-kind-control-plane_49cc7c1fd3702c40b2686ea7486091d6/kube-controller/1.log) -> log.iostream: Str(stdout) Trace ID: Span ID: Flags: 0 ``` **Documentation:** <Describe the documentation added.> Added. --------- Signed-off-by: ChrsMark <[email protected]> Co-authored-by: Andrzej Stencel <[email protected]>
- Loading branch information
1 parent
ed8e8bf
commit 15c72d2
Showing
5 changed files
with
160 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: 'enhancement' | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: receiver/filelog | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Add filelog.container.removeOriginalTimeField feature-flag for removing original time field | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [33946] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [user] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters