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 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-amz-request-id
orx-amz-requestid
. - 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.
- 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.
- Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- Client port number.
- The event_id uniquely identifies the event.
- The source identifies the context in which an event happened.
- The version of the CloudEvents specification which the event uses.
- The subject of the event in the context of the event producer (identified by source).
- The event_type contains a value describing the type of event related to the originating occurrence.
- 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 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.
- Whether or not the query is idempotent
- The fetch size used for paging, i.e. how many rows will be returned at once.
- The number of times a query was speculatively executed. Not set or
0
if the query was not executed speculatively. - The name of a collection (table, container) within the database.
- Unique Cosmos client instance id.
- Cosmos client connection mode
- Cosmos DB Operation Type
- RU consumed for that operation
- Request payload size in bytes
- Cosmos DB sub status code.
- Represents the human-readable identifier of the node/instance to which a request was routed.
- A dynamic value in the url path.
- 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 query parameter used in
db.query.text
, with<key>
being the parameter name, and the attribute value being a string representation of the parameter value. - The database query being executed.
- Database response status code.
- The database management system (DBMS) product as identified by the client instrumentation.
- Describes a class of error the operation ended with.
- Identifies the class / type of event.
- SHOULD be set to true if the exception event is recorded at a point where it is known 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 of the feature flag.
- The name of the service provider that performs the flag evaluation.
- SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.
- The response format that is requested.
- Requests with same seed value more likely to return same result.
- The service tier requested. May be a specific tier, detault, or auto.
- The service tier used for the response.
- The name of the operation being performed.
- 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.
- 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.
- 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).
- HTTP response headers,
<key>
being the normalized HTTP Header name (lowercase), the value being the header values. - 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.
- 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.
- Value of the HTTP User-Agent header sent by the client.