Skip to content

Commit

Permalink
remove message extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
dasfmi committed Jul 1, 2024
1 parent 7fb3eed commit e9c7e64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 106 deletions.
11 changes: 3 additions & 8 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ func httpHandler(ax *flusher.Axiom, runtimeDone chan struct{}) http.HandlerFunc
e["_time"], e["time"] = e["time"], nil

if e["type"] == "function" {
extractEventMessage(e)
// extract the message from the record field and puts it in the message field
e["message"] = e["record"]
delete(e, "record")
}

// decide if the handler should notify the extension that the runtime is done
Expand All @@ -111,10 +113,3 @@ func httpHandler(ax *flusher.Axiom, runtimeDone chan struct{}) http.HandlerFunc
}
}
}

// extractEventMessage extracts the message from the record field and puts it in the message field
// it detects if the record is a json string or a text log line that confirms to AWS log line formatting.
func extractEventMessage(e map[string]any) {
e["message"] = e["record"]
delete(e, "record")
}
98 changes: 0 additions & 98 deletions server/server_test.go

This file was deleted.

0 comments on commit e9c7e64

Please sign in to comment.