From 8d7c92c6615ca959e8caf25d71d55a0b420ffc8b Mon Sep 17 00:00:00 2001 From: Pascal Fischer <32096965+pascal-fischer@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:31:23 +0100 Subject: [PATCH] [management] add receive timestamp to traffic event (#3559) --- management/server/http/api/openapi.yml | 8 +++++++- management/server/http/api/types.gen.go | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/management/server/http/api/openapi.yml b/management/server/http/api/openapi.yml index 9c9eef329..f24317a87 100644 --- a/management/server/http/api/openapi.yml +++ b/management/server/http/api/openapi.yml @@ -1899,7 +1899,12 @@ components: timestamp: type: string format: date-time - description: "Timestamp of the event." + description: "Timestamp of the event. Send by the peer." + example: "2025-03-20T16:23:58.125397Z" + receive_timestamp: + type: string + format: date-time + description: "Timestamp when the event was received by our API." example: "2025-03-20T16:23:58.125397Z" source: $ref: '#/components/schemas/NetworkTrafficEndpoint' @@ -1969,6 +1974,7 @@ components: - flow_id - reporter_id - timestamp + - receive_timestamp - source - user_id - user_email diff --git a/management/server/http/api/types.gen.go b/management/server/http/api/types.gen.go index 8838efe31..751311333 100644 --- a/management/server/http/api/types.gen.go +++ b/management/server/http/api/types.gen.go @@ -873,6 +873,9 @@ type NetworkTrafficEvent struct { // Protocol Protocol is the protocol of the traffic (e.g. 1 = ICMP, 6 = TCP, 17 = UDP, etc.). Protocol int `json:"protocol"` + // ReceiveTimestamp Timestamp when the event was received by our API. + ReceiveTimestamp time.Time `json:"receive_timestamp"` + // ReporterId ID of the reporter of the event (e.g., the peer that reported the event). ReporterId string `json:"reporter_id"` @@ -883,7 +886,7 @@ type NetworkTrafficEvent struct { RxPackets int `json:"rx_packets"` Source NetworkTrafficEndpoint `json:"source"` - // Timestamp Timestamp of the event. + // Timestamp Timestamp of the event. Send by the peer. Timestamp time.Time `json:"timestamp"` // TxBytes Number of bytes transmitted.