Repository navigation
feat(dbi): Add severity parsing and fix multiline/timestamp for PostgreSQL server logs - #2209
Merged
Merged
Conversation
Contributor
Binary Size Reportlinux/amd64
Notable changes:
linux/arm64
windows/amd64
Investigating size changesUse go-size-analyzer to compare binaries: GOEXPERIMENT=jsonv2 go install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest
gsa diff --old <baseline-binary> --new <new-binary> |
Contributor
There was a problem hiding this comment.
Should this account for severity as well ?
| "severity": map[string]any{ | ||
| "parse_from": "attributes.severity", | ||
| "mapping": map[string]any{ | ||
| "debug": []string{"DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4", "DEBUG5"}, |
Contributor
There was a problem hiding this comment.
Are these levels specific to PostGreSQL ? Should we maintain a map in case support for more DBs are added in the future ?
Contributor
Author
There was a problem hiding this comment.
Moved to a map within the receiver itself
| return map[string]any{ | ||
| "type": "regex_parser", | ||
| "regex": severity, | ||
| "severity": map[string]any{ |
Contributor
There was a problem hiding this comment.
nit - maybe add a regex builder similar to the timestamp one ?
jefchien
reviewed
Jul 20, 2026
JayPolanco
force-pushed
the
dbi-server-log-fix
branch
from
July 20, 2026 18:59
9f2cea5 to
8924a36
Compare
jefchien
approved these changes
Jul 20, 2026
okankoAMZ
approved these changes
Jul 20, 2026
mitali-salvi
approved these changes
Jul 20, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the issue
DBI (Database Insights) server-logs filelog receiver had three issues:
timeUnixNanowas 0)Additionally, there was a gosnowflake/dbus dependency leak from contrib.
Description of changes
WithSeverityPatternoption to filelog translator84054ba42340to fix gosnowflake/dbus leakLicense
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
TestTranslator_WithTimestampAndSeverityfor filelog translatorTestDbiTranslateServerLogs_FilelogConfigfor DBI translatorseverityNumber,severityText, andattributes.severityLeak fixed
Created a bash script that does:
Also manually ran:
CloudWatch Log Output
ERROR log:
{ "timeUnixNano": 1784329491691000000, "severityNumber": 17, "severityText": "ERROR", "body": "2026-07-17 23:04:51.691 UTC testdb postgres [21991]ERROR: relation \"nonexistent_table_12345\" does not exist at character 15", "attributes": { "timestamp": "2026-07-17 23:04:51.691 UTC", "severity": "ERROR" } }LOG (regular) log:
{ "timeUnixNano": 1784329520159000000, "severityNumber": 9, "severityText": "LOG", "body": "2026-07-17 23:05:20.159 UTC testdb postgres [22079]LOG: duration: 200.869 ms statement: SELECT pg_sleep(0.2);", "attributes": { "timestamp": "2026-07-17 23:05:20.159 UTC", "severity": "LOG" } }Requirements
make fmtandmake fmt-shmake lint