Skip to main content

Function: createHttpServerAttributes()

@arolariu/website


@arolariu/website / instrumentation.server / createHttpServerAttributes

Function: createHttpServerAttributes()

createHttpServerAttributes(method, statusCode, options?): HttpAttributes

Defined in: instrumentation.server.ts:720

Creates HTTP semantic attributes for server operations.

Parameters

method

HttpMethod

The HTTP method (GET, POST, etc.)

statusCode

number

The HTTP response status code

options?

Additional HTTP-related attributes

route?

string

target?

string

userAgent?

string

clientAddress?

string

Returns

HttpAttributes

Type-safe HTTP attributes

Example

const attrs = createHttpServerAttributes('GET', 200, {
route: '/api/users/:id',
target: '/api/users/123',
});
// was this page useful?