Skip to main content

Variable: SpanAttributes

const SpanAttributes: object

Defined in: src/observability/tracer.ts:405

Semantic conventions for common span attributes.

Type declaration

DB_NAME

readonly DB_NAME: "db.name" = 'db.name'

DB_OPERATION

readonly DB_OPERATION: "db.operation" = 'db.operation'

DB_STATEMENT

readonly DB_STATEMENT: "db.statement" = 'db.statement'

DB_SYSTEM

readonly DB_SYSTEM: "db.system" = 'db.system'

HTTP_METHOD

readonly HTTP_METHOD: "http.method" = 'http.method'

HTTP_ROUTE

readonly HTTP_ROUTE: "http.route" = 'http.route'

HTTP_STATUS_CODE

readonly HTTP_STATUS_CODE: "http.status_code" = 'http.status_code'

HTTP_URL

readonly HTTP_URL: "http.url" = 'http.url'

MESSAGING_DESTINATION

readonly MESSAGING_DESTINATION: "messaging.destination" = 'messaging.destination'

MESSAGING_OPERATION

readonly MESSAGING_OPERATION: "messaging.operation" = 'messaging.operation'

MESSAGING_SYSTEM

readonly MESSAGING_SYSTEM: "messaging.system" = 'messaging.system'

OPERATION

readonly OPERATION: "chive.operation" = 'chive.operation'

PREPRINT_DID

readonly PREPRINT_DID: "chive.preprint.did" = 'chive.preprint.did'

PREPRINT_URI

readonly PREPRINT_URI: "chive.preprint.uri" = 'chive.preprint.uri'

REQUEST_ID

readonly REQUEST_ID: "chive.request.id" = 'chive.request.id'

USER_DID

readonly USER_DID: "chive.user.did" = 'chive.user.did'

Remarks

Use these constants for consistent attribute naming across spans.

Example

addSpanAttributes({
[SpanAttributes.HTTP_METHOD]: 'GET',
[SpanAttributes.HTTP_ROUTE]: '/api/preprints/:id',
[SpanAttributes.HTTP_STATUS_CODE]: 200,
});