Loading
feat(fields): add error, HTTP, duration, remote IP, and TCP address fields
Add standardized observability fields to Labkit::Fields
Summary
This MR enriches the Labkit::Fields module to bring it in line with the Go labkit equivalent, adding 8 new standardized field constants for common observability use cases.
New fields
| Constant | Value | Description |
|---|---|---|
ERROR_TYPE |
"error_type" |
Error type or classification (e.g. "NoMethodError") |
ERROR_MESSAGE |
"error_message" |
Detailed error message |
HTTP_STATUS_CODE |
"status" |
HTTP response status code |
HTTP_METHOD |
"method" |
HTTP request method (e.g. "GET", "POST") |
HTTP_URL |
"url" |
Full URL of an HTTP request |
DURATION_S |
"duration_s" |
Duration of an operation in seconds |
REMOTE_IP |
"remote_ip" |
Remote IP address of a request |
TCP_ADDRESS |
"tcp_address" |
TCP address in host:port format |
Motivation
Using constants from Labkit::Fields rather than raw strings reduces the risk of typos and naming inconsistencies across services. These fields mirror the Go labkit implementation, enabling log correlation across polyglot systems.