Skip to content

Commit 0ca867d

Browse files
committed
Add metadata.source to logs and populate it with the value "lambda-extension"
1 parent a6f269d commit 0ca867d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

firetail/log_entry.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type LogEntry struct {
2525
Request LogEntryRequest `json:"request"`
2626
Response LogEntryResponse `json:"response"`
2727
Version LogEntryVersion `json:"version"` // The version of the firetail logging schema used
28+
Metadata LogEntryMetadata `json:"metadata"`
2829
}
2930

3031
type LogEntryRequest struct {
@@ -103,6 +104,10 @@ const (
103104
// The version of the firetail logging schema used
104105
type LogEntryVersion string
105106

107+
type LogEntryMetadata struct {
108+
Source string `json:"source"`
109+
}
110+
106111
const (
107112
The100Alpha LogEntryVersion = "1.0.0-alpha"
108113
)

firetail/send_records_to_saas.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func SendRecordsToSaaS(records []Record, apiUrl, apiKey string) (int, error) {
4040
StatusCode: record.Response.StatusCode,
4141
},
4242
Version: The100Alpha,
43+
Metadata: LogEntryMetadata{
44+
Source: "lambda-extension",
45+
},
4346
})
4447
if err != nil {
4548
errs = multierror.Append(errs, fmt.Errorf("Err marshalling record to bytes, err: %s", err.Error()))

0 commit comments

Comments
 (0)