Skip to content

Commit 4160099

Browse files
dingsdaxclaude
andauthored
feat(http): add http.server.request.time_in_queue attribute (#267)
* feat(http): add http.server.request.time_in_queue attribute Adds the `http.server.request.time_in_queue` semantic convention attribute to capture the time (in milliseconds) a request spent waiting in the server queue before processing began. This attribute is populated from the `X-Request-Start` header set by reverse proxies (Nginx, HAProxy, Heroku router, etc.) and first introduced in sentry-ruby: getsentry/sentry-ruby#2838 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(http): add generated attribute definitions for http.server.request.time_in_queue Generate TypeScript and Python attribute definitions including type exports, metadata entries, and TypedDict annotations. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0e79c16 commit 4160099

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

javascript/sentry-conventions/src/attributes.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,6 +3914,26 @@ export const HTTP_SERVER_NAME = 'http.server_name';
39143914
*/
39153915
export type HTTP_SERVER_NAME_TYPE = string;
39163916

3917+
// Path: model/attributes/http/http__server__request__time_in_queue.json
3918+
3919+
/**
3920+
* The time in milliseconds the request spent in the server queue before processing began. Measured from the X-Request-Start header set by reverse proxies (e.g., Nginx, HAProxy, Heroku) to when the application started handling the request. `http.server.request.time_in_queue`
3921+
*
3922+
* Attribute Value Type: `number` {@link HTTP_SERVER_REQUEST_TIME_IN_QUEUE_TYPE}
3923+
*
3924+
* Contains PII: maybe
3925+
*
3926+
* Attribute defined in OTEL: No
3927+
*
3928+
* @example 50
3929+
*/
3930+
export const HTTP_SERVER_REQUEST_TIME_IN_QUEUE = 'http.server.request.time_in_queue';
3931+
3932+
/**
3933+
* Type for {@link HTTP_SERVER_REQUEST_TIME_IN_QUEUE} http.server.request.time_in_queue
3934+
*/
3935+
export type HTTP_SERVER_REQUEST_TIME_IN_QUEUE_TYPE = number;
3936+
39173937
// Path: model/attributes/http/http__status_code.json
39183938

39193939
/**
@@ -9072,6 +9092,7 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
90729092
[HTTP_ROUTE]: 'string',
90739093
[HTTP_SCHEME]: 'string',
90749094
[HTTP_SERVER_NAME]: 'string',
9095+
[HTTP_SERVER_REQUEST_TIME_IN_QUEUE]: 'double',
90759096
[HTTP_STATUS_CODE]: 'integer',
90769097
[HTTP_TARGET]: 'string',
90779098
[HTTP_URL]: 'string',
@@ -9501,6 +9522,7 @@ export type AttributeName =
95019522
| typeof HTTP_ROUTE
95029523
| typeof HTTP_SCHEME
95039524
| typeof HTTP_SERVER_NAME
9525+
| typeof HTTP_SERVER_REQUEST_TIME_IN_QUEUE
95049526
| typeof HTTP_STATUS_CODE
95059527
| typeof HTTP_TARGET
95069528
| typeof HTTP_URL
@@ -11735,6 +11757,17 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1173511757
},
1173611758
aliases: [SERVER_ADDRESS, NET_HOST_NAME, HTTP_HOST],
1173711759
},
11760+
[HTTP_SERVER_REQUEST_TIME_IN_QUEUE]: {
11761+
brief:
11762+
'The time in milliseconds the request spent in the server queue before processing began. Measured from the X-Request-Start header set by reverse proxies (e.g., Nginx, HAProxy, Heroku) to when the application started handling the request.',
11763+
type: 'double',
11764+
pii: {
11765+
isPii: 'maybe',
11766+
},
11767+
isInOtel: false,
11768+
example: 50,
11769+
sdks: ['ruby'],
11770+
},
1173811771
[HTTP_STATUS_CODE]: {
1173911772
brief: 'The status code of the HTTP response.',
1174011773
type: 'integer',
@@ -14293,6 +14326,7 @@ export type Attributes = {
1429314326
[HTTP_ROUTE]?: HTTP_ROUTE_TYPE;
1429414327
[HTTP_SCHEME]?: HTTP_SCHEME_TYPE;
1429514328
[HTTP_SERVER_NAME]?: HTTP_SERVER_NAME_TYPE;
14329+
[HTTP_SERVER_REQUEST_TIME_IN_QUEUE]?: HTTP_SERVER_REQUEST_TIME_IN_QUEUE_TYPE;
1429614330
[HTTP_STATUS_CODE]?: HTTP_STATUS_CODE_TYPE;
1429714331
[HTTP_TARGET]?: HTTP_TARGET_TYPE;
1429814332
[HTTP_URL]?: HTTP_URL_TYPE;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"key": "http.server.request.time_in_queue",
3+
"brief": "The time in milliseconds the request spent in the server queue before processing began. Measured from the X-Request-Start header set by reverse proxies (e.g., Nginx, HAProxy, Heroku) to when the application started handling the request.",
4+
"type": "double",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": 50.0,
10+
"sdks": ["ruby"]
11+
}

python/src/sentry_conventions/attributes.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,18 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
22632263
Example: "https"
22642264
"""
22652265

2266+
# Path: model/attributes/http/http__server__request__time_in_queue.json
2267+
HTTP_SERVER_REQUEST_TIME_IN_QUEUE: Literal["http.server.request.time_in_queue"] = (
2268+
"http.server.request.time_in_queue"
2269+
)
2270+
"""The time in milliseconds the request spent in the server queue before processing began. Measured from the X-Request-Start header set by reverse proxies (e.g., Nginx, HAProxy, Heroku) to when the application started handling the request.
2271+
2272+
Type: float
2273+
Contains PII: maybe
2274+
Defined in OTEL: No
2275+
Example: 50
2276+
"""
2277+
22662278
# Path: model/attributes/http/http__server_name.json
22672279
HTTP_SERVER_NAME: Literal["http.server_name"] = "http.server_name"
22682280
"""The server domain name
@@ -6342,6 +6354,14 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
63426354
deprecation=DeprecationInfo(replacement="url.scheme"),
63436355
aliases=["url.scheme"],
63446356
),
6357+
"http.server.request.time_in_queue": AttributeMetadata(
6358+
brief="The time in milliseconds the request spent in the server queue before processing began. Measured from the X-Request-Start header set by reverse proxies (e.g., Nginx, HAProxy, Heroku) to when the application started handling the request.",
6359+
type=AttributeType.DOUBLE,
6360+
pii=PiiInfo(isPii=IsPii.MAYBE),
6361+
is_in_otel=False,
6362+
example=50,
6363+
sdks=["ruby"],
6364+
),
63456365
"http.server_name": AttributeMetadata(
63466366
brief="The server domain name",
63476367
type=AttributeType.STRING,
@@ -8368,6 +8388,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
83688388
"http.response_transfer_size": int,
83698389
"http.route": str,
83708390
"http.scheme": str,
8391+
"http.server.request.time_in_queue": float,
83718392
"http.server_name": str,
83728393
"http.status_code": int,
83738394
"http.target": str,

0 commit comments

Comments
 (0)