Variable: SpanAttributes
constSpanAttributes:object
Defined in: src/observability/tracer.ts:405
Semantic conventions for common span attributes.
Type declaration
DB_NAME
readonlyDB_NAME:"db.name"='db.name'
DB_OPERATION
readonlyDB_OPERATION:"db.operation"='db.operation'
DB_STATEMENT
readonlyDB_STATEMENT:"db.statement"='db.statement'
DB_SYSTEM
readonlyDB_SYSTEM:"db.system"='db.system'
HTTP_METHOD
readonlyHTTP_METHOD:"http.method"='http.method'
HTTP_ROUTE
readonlyHTTP_ROUTE:"http.route"='http.route'
HTTP_STATUS_CODE
readonlyHTTP_STATUS_CODE:"http.status_code"='http.status_code'
HTTP_URL
readonlyHTTP_URL:"http.url"='http.url'
MESSAGING_DESTINATION
readonlyMESSAGING_DESTINATION:"messaging.destination"='messaging.destination'
MESSAGING_OPERATION
readonlyMESSAGING_OPERATION:"messaging.operation"='messaging.operation'
MESSAGING_SYSTEM
readonlyMESSAGING_SYSTEM:"messaging.system"='messaging.system'
OPERATION
readonlyOPERATION:"chive.operation"='chive.operation'
PREPRINT_DID
readonlyPREPRINT_DID:"chive.preprint.did"='chive.preprint.did'
PREPRINT_URI
readonlyPREPRINT_URI:"chive.preprint.uri"='chive.preprint.uri'
REQUEST_ID
readonlyREQUEST_ID:"chive.request.id"='chive.request.id'
USER_DID
readonlyUSER_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,
});