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§
- The value of the
AttributesToGet
request parameter. - The JSON-serialized value of each item in the
AttributeDefinitions
request field. - The value of the
ConsistentRead
request parameter. - The JSON-serialized value of each item in the
ConsumedCapacity
response field. - The value of the
Count
response parameter. - The value of the
ExclusiveStartTableName
request parameter. - The JSON-serialized value of each item of the
GlobalSecondaryIndexes
request field - The JSON-serialized value of each item in the
GlobalSecondaryIndexUpdates
request field. - The value of the
IndexName
request parameter. - The JSON-serialized value of the
ItemCollectionMetrics
response field. - The value of the
Limit
request parameter. - The JSON-serialized value of each item of the
LocalSecondaryIndexes
request field. - The value of the
ProjectionExpression
request parameter. - The value of the
ProvisionedThroughput.ReadCapacityUnits
request parameter. - The value of the
ProvisionedThroughput.WriteCapacityUnits
request parameter. - The value of the
ScannedCount
response parameter. - The value of the
ScanIndexForward
request parameter. - The value of the
Segment
request parameter. - The value of the
Select
request parameter. - The number of items in the
TableNames
response parameter. - The keys in the
RequestItems
object field. - The value of the
TotalSegments
request parameter. - The AWS extended request ID as returned in the response header
x-amz-id-2
. - 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). - The AWS request ID as returned in the response headers
x-amzn-requestid
,x-amzn-request-id
orx-amz-request-id
. - The S3 bucket name the request refers to. Corresponds to the
--bucket
parameter of the S3 API operations. - The source object (in the form
bucket
/key
) for the copy operation. - The delete request container that specifies the objects to be deleted.
- The S3 object key the request refers to. Corresponds to the
--key
parameter of the S3 API operations. - The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000.
- Upload ID that identifies the multipart upload.
- The unique identifier of the client instance.
- Cosmos client connection mode.
- Account or request consistency level.
- 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.
- The number of request units consumed by the operation.
- Request payload size in bytes.
- Cosmos DB sub status code.
- Azure Resource Provider Namespace as recognized by the client.
- The unique identifier of the service request. It’s generated by the Azure service and returned with the response.
- The consistency level of the query. Based on consistency values from CQL.
- The data center of the coordinating node for a query.
- The ID of the coordinating node for a query.
- The fetch size used for paging, i.e. how many rows will be returned at once.
- Whether or not the query is idempotent.
- The number of times a query was speculatively executed. Not set or
0
if the query was not executed speculatively. - Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- Client port number.
- 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)
- The name of a collection (table, container) within the database.
- The name of the database, fully qualified within the server address and port.
- The number of queries included in a batch operation.
- The name of the operation or command being executed.
- A database operation parameter, with
<key>
being the parameter name, and the attribute value being a string representation of the parameter value. - Low cardinality representation of a database query text.
- The database query being executed.
- Number of rows returned by the operation.
- Database response status code.
- The database management system (DBMS) product as identified by the client instrumentation.
- Represents the human-readable identifier of the node/instance to which a request was routed.
- Describes a class of error the operation ended with.
- EXCEPTION_
ESCAPED Deprecated Indicates that the exception is escaping the scope of the span. - The exception message.
- 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.
- 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.
- A boolean that is true if the serverless function is executed for the first time (aka cold-start).
- A string containing the schedule period as Cron Expression.
- 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.
- 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.
- Describes the type of the operation that was performed on the data.
- The invocation ID of the current function invocation.
- The name of the invoked function.
- The cloud provider of the invoked function.
- The cloud region of the invoked function.
- Type of the trigger which caused this function invocation.
- The unique identifier for the flag evaluation context. For example, the targeting key.
- A message explaining the nature of an error occurring during flag evaluation.
- The reason code which shows how a feature flag value was determined.
- The lookup key of the feature flag.
- Identifies the feature flag provider.
- The identifier of the flag set to which the feature flag belongs.
- A semantic identifier for an evaluated flag value.
- The version of the ruleset used during the evaluation. This may be any stable value which uniquely identifies the ruleset.
- The response format that is requested.
- The service tier requested. May be a specific tier, default, or auto.
- The service tier used for the response.
- A fingerprint to track any eventual change in the Generative AI environment.
- The name of the operation being performed.
- The encoding formats requested in an embeddings operation, if specified.
- The frequency penalty setting for the GenAI request.
- The maximum number of tokens the model generates for a request.
- The name of the GenAI model a request is being made to.
- The presence penalty setting for the GenAI request.
- Requests with same seed value more likely to return same result.
- List of sequences that the model will use to stop generating further tokens.
- The temperature setting for the GenAI request.
- The top_k sampling setting for the GenAI request.
- The top_p sampling setting for the GenAI request.
- Array of reasons the model stopped generating tokens, corresponding to each generation received.
- The unique identifier for the completion.
- The name of the model that generated the response.
- The Generative AI product as identified by the client or server instrumentation.
- The number of tokens used in the GenAI input (prompt).
- The number of tokens used in the GenAI response (completion).
- The GraphQL document being executed.
- The name of the operation being executed.
- The type of the operation being executed.
- 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 headers,
<key>
being the normalized HTTP Header name (lowercase), the value being the header values. - HTTP request method.
- Original HTTP method sent by the client in the request line.
- The ordinal number of request resending attempt (for any reason, including redirects).
- 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.
- 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 headers,
<key>
being the normalized HTTP Header name (lowercase), the value being the header values. - 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.
- The matched route, that is, the path template in the format used by the respective server framework.
- The number of messages sent, received, or processed in the scope of the batching operation.
- A unique identifier for the client that consumes or produces a message.
- The name of the consumer group with which a consumer is associated.
- A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name).
- The message destination name
- The identifier of the partition messages are sent to or received from, unique within the
messaging.destination.name
. - The name of the destination subscription from which a message is consumed.
- Low cardinality representation of the messaging destination name
- A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed.
- The size of the message body in bytes.
- The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called “Correlation ID”.
- The size of the message body and metadata in bytes.
- A value used by the messaging system as an identifier for the message, represented as a string.
- The system-specific name of the messaging operation.
- A string identifying the type of the messaging operation.
- The messaging system as identified by the client instrumentation.
- Local address of the network connection - IP address or Unix domain socket name.
- Local port number of the network connection.
- Peer address of the network connection - IP address or Unix domain socket name.
- Peer port number of the network connection.
- OSI application layer or non-OSI equivalent.
- The actual version of the protocol used for network communication.
- OSI network layer or non-OSI equivalent.
- 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
. - The name of the process executable. On Linux based systems, can be set to the
Name
inproc/[pid]/status
. On Windows, can be set to the base name ofGetProcessImageFileNameW
. - 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
. - The exit code of the process.
- Process identifier (PID).
- The error codes of the Connect request. Error codes are always string values.
- Connect request metadata,
<key>
being the normalized Connect Metadata key (lowercase), the value being the metadata values. - Connect response metadata,
<key>
being the normalized Connect Metadata key (lowercase), the value being the metadata values. - gRPC request metadata,
<key>
being the normalized gRPC Metadata key (lowercase), the value being the metadata values. - gRPC response metadata,
<key>
being the normalized gRPC Metadata key (lowercase), the value being the metadata values. - The numeric status code of the gRPC request.
error.code
property of response if it is an error response.error.message
property of response if it is an error response.id
property of request or response. Since protocol allows id to be int, string,null
or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case ofnull
value. Omit entirely if this is a notification.- Protocol version as in
jsonrpc
property of request/response. Since JSON-RPC 1.0 doesn’t specify this, the value can be omitted. - Compressed size of the message in bytes.
- MUST be calculated as two different counters starting from
1
one for sent messages and one for received message. - Whether this is a received or sent message.
- Uncompressed size of the message in bytes.
- The name of the (logical) method being called, must be equal to the $method part in the span name.
- The full (logical) name of the service being called, including its package name, if applicable.
- A string identifying the remoting system. See below for a list of well-known identifiers.
- Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- Server port number.
- Absolute URL describing a network resource according to RFC3986
- The URI path component
- The URI query component
- The URI scheme component identifying the used protocol.
- The low-cardinality template of an absolute path reference.
- Value of the HTTP User-Agent header sent by the client.
- Specifies the category of synthetic traffic, such as tests or bots.