@@ -31,6 +31,23 @@ struct aws_s3_request_metrics {
3131 struct aws_allocator * allocator ;
3232
3333 struct {
34+ /* The time stamp when the request was first initiated by the client, including the very first attempt.
35+ * This timestamp is set once at the beginning and never updated during retries. Timestamps are from
36+ * `aws_high_res_clock_get_ticks`. This will always be available. */
37+ int64_t s3_request_first_attempt_start_timestamp_ns ;
38+
39+ /* The time stamp when the request completely finished (success or final failure), including all retry
40+ * attempts. This is set when the request reaches its final state - either successful completion or
41+ * exhaustion of all retry attempts. Timestamps are from `aws_high_res_clock_get_ticks`. This will
42+ * be available with the last attempt. */
43+ int64_t s3_request_last_attempt_end_timestamp_ns ;
44+
45+ /* The total time duration for the complete request lifecycle from initial start to final completion,
46+ * including all retry attempts, backoff delays, and connection establishment time
47+ * (s3_request_last_attempt_end_timestamp_ns - s3_request_first_attempt_start_timestamp_ns). This represents the
48+ * end-to-end user experience time. This will be available with the last attempt. */
49+ int64_t s3_request_total_duration_ns ;
50+
3451 /* The time stamp when the request started by S3 client, which is prepared time by the client. Timestamps
3552 * are from `aws_high_res_clock_get_ticks`. This will always be available. */
3653 int64_t start_timestamp_ns ;
@@ -90,6 +107,31 @@ struct aws_s3_request_metrics {
90107 /* The time duration for the request from start of delivery to finish of delivery (deliver_end_timestamp_ns -
91108 * deliver_start_timestamp_ns). When deliver_duration_ns is 0, means data not available. */
92109 int64_t deliver_duration_ns ;
110+
111+ /* The time stamp when the request started to acquire connection. -1 means data not available. Timestamp
112+ * are from `aws_high_res_clock_get_ticks` */
113+ int64_t conn_acquire_start_timestamp_ns ;
114+ /* The time stamp when the request finished to acquire connection. -1 means data not available.
115+ * Timestamp are from `aws_high_res_clock_get_ticks` */
116+ int64_t conn_acquire_end_timestamp_ns ;
117+ /* The time duration for the request from start acquiring connection to finish acquiring connection
118+ * (conn_acquire_end_timestamp_ns - conn_acquire_start_timestamp_ns). When conn_acquire_end_timestamp_ns is -1,
119+ * means data not available. */
120+ int64_t conn_acquire_duration_ns ;
121+
122+ /* The time stamp when the request started to delay for retry. -1 means data not available. Timestamp
123+ * are from `aws_high_res_clock_get_ticks` */
124+ int64_t retry_delay_start_timestamp_ns ;
125+ /* The time stamp when the request finished to delay for retry. -1 means data not available.
126+ * Timestamp are from `aws_high_res_clock_get_ticks` */
127+ int64_t retry_delay_end_timestamp_ns ;
128+ /* The time duration for the request from start retry delay to finish retry delay (retry_delay_end_timestamp_ns
129+ * - retry_delay_start_timestamp_ns). When retry_delay_end_timestamp_ns is -1, means data not available. */
130+ int64_t retry_delay_duration_ns ;
131+
132+ /* The time duration for the service call from connection acquisition to first response byte. -1 means data not
133+ * available. */
134+ int64_t service_call_duration_ns ;
93135 } time_metrics ;
94136
95137 struct {
@@ -103,6 +145,8 @@ struct aws_s3_request_metrics {
103145 struct aws_string * host_address ;
104146 /* The the request ID header value. */
105147 struct aws_string * request_id ;
148+ /* The the extended request ID header value. */
149+ struct aws_string * extended_request_id ;
106150 /* S3 operation name for the request */
107151 struct aws_string * operation_name ;
108152 /* The type of request made */
@@ -113,7 +157,9 @@ struct aws_s3_request_metrics {
113157 /* The IP address of the request connected to */
114158 struct aws_string * ip_address ;
115159 /* The pointer to the connection that request was made from */
116- void * connection_id ;
160+ void * connection_ptr ;
161+ /* The pointer to the request that the request attempt was made from */
162+ void * request_ptr ;
117163 /* The aws_thread_id_t to the thread that request ran on */
118164 aws_thread_id_t thread_id ;
119165 /* The stream-id, which is the idex when the stream was activated. */
@@ -144,6 +190,13 @@ struct aws_s3_request {
144190 /* Linked list node used for queuing. */
145191 struct aws_linked_list_node node ;
146192
193+ /* Timestamp when retry attempt started. Overwritten on each retry and copied to new attempt's setup data.
194+ * -1 means data not available. Timestamp from `aws_high_res_clock_get_ticks` */
195+ int64_t retry_start_timestamp_ns ;
196+ /* Timestamp when retry attempt ended. Overwritten on each retry and copied to new attempt's setup data.
197+ * -1 means data not available. Timestamp from `aws_high_res_clock_get_ticks` */
198+ int64_t retry_end_timestamp_ns ;
199+
147200 /* Linked list node used for tracking the request is active from HTTP level. */
148201 struct aws_linked_list_node cancellable_http_streams_list_node ;
149202
@@ -261,7 +314,7 @@ struct aws_s3_request {
261314
262315 /* Returned request ID of this request. */
263316 struct aws_string * request_id ;
264- /* Returned amz ID 2 of this request. */
317+ /* Returned extended request id of this request. */
265318 struct aws_string * amz_id_2 ;
266319
267320 /* The metrics for the request telemetry */
0 commit comments