-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat(operator)!: Add configuration option for dropping OTLP attributes #15857
Conversation
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.
Still have to test but overall lgtm. Good job 🙌
Small nit comment regarding the use of errList = append(errList, ...)
. Sometimes we use this with just an error where other times with a function call. Although this makes the code more compact I feel that sometimes it makes it a bit harder to follow. Maybe moving instances with function calls to an if and only appending to errList if the result yields a list of errors. This is just a suggestion feel free to ignore if you feel it will not improve the code maintenance.
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.
Just two minor comments, overall lgtm and it's refactors look great!
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.
DisableRecommendedAttributes
docs have to be updated... and I wonder if it's useful at all 🤔 mainly because we now we know that attributes are attached to structured metadata by default. On the other hand, IIRC stream labels are in added to the index, since some of the labels we have in the recommendedAttributes
have high cardinality maybe it makes sense for this toggle to exist. WDYT?
@@ -837,12 +837,12 @@ type OTLPSpec struct { | |||
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Stream Labels" | |||
StreamLabels *OTLPStreamLabelSpec `json:"streamLabels,omitempty"` | |||
|
|||
// StructuredMetadata configures which attributes are saved in structured metadata. | |||
// Drop configures which attributes are dropped from the log entry. |
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.
Should we mention here the detail on how the attributes should be in their OTEL formatted name and not Loki?
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.
I wondered about how to do that. Let me try adding some text to the OTLPSpec
, because this is the same for both StreamLabels
and Drop
.
@JoaoBraveCoding Updated the wording for both |
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.
lgtm
What this PR does / why we need it:
The Loki Operator already supports configuring whether to store OTLP attributes as stream labels or structured metadata, but the option to drop attributes was omitted from the LokiStack API, because of a misunderstanding that "drop" is the default behavior (the actual default behavior is "structured metadata".
This PR adds the
drop
capability to the LokiStack API as well.Which issue(s) this PR fixes:
Fixes LOG-6507.
Special notes for your reviewer:
StructuredMetadata
attribute of the LokiStack (instead of just deprecating it). I think it's still a source of confusion for the user and removing it would also reduce the code needed in the operator quite a bit (mostly validation). This would be a breaking change though.Checklist
CONTRIBUTING.md
guide (required)