Description
Defines application-neutral HTTP metrics and a bounded in-memory sink.
Begin_Request
procedure Begin_Request (Item : in out In_Memory)
Increment active requests in the in-memory sink.
Parameters
- Item
In-memory sink
Begin_Request
procedure Begin_Request (Item : in out Sink)
Increment active requests.
Parameters
- Item
Metric sink
Count
procedure Count
(Item : in out In_Memory;
Kind : Event_Kind)
Increment one bounded in-memory event counter.
Parameters
- Item
In-memory sink
- Kind
Event kind
Count
procedure Count (Item : in out Sink; Kind : Event_Kind)
Increment one bounded failure or lifecycle event.
Parameters
- Item
Metric sink
- Kind
Event kind
End_Request
procedure End_Request
(Item : in out In_Memory;
Method : String;
Route : String;
Status : Natural;
Elapsed : Duration;
Request_Bytes : Natural;
Response_Bytes : Natural)
Complete one in-memory request observation.
Parameters
- Item
In-memory sink
- Method
Request method
- Route
Stable route name
- Status
Final status or zero
- Elapsed
Monotonic elapsed seconds
- Request_Bytes
Decoded request body bytes
- Response_Bytes
Response payload bytes
End_Request
procedure End_Request
(Item : in out Sink;
Method : String;
Route : String;
Status : Natural;
Elapsed : Duration;
Request_Bytes : Natural;
Response_Bytes : Natural)
Complete one request observation.
Parameters
- Item
Metric sink
- Method
Request method
- Route
Stable route name, never an arbitrary raw path
- Status
Final status or zero
- Elapsed
Monotonic elapsed seconds
- Request_Bytes
Decoded request body bytes
- Response_Bytes
Response payload bytes
Event_Counters
type Event_Counters is array (Event_Kind) of Natural;
Counter array indexed by bounded event kind.
Event_Kind
type Event_Kind is
(Timeout,
Cancellation,
Protocol,
Ingress_Denial,
Rate_Limit_Denial,
Bulkhead_Denial,
SSE_Connection,
WebSocket_Connection,
WebSocket_Message);
Bounded failure dimensions.
Enumeration literals
- Timeout
Request deadline expired
- Cancellation
Request cancellation was observed
- Protocol
HTTP protocol validation failed
- Ingress_Denial
Shared ingress budget denied buffering
- Rate_Limit_Denial
Rate limiter rejected work
- Bulkhead_Denial
Concurrency limit rejected work
- SSE_Connection
SSE lifecycle event
- WebSocket_Connection
WebSocket lifecycle event
- WebSocket_Message
WebSocket message event
In_Memory
type In_Memory (Capacity : Positive := 256) is
limited new Sink with private;
Default bounded-cardinality in-memory metric sink. Capacity is the maximum route/method/status-class series.
Read
function Read (Item : In_Memory) return Snapshot
Read an atomic aggregate snapshot.
Parameters
- Item
In-memory sink
Return value
Current counters
Sink
type Sink is limited interface;
Application-neutral thread-safe metric sink. Implementations must not retain borrowed strings and should not raise from callbacks.
Snapshot
type Snapshot is record
Active : Natural;
Requests : Natural;
Request_Bytes : Natural;
Response_Bytes : Natural;
Latency_Total : Duration;
Latency_Max : Duration;
Series : Natural;
Dropped_Series : Natural;
Events : Event_Counters;
end record;
Aggregate in-memory metric snapshot.
Record fields
- Active
Current active requests
- Requests
Completed requests
- Request_Bytes
Total decoded request bytes
- Response_Bytes
Total response payload bytes
- Latency_Total
Sum of observed latency
- Latency_Max
Maximum observed latency
- Series
Number of bounded route/method/status-class series
- Dropped_Series
New series discarded after capacity
- Events
Bounded event counters