Skip to content

Commit 7fee183

Browse files
authored
Merge pull request #8 from FireTail-io/execution-time
Get execution_time from log payloads & include in Firetail log entry
2 parents b6e8e28 + 578f61a commit 7fee183

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

firetail/record.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ func (r *Record) Marshal() ([]byte, error) {
1919

2020
// Record represents a record that will be generated by a lambda function and passed to the extension via the Lambda logs API
2121
type Record struct {
22-
Event json.RawMessage `json:"event"`
23-
Response RecordResponse `json:"response"`
22+
Event json.RawMessage `json:"event"`
23+
Response RecordResponse `json:"response"`
24+
ExecutionTime float64 `json:"execution_time"`
2425
}
2526

2627
// RecordResponse represents the response contained within a Firetail log Record

firetail/send_records_to_saas.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func SendRecordsToSaaS(records []Record, apiUrl, apiKey string) (int, error) {
2828

2929
logEntryBytes, err := json.Marshal(LogEntry{
3030
DateCreated: time.Now().UnixMilli(),
31-
ExecutionTime: 0,
31+
ExecutionTime: record.ExecutionTime,
3232
Request: *logEntryRequest,
3333
Response: LogEntryResponse{
3434
Body: record.Response.Body,

0 commit comments

Comments
 (0)