Module trace
Expand description
§Trace Semantic Conventions
The trace semantic conventions define a set of standardized attributes to
be used in Span
s.
§Usage
use opentelemetry::KeyValue;
use opentelemetry::{global, trace::Tracer as _};
use opentelemetry_semantic_conventions as semconv;
let tracer = global::tracer("my-component");
let _span = tracer
.span_builder("span-name")
.with_attributes([
KeyValue::new(semconv::trace::CLIENT_ADDRESS, "example.org"),
KeyValue::new(semconv::trace::CLIENT_PORT, 80i64),
])
.start(&tracer);
Constants§
- ANDROID_
APP_ STATE - This attribute represents the state of the application.
- AWS_
DYNAMODB_ ATTRIBUTES_ TO_ GET - The value of the
AttributesToGet
request parameter. - AWS_
DYNAMODB_ ATTRIBUTE_ DEFINITIONS - The JSON-serialized value of each item in the
AttributeDefinitions
request field. - AWS_
DYNAMODB_ CONSISTENT_ READ - The value of the
ConsistentRead
request parameter. - AWS_
DYNAMODB_ CONSUMED_ CAPACITY - The JSON-serialized value of each item in the
ConsumedCapacity
response field. - AWS_
DYNAMODB_ COUNT - The value of the
Count
response parameter. - AWS_
DYNAMODB_ EXCLUSIVE_ START_ TABLE - The value of the
ExclusiveStartTableName
request parameter. - AWS_
DYNAMODB_ GLOBAL_ SECONDARY_ INDEXES - The JSON-serialized value of each item of the
GlobalSecondaryIndexes
request field - AWS_
DYNAMODB_ GLOBAL_ SECONDARY_ INDEX_ UPDATES - The JSON-serialized value of each item in the
GlobalSecondaryIndexUpdates
request field. - AWS_
DYNAMODB_ INDEX_ NAME - The value of the
IndexName
request parameter. - AWS_
DYNAMODB_ ITEM_ COLLECTION_ METRICS - The JSON-serialized value of the
ItemCollectionMetrics
response field. - AWS_
DYNAMODB_ LIMIT - The value of the
Limit
request parameter. - AWS_
DYNAMODB_ LOCAL_ SECONDARY_ INDEXES - The JSON-serialized value of each item of the
LocalSecondaryIndexes
request field. - AWS_
DYNAMODB_ PROJECTION - The value of the
ProjectionExpression
request parameter. - AWS_
DYNAMODB_ PROVISIONED_ READ_ CAPACITY - The value of the
ProvisionedThroughput.ReadCapacityUnits
request parameter. - AWS_
DYNAMODB_ PROVISIONED_ WRITE_ CAPACITY - The value of the
ProvisionedThroughput.WriteCapacityUnits
request parameter. - AWS_
DYNAMODB_ SCANNED_ COUNT - The value of the
ScannedCount
response parameter. - AWS_
DYNAMODB_ SCAN_ FORWARD - The value of the
ScanIndexForward
request parameter. - AWS_
DYNAMODB_ SEGMENT - The value of the
Segment
request parameter. - AWS_
DYNAMODB_ SELECT - The value of the
Select
request parameter. - AWS_
DYNAMODB_ TABLE_ COUNT - The number of items in the
TableNames
response parameter. - AWS_
DYNAMODB_ TABLE_ NAMES - The keys in the
RequestItems
object field. - AWS_
DYNAMODB_ TOTAL_ SEGMENTS - The value of the
TotalSegments
request parameter. - AWS_
EXTENDED_ REQUEST_ ID - The AWS extended request ID as returned in the response header
x-amz-id-2
. - AWS_
LAMBDA_ INVOKED_ ARN - The full invoked ARN as provided on the
Context
passed to the function (Lambda-Runtime-Invoked-Function-Arn
header on the/runtime/invocation/next
applicable). - AWS_
REQUEST_ ID - The AWS request ID as returned in the response headers
x-amzn-requestid
,x-amzn-request-id
orx-amz-request-id
. - AWS_
S3_ BUCKET - The S3 bucket name the request refers to. Corresponds to the
--bucket
parameter of the S3 API operations. - AWS_
S3_ COPY_ SOURCE - The source object (in the form
bucket
/key
) for the copy operation. - AWS_
S3_ DELETE - The delete request container that specifies the objects to be deleted.
- AWS_
S3_ KEY - The S3 object key the request refers to. Corresponds to the
--key
parameter of the S3 API operations. - AWS_
S3_ PART_ NUMBER - The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000.
- AWS_
S3_ UPLOAD_ ID - Upload ID that identifies the multipart upload.
- AZURE_
CLIENT_ ID - The unique identifier of the client instance.
- AZURE_
COSMOSDB_ CONNECTION_ MODE - Cosmos client connection mode.
- AZURE_
COSMOSDB_ CONSISTENCY_ LEVEL - Account or request consistency level.
- AZURE_
COSMOSDB_ OPERATION_ CONTACTED_ REGIONS - List of regions contacted during operation in the order that they were contacted. If there is more than one region listed, it indicates that the operation was performed on multiple regions i.e. cross-regional call.
- AZURE_
COSMOSDB_ OPERATION_ REQUEST_ CHARGE - The number of request units consumed by the operation.
- AZURE_
COSMOSDB_ REQUEST_ BODY_ SIZE - Request payload size in bytes.
- AZURE_
COSMOSDB_ RESPONSE_ SUB_ STATUS_ CODE - Cosmos DB sub status code.
- AZ_
NAMESPACE - Azure Resource Provider Namespace as recognized by the client.
- AZ_
SERVICE_ REQUEST_ ID - The unique identifier of the service request. It’s generated by the Azure service and returned with the response.
- CASSANDRA_
CONSISTENCY_ LEVEL - The consistency level of the query. Based on consistency values from CQL.
- CASSANDRA_
COORDINATOR_ DC - The data center of the coordinating node for a query.
- CASSANDRA_
COORDINATOR_ ID - The ID of the coordinating node for a query.
- CASSANDRA_
PAGE_ SIZE - The fetch size used for paging, i.e. how many rows will be returned at once.
- CASSANDRA_
QUERY_ IDEMPOTENT - Whether or not the query is idempotent.
- CASSANDRA_
SPECULATIVE_ EXECUTION_ COUNT - The number of times a query was speculatively executed. Not set or
0
if the query was not executed speculatively. - CLIENT_
ADDRESS - Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- CLIENT_
PORT - Client port number.
- CLOUD_
RESOURCE_ ID - Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, a fully qualified resource ID on Azure, a full resource name on GCP)
- DB_
COLLECTION_ NAME - The name of a collection (table, container) within the database.
- DB_
NAMESPACE - The name of the database, fully qualified within the server address and port.
- DB_
OPERATION_ BATCH_ SIZE - The number of queries included in a batch operation.
- DB_
OPERATION_ NAME - The name of the operation or command being executed.
- DB_
OPERATION_ PARAMETER - A database operation parameter, with
<key>
being the parameter name, and the attribute value being a string representation of the parameter value. - DB_
QUERY_ SUMMARY - Low cardinality representation of a database query text.
- DB_
QUERY_ TEXT - The database query being executed.
- DB_
RESPONSE_ RETURNED_ ROWS - Number of rows returned by the operation.
- DB_
RESPONSE_ STATUS_ CODE - Database response status code.
- DB_
SYSTEM_ NAME - The database management system (DBMS) product as identified by the client instrumentation.
- ELASTICSEARCH_
NODE_ NAME - Represents the human-readable identifier of the node/instance to which a request was routed.
- ERROR_
TYPE - Describes a class of error the operation ended with.
- EXCEPTION_
ESCAPED - Indicates that the exception is escaping the scope of the span.
- EXCEPTION_
MESSAGE - The exception message.
- EXCEPTION_
STACKTRACE - A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.
- EXCEPTION_
TYPE - The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.
- FAAS_
COLDSTART - A boolean that is true if the serverless function is executed for the first time (aka cold-start).
- FAAS_
CRON - A string containing the schedule period as Cron Expression.
- FAAS_
DOCUMENT_ COLLECTION - The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.
- FAAS_
DOCUMENT_ NAME - The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.
- FAAS_
DOCUMENT_ OPERATION - Describes the type of the operation that was performed on the data.
- FAAS_
DOCUMENT_ TIME - A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC.
- FAAS_
INVOKED_ NAME - The name of the invoked function.
- FAAS_
INVOKED_ PROVIDER - The cloud provider of the invoked function.
- FAAS_
INVOKED_ REGION - The cloud region of the invoked function.
- FAAS_
TIME - A string containing the function invocation time in the ISO 8601 format expressed in UTC.
- FAAS_
TRIGGER - Type of the trigger which caused this function invocation.
- FEATURE_
FLAG_ CONTEXT_ ID - The unique identifier for the flag evaluation context. For example, the targeting key.
- FEATURE_
FLAG_ EVALUATION_ ERROR_ MESSAGE - A message explaining the nature of an error occurring during flag evaluation.
- FEATURE_
FLAG_ EVALUATION_ REASON - The reason code which shows how a feature flag value was determined.
- FEATURE_
FLAG_ KEY - The lookup key of the feature flag.
- FEATURE_
FLAG_ PROVIDER_ NAME - Identifies the feature flag provider.
- FEATURE_
FLAG_ SET_ ID - The identifier of the flag set to which the feature flag belongs.
- FEATURE_
FLAG_ VARIANT - A semantic identifier for an evaluated flag value.
- FEATURE_
FLAG_ VERSION - The version of the ruleset used during the evaluation. This may be any stable value which uniquely identifies the ruleset.
- GEN_
AI_ AGENT_ DESCRIPTION - Free-form description of the GenAI agent provided by the application.
- GEN_
AI_ AGENT_ ID - The unique identifier of the GenAI agent.
- GEN_
AI_ AGENT_ NAME - Human-readable name of the GenAI agent provided by the application.
- GEN_
AI_ OPENAI_ REQUEST_ SERVICE_ TIER - The service tier requested. May be a specific tier, default, or auto.
- GEN_
AI_ OPENAI_ RESPONSE_ SERVICE_ TIER - The service tier used for the response.
- GEN_
AI_ OPENAI_ RESPONSE_ SYSTEM_ FINGERPRINT - A fingerprint to track any eventual change in the Generative AI environment.
- GEN_
AI_ OPERATION_ NAME - The name of the operation being performed.
- GEN_
AI_ OUTPUT_ TYPE - Represents the content type requested by the client.
- GEN_
AI_ REQUEST_ CHOICE_ COUNT - The target number of candidate completions to return.
- GEN_
AI_ REQUEST_ ENCODING_ FORMATS - The encoding formats requested in an embeddings operation, if specified.
- GEN_
AI_ REQUEST_ FREQUENCY_ PENALTY - The frequency penalty setting for the GenAI request.
- GEN_
AI_ REQUEST_ MAX_ TOKENS - The maximum number of tokens the model generates for a request.
- GEN_
AI_ REQUEST_ MODEL - The name of the GenAI model a request is being made to.
- GEN_
AI_ REQUEST_ PRESENCE_ PENALTY - The presence penalty setting for the GenAI request.
- GEN_
AI_ REQUEST_ SEED - Requests with same seed value more likely to return same result.
- GEN_
AI_ REQUEST_ STOP_ SEQUENCES - List of sequences that the model will use to stop generating further tokens.
- GEN_
AI_ REQUEST_ TEMPERATURE - The temperature setting for the GenAI request.
- GEN_
AI_ REQUEST_ TOP_ K - The top_k sampling setting for the GenAI request.
- GEN_
AI_ REQUEST_ TOP_ P - The top_p sampling setting for the GenAI request.
- GEN_
AI_ RESPONSE_ FINISH_ REASONS - Array of reasons the model stopped generating tokens, corresponding to each generation received.
- GEN_
AI_ RESPONSE_ ID - The unique identifier for the completion.
- GEN_
AI_ RESPONSE_ MODEL - The name of the model that generated the response.
- GEN_
AI_ SYSTEM - The Generative AI product as identified by the client or server instrumentation.
- GEN_
AI_ TOOL_ CALL_ ID - The tool call identifier.
- GEN_
AI_ TOOL_ NAME - Name of the tool utilized by the agent.
- GEN_
AI_ USAGE_ INPUT_ TOKENS - The number of tokens used in the GenAI input (prompt).
- GEN_
AI_ USAGE_ OUTPUT_ TOKENS - The number of tokens used in the GenAI response (completion).
- GRAPHQL_
DOCUMENT - The GraphQL document being executed.
- GRAPHQL_
OPERATION_ NAME - The name of the operation being executed.
- GRAPHQL_
OPERATION_ TYPE - The type of the operation being executed.
- HTTP_
REQUEST_ BODY_ SIZE - The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.
- HTTP_
REQUEST_ HEADER - HTTP request headers,
<key>
being the normalized HTTP Header name (lowercase), the value being the header values. - HTTP_
REQUEST_ METHOD - HTTP request method.
- HTTP_
REQUEST_ METHOD_ ORIGINAL - Original HTTP method sent by the client in the request line.
- HTTP_
REQUEST_ RESEND_ COUNT - The ordinal number of request resending attempt (for any reason, including redirects).
- HTTP_
REQUEST_ SIZE - The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any.
- HTTP_
RESPONSE_ BODY_ SIZE - The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.
- HTTP_
RESPONSE_ HEADER - HTTP response headers,
<key>
being the normalized HTTP Header name (lowercase), the value being the header values. - HTTP_
RESPONSE_ SIZE - The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any.
- HTTP_
RESPONSE_ STATUS_ CODE - HTTP response status code.
- HTTP_
ROUTE - The matched route, that is, the path template in the format used by the respective server framework.
- IOS_
APP_ STATE - This attribute represents the state of the application.
- NETWORK_
LOCAL_ ADDRESS - Local address of the network connection - IP address or Unix domain socket name.
- NETWORK_
LOCAL_ PORT - Local port number of the network connection.
- NETWORK_
PEER_ ADDRESS - Peer address of the network connection - IP address or Unix domain socket name.
- NETWORK_
PEER_ PORT - Peer port number of the network connection.
- NETWORK_
PROTOCOL_ NAME - OSI application layer or non-OSI equivalent.
- NETWORK_
PROTOCOL_ VERSION - The actual version of the protocol used for network communication.
- NETWORK_
TRANSPORT - OSI transport layer or inter-process communication method.
- NETWORK_
TYPE - OSI network layer or non-OSI equivalent.
- PROCESS_
COMMAND_ ARGS - All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from
proc/[pid]/cmdline
. For libc-based executables, this would be the full argv vector passed tomain
. - PROCESS_
EXECUTABLE_ NAME - The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of
/proc/[pid]/exe
. On Windows, this SHOULD be set to the base name ofGetProcessImageFileNameW
. - PROCESS_
EXECUTABLE_ PATH - The full path to the process executable. On Linux based systems, can be set to the target of
proc/[pid]/exe
. On Windows, can be set to the result ofGetProcessImageFileNameW
. - PROCESS_
EXIT_ CODE - The exit code of the process.
- PROCESS_
PID - Process identifier (PID).
- RPC_
MESSAGE_ COMPRESSED_ SIZE - Compressed size of the message in bytes.
- RPC_
MESSAGE_ ID - MUST be calculated as two different counters starting from
1
one for sent messages and one for received message. - RPC_
MESSAGE_ TYPE - Whether this is a received or sent message.
- RPC_
MESSAGE_ UNCOMPRESSED_ SIZE - Uncompressed size of the message in bytes.
- RPC_
METHOD - The name of the (logical) method being called, must be equal to the $method part in the span name.
- RPC_
SERVICE - The full (logical) name of the service being called, including its package name, if applicable.
- RPC_
SYSTEM - A string identifying the remoting system. See below for a list of well-known identifiers.
- SERVER_
ADDRESS - Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- SERVER_
PORT - Server port number.
- SESSION_
ID - A unique id to identify a session.
- SESSION_
PREVIOUS_ ID - The previous
session.id
for this user, when known. - URL_
FULL - Absolute URL describing a network resource according to RFC3986
- URL_
PATH - The URI path component
- URL_
QUERY - The URI query component
- URL_
SCHEME - The URI scheme component identifying the used protocol.
- URL_
TEMPLATE - The low-cardinality template of an absolute path reference.
- USER_
AGENT_ ORIGINAL - Value of the HTTP User-Agent header sent by the client.
- USER_
AGENT_ SYNTHETIC_ TYPE - Specifies the category of synthetic traffic, such as tests or bots.