Skip to content
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

[pkg/stanza][operators] Retain Operator should proagate unreleated fields of the original log entry #35832

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

SamerJ
Copy link
Contributor

@SamerJ SamerJ commented Oct 16, 2024

Description

The retain operator should propagate the severity field like it does with timestamps.
This fix will ensure that is the case.

Testing

Added UT to cover the use case.

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this @SamerJ. I agree we should not drop unrelated parts of the data model.

A followup question this raises for me - Any reason we shouldn't also retain the trace fields (trace ID, span ID, trace flags)? If not, could we broaden this fix to include those?

@SamerJ
Copy link
Contributor Author

SamerJ commented Oct 16, 2024

@djaglowski
I fully agree.
The retain operator is written in a way it only provides control over Attributes, ResourceAttributes & the Body.
The way I see it, all other fields should be kept as is.
So, the following fields will be propagated: Timestamp, ObservedTimestamp, Severity, SeverityText, TraceID, SpanID, TraceFlags, ScopeName.

@SamerJ SamerJ force-pushed the SamerJ-patch-2 branch 2 times, most recently from c7ba0fb to 4a776ca Compare October 17, 2024 11:32
@SamerJ SamerJ changed the title [pkg/stanza][operators] Retain Operator should proagate severity of original log entry [pkg/stanza][operators] Retain Operator should proagate unreleated fields of the original log entry Oct 17, 2024
@djaglowski djaglowski merged commit 7cca491 into open-telemetry:main Oct 24, 2024
158 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 24, 2024
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this pull request Dec 17, 2024
…elds of the original log entry (open-telemetry#35832)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The retain operator should propagate the severity field like it does
with timestamps.
This fix will ensure that is the case.

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added UT to cover the use case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants