The Span Interface specifies a series of timed application events that have a start and end time. Below describes the conventions for the Span interface for the data field on the span.
Keys on the data field should be lower-case and use underscores instead of camel-case. There are some exceptions to this, but these exist because of backwards compatability.
Below describes the conventions for the Span interface for the data field on the span that are currently used by the product or are important to bring up.
General
Attribute
Type
Description
Examples
code.filepath
string
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
/app/myapplication/http/handler/server.py
code.lineno
number
The line number in code.filepath best representing the operation. It SHOULD point within the code unit named in code.function
42
code.function
string
The method or function name, or equivalent (usually rightmost part of the code unit's name).
server_request
code.namespace
string
The "namespace" within which code.function is defined. Usually the qualified class or module name, such that code.namespace + some separator + code.function form a unique identifier for the code unit.
http.handler
HTTP
Attribute
Type
Description
Examples
http.query
string
The Query string present in the URL.
?foo=bar&bar=baz
http.fragment
string
The Fragments present in the URI (Browser SDKs only).
#foo=bar
http.request.method
string
The HTTP method used.
GET
http.response.status_code
int
The status HTTP response.
404
http.response_content_length
number
The encoded body size of the response (in bytes).
123
http.decoded_response_content_length
number
The decoded body size of the response (in bytes).
456
http.response_transfer_size
number
The transfer size of the response (in bytes).
789
Mobile
Attribute
Type
Description
Examples
blocked_main_thread
boolean
Whether the main thread was blocked by the span.
true
call_stack
StackFrame[]
The most relevant stack frames, that lead to the File I/O span. The stack frame should adhere to the StackFrame interface.
url
string
The URL of the resource that was fetched.
https://example.com
type
string
More granular type of the operation happening.
fetch
frames.total
int
The number of total frames rendered during the lifetime of the span.
60
frames.slow
int
The number of slow frames rendered during the lifetime of the span.
2
frames.frozen
int
The number of frozen frames rendered during the lifetime of the span.
1
frames.delay
number
The sum of all delayed frame durations in seconds during the lifetime of the span. For more information see frames delay.
The name of the operation being executed, e.g. the MongoDB command name such as findAndModify, or the SQL keyword. Based on OpenTelemetry's common db attributes
SELECT
db.name
string
This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
customers
server.address
string
Name of the database host.
example.com
server.port
int
Logical server port number host.
8080
server.socket.address
string
Physical server IP address or Unix socket address. host.
10.5.3.2
server.socket.port
int
Physical server port. host.
16456
Web Server
Attribute
Type
Description
Examples
cache.hit
boolean
If the cache was hit during this span.
true
cache.item_size
int
The size of the requested item in the cache. In bytes.
58
AI
Attribute
Type
Description
Examples
ai.input_messages
string
The input messages sent to the model
[{"role": "user", "message": "hello"}]
ai.completion_tоkens.used
int
The number of tokens used to respond to the message
10
ai.prompt_tоkens.used
int
The number of tokens used to process just the prompt
20
ai.total_tоkens.used
int
The total number of tokens used to process the prompt
30
ai.model_id
list
The vendor-specific ID of the model used
"gpt-4"
ai.streaming
boolean
Whether the request was streamed back
true
ai.responses
list
The response messages sent back by the AI model
["hello", "world"]
Thread
Attribute
Type
Description
Examples
thread.id
string
Identifier of a thread from where the span originated.
123456
thread.name
string
Label identifying a thread from where the span originated.
main
Deprecated
Names that SDKs are still sending so we cannot remove them yet, but should not be used in new code.