-
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
[chore][testbed] add filelog as a part of test cases #36603
base: main
Are you sure you want to change the base?
Conversation
d443052
to
d2b22c2
Compare
@ChrsMark can you please take at this PR? I've used options. |
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.
Overall LGTM.
@@ -658,9 +663,8 @@ func getLogsID(logToRetry []plog.Logs) []string { | |||
logRecord := logElement.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords() | |||
for index := 0; index < logRecord.Len(); index++ { | |||
logObj := logRecord.At(index) | |||
itemIndex, _ := logObj.Attributes().Get("item_index") |
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.
Out of curiosity, is this change required for the test that this PR adds? From what I can see it should be fine to include it but just want to understand why.
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.
Yeah. It's required.
filelogwriter
accepts logs in plog.Log
and writes them in file. Here
opentelemetry-collector-contrib/testbed/datasenders/stanza.go
Lines 68 to 72 in 9cb09d5
for k := 0; k < ills.LogRecords().Len(); k++ { | |
_, err := f.file.Write(append(f.convertLogToTextLine(ills.LogRecords().At(k)), '\n')) | |
if err != nil { | |
return err | |
} |
This is kind of a special case where the log attributes are a part of log body itself. That why I use regex.
For other senders (such as otlp
), we start the corresponding exporter for a sender. In such scenarios, the attributes are preserved.
Let me know if you have any questions.
Co-authored-by: Christos Markou <[email protected]>
Recently, we added memory limiter test cases for OTLP.
This PR updates the cases to work with filelog sender as well.