Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/eden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ concurrency:
jobs:
test_suite_pr:
if: github.event.review.state == 'approved'
uses: lf-edge/eden/.github/workflows/test.yml@0.9.2
uses: lf-edge/eden/.github/workflows/test.yml@0.9.2-stable
with:
eden_version: "0.9.2-stable"
eve_image: "evebuild/danger:pr${{ github.event.pull_request.number }}"

test_suite_master:
if: github.ref == 'refs/heads/master'
uses: lf-edge/eden/.github/workflows/test.yml@0.9.2
uses: lf-edge/eden/.github/workflows/test.yml@0.9.2-stable
with:
eden_version: "0.9.2-stable"
eve_image: "lfedge/eve:snapshot"

test_suite_tag:
if: startsWith(github.ref, 'refs/tags')
uses: lf-edge/eden/.github/workflows/test.yml@0.9.2
uses: lf-edge/eden/.github/workflows/test.yml@0.9.2-stable
with:
eden_version: "0.9.2-stable"
eve_image: "lfedge/eve:${{ github.ref_name }}"
35 changes: 20 additions & 15 deletions pkg/newlog/cmd/newlogd.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,34 +568,36 @@ func getMemlogMsg(logChan chan inputEntry, panicFileChan chan []byte) {
continue
}
var pidStr string
var logInfo agentlog.Loginfo
// Everything is json, in some cases with an embedded json Msg
logEntry, jsonOK := ParseMemlogLogEntry(string(bytes))
if !jsonOK {
log.Warnf("Received non-json from memlogd: %s\n",
string(bytes))
continue
}
// Start with the envelope
logInfo.Source = logEntry.Source
logInfo.Time = logEntry.Time
logInfo.Msg = logEntry.Msg

// Is the Msg itself json?
logInfo2, ok := agentlog.ParseLoginfo(logInfo.Msg)
if ok {
// If the inner has Time or Source set they take
// precedence over the envelope
if logInfo2.Time == "" {
logInfo2.Time = logInfo.Time
logInfo, ok := agentlog.ParseLoginfo(logEntry.Msg)
if ok { // Use the inner JSON struct
// Go back to the envelope for anything not in the inner JSON
if logInfo.Time == "" {
logInfo.Time = logEntry.Time
}
if logInfo2.Source == "" {
logInfo2.Source = logInfo.Source
if logInfo.Source == "" {
logInfo.Source = logEntry.Source
}
logInfo = logInfo2
// and keep the original message text and fields
logInfo.Msg = logEntry.Msg
} else {
// Start with the envelope
logInfo.Source = logEntry.Source
logInfo.Time = logEntry.Time
logInfo.Msg = logEntry.Msg

// Some messages have attr=val syntax
level, timeStr, msg := parseLevelTimeMsg(logInfo.Msg)
// If the inner message has Level, Time or Msg set they take
// precedence over the envelope
level, timeStr, msg := parseLevelTimeMsg(logEntry.Msg)
if level != "" {
logInfo.Level = level
}
Expand All @@ -606,16 +608,19 @@ func getMemlogMsg(logChan chan inputEntry, panicFileChan chan []byte) {
logInfo.Msg = msg
}
}

if strings.Contains(logInfo.Source, "guest_vm") {
logmetrics.AppMetrics.NumInputEvent++
} else if logInfo.Containername != "" {
logmetrics.AppMetrics.NumInputEvent++
} else {
logmetrics.DevMetrics.NumInputEvent++
}

if logInfo.Pid != 0 {
pidStr = strconv.Itoa(logInfo.Pid)
}

entry := inputEntry{
source: logInfo.Source,
content: logInfo.Msg,
Expand Down