-
Notifications
You must be signed in to change notification settings - Fork 159
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
fix: use proper key formating as per stanza persister #3879
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ func (m *Migrator) MigrateContainerPos(lines []string) { | |
defer client.Close() | ||
_, buf := m.ConvertFilePos(lines) | ||
|
||
err = client.Set("$.file_input.knownFiles", buf.Bytes()) | ||
err = client.Set("file_input.knownFiles", buf.Bytes()) | ||
if err != nil { | ||
log.Printf("error storing container checkpoints: %v", err) | ||
} | ||
|
@@ -110,7 +110,7 @@ func (m *Migrator) MigrateCustomPos(matches []string) { | |
if err != nil { | ||
log.Printf("error creating a new DB client for host file checkpoints: %v", err) | ||
} | ||
err = client.Set("$.file_input.knownFiles", buf.Bytes()) | ||
err = client.Set("file_input.knownFiles", buf.Bytes()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we always had this issue? Is there a breaking change in stanza that occurred? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, not sure tbh. Need to dig in through commit history. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am pretty sure we have functional tests on the chart that test this. If not, we must create some or we will have more surprises. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have any tests for migration from SCK. I'll create a PR in the chart repo covering this part. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @atoulme here's a PR to add functional test cases covering this. signalfx/splunk-otel-collector-chart#1024 |
||
if err != nil { | ||
log.Printf("error storing host file checkpoints: %v", err) | ||
} | ||
|
@@ -141,7 +141,7 @@ func (m *Migrator) MigrateJournaldPos(matches []string) { | |
if err != nil { | ||
log.Printf("error creating a new DB client for journald checkpoints: %v", err) | ||
} | ||
err = client.Set("$.journald_input.lastReadCursor", []byte(cursor.Cursor)) | ||
err = client.Set("journald_input.lastReadCursor", []byte(cursor.Cursor)) | ||
if err != nil { | ||
log.Printf("error storing journald checkpoints: %v", err) | ||
} | ||
|
@@ -218,8 +218,9 @@ func convertToOtel(path string, hexPos string) (*Reader, error) { | |
} | ||
|
||
reader := &Reader{ | ||
Fingerprint: fp, | ||
Offset: offset, | ||
Fingerprint: fp, | ||
Offset: offset, | ||
FileAttributes: map[string]any{}, | ||
} | ||
return reader, nil | ||
} |
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.
what FileAttributes doing?
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.
We're trying to convert fluentd's format to the following struct as per OTeL's format. We get
Offset
andFingerprint
by reading the fluentd's pos_file. But the fieldFileAttributes
is left nil.This causes a panic when the filelogreceiver tries to access this field while decoding it (causes nil reference). Setting it to an empty map resolves this.
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.
Makes sense, thanks!