Expand description
§Resource Semantic Conventions
The resource semantic conventions define a set of standardized attributes
to be used in Resource
s.
§Usage
use opentelemetry::KeyValue;
use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource};
use opentelemetry_semantic_conventions as semconv;
let _tracer = TracerProvider::builder()
.with_config(config().with_resource(Resource::new(vec![
KeyValue::new(semconv::resource::SERVICE_NAME, "my-service"),
KeyValue::new(semconv::resource::SERVICE_NAMESPACE, "my-namespace"),
])))
.build();
Constants§
- Uniquely identifies the framework API revision offered by a version (
os.version
) of the android operating system. More information can be found here. - Full type name of the
IExceptionHandler
implementation that handled the exception. - Rate limiting policy name.
- Rate-limiting result, shows whether the lease was acquired or contains a rejection reason.
- Flag indicating if request was handled by the application pipeline.
- A value that indicates whether the matched route is a fallback route.
- 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 ARN of an ECS cluster.
- The Amazon Resource Name (ARN) of an ECS container instance.
- The launch type for an ECS task.
- The ARN of a running ECS task.
- The family name of the ECS task definition used to create the ECS task.
- The ID of a running ECS task. The ID MUST be extracted from
task.arn
. - The revision for the task definition used to create the ECS task.
- The ARN of an EKS cluster.
- The Amazon Resource Name(s) (ARN) of the AWS log group(s).
- The name(s) of the AWS log group(s) an application is writing to.
- The ARN(s) of the AWS log stream(s).
- The name(s) of the AWS log stream(s) an application is writing to.
- Array of brand name and version separated by a space.
- Preferred language of the user using the browser.
- A boolean that is true if the browser is running on a mobile device.
- The platform on which the browser is running.
- 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.
- The cloud account ID the resource is assigned to.
- Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
- The cloud platform in use.
- Name of the cloud provider.
- The geographical region the resource is running.
- 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 column number in
code.filepath
best representing the operation. It SHOULD point within the code unit named incode.function
. - The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
- The method or function name, or equivalent (usually rightmost part of the code unit's name).
- The line number in
code.filepath
best representing the operation. It SHOULD point within the code unit named incode.function
. - The "namespace" within which
code.function
is defined. Usually the qualified class or module name, such thatcode.namespace
+ some separator +code.function
form a unique identifier for the code unit. - 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 command used to run the container (i.e. the command name).
- All the command arguments (including the command/executable itself) run by the container.
- The full command run by the container as a single string representing the full command.
- The CPU state for this data point.
- Container ID. Usually a UUID, as for example used to identify Docker containers. The UUID might be abbreviated.
- Runtime specific image identifier. Usually a hash algorithm followed by a UUID.
- Name of the image the container was built on.
- Repo digests of the container image as provided by the container runtime.
- Container image tags. An example can be found in Docker Image Inspect. Should be only the
<tag>
section of the full name for example fromregistry.example.com/my-org/my-image:<tag>
. - Container name used by container runtime.
- The container runtime managing this container.
- 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 the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).
- Deprecated, use
server.address
,server.port
attributes instead. - Unique Cosmos client instance id.
- Cosmos client connection mode.
- Cosmos DB container name.
- CosmosDB Operation Type.
- RU consumed for that operation.
- Request payload size in bytes.
- Cosmos DB status code.
- Cosmos DB sub status code.
- Represents the identifier of an Elasticsearch cluster.
- Deprecated, use
db.instance.id
instead. - An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like
select @@hostname
. - Removed, no replacement at this time.
- The MongoDB collection being accessed within the database stated in
db.name
. - The Microsoft SQL Server instance name connecting to. This name is used to determine the port of a named instance.
- 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).
- The name of the operation being executed, e.g. the MongoDB command name such as
findAndModify
, or the SQL keyword. - The index of the database being accessed as used in the
SELECT
command, provided as an integer. To be used instead of the genericdb.name
attribute. - The name of the primary table that the operation is acting upon, including the database name (if applicable).
- The database statement being executed.
- An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
- Username for accessing the database.
- Name of the deployment environment (aka deployment tier).
- Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- Destination port number.
- A unique identifier representing the device.
- The name of the device manufacturer.
- The model identifier for the device.
- The marketing name for the device model.
- The disk IO operation direction.
- The name being queried.
- Username or client_id extracted from the access token or Authorization header in the inbound request from outside the system.
- Actual/assumed role the client is making the request under extracted from token or application security context.
- Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute value in a SAML 2.0 Assertion.
- 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 execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
- 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.
- The amount of memory available to the serverless function converted to Bytes.
- The name of the single function that this runtime instance executes.
- Type of the trigger which caused this function invocation.
- The immutable version of the function being executed.
- 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.
- Directory where the file is located. It should include the drive letter, when appropriate.
- File extension, excluding the leading dot.
- Name of the file including the extension, without the directory.
- Full path to the file, including the file name. It should include the drive letter, when appropriate.
- File size in bytes.
- The name of the Cloud Run execution being run for the Job, as set by the
CLOUD_RUN_EXECUTION
environment variable. - The index for a task within an execution as provided by the
CLOUD_RUN_TASK_INDEX
environment variable. - The hostname of a GCE instance. This is the full value of the default or custom hostname.
- The instance name of a GCE instance. This is the value provided by
host.name
, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the default internal DNS name. - Unique identifier for the application.
- Commit hash for the current release.
- Time and date the release was created.
- The CPU architecture the host system is running on.
- The amount of level 2 memory cache available to the processor (in Bytes).
- Family or generation of the CPU.
- Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family.
- Model designation of the processor.
- Stepping or core revisions.
- Processor manufacturer identifier. A maximum 12-character string.
- Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the
machine-id
. See the table below for the sources to use to determine themachine-id
based on operating system. - VM image ID or host OS image ID. For Cloud, this value is from the provider.
- Name of the VM image or OS install the host was instantiated from.
- The version string of the VM image or host OS as defined in Version Attributes.
- Available IP addresses of the host, excluding loopback interfaces.
- Available MAC addresses of the host, excluding loopback interfaces.
- Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.
- Type of host. For Cloud, this must be the machine type.
- State of the HTTP connection in the HTTP connection pool.
- Deprecated, use
network.protocol.name
instead. - Deprecated, use
http.request.method
instead. - 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.
- Deprecated, use
http.request.header.content-length
instead. - 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.
- Deprecated, use
http.response.header.content-length
instead. - 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.
- Deprecated, use
url.scheme
instead. - Deprecated, use
http.response.status_code
instead. - Deprecated, use
url.path
andurl.query
instead. - Deprecated, use
url.full
instead. - Deprecated, use
user_agent.original
instead. - Name of the buffer pool.
- Name of the memory pool.
- The type of memory.
- The name of the cluster.
- A pseudo-ID for the cluster, set to the UID of the
kube-system
namespace. - The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (
container.name
). - Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.
- The name of the CronJob.
- The UID of the CronJob.
- The name of the DaemonSet.
- The UID of the DaemonSet.
- The name of the Deployment.
- The UID of the Deployment.
- The name of the Job.
- The UID of the Job.
- The name of the namespace that the pod is running in.
- The name of the Node.
- The UID of the Node.
- The name of the Pod.
- The UID of the Pod.
- The name of the ReplicaSet.
- The UID of the ReplicaSet.
- The name of the StatefulSet.
- The UID of the StatefulSet.
- The basename of the file.
- The basename of the file, with symlinks resolved.
- The full path to the file.
- The full path to the file, with symlinks resolved.
- The stream associated with the log. See below for a list of well-known values.
- A unique identifier for the Log Record.
- 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.
- 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
. - A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name).
- The name of the original destination the message was published to.
- 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 name of the consumer group the event consumer is associated with.
- The UTC epoch seconds at which the message has been accepted and stored in the entity.
- The ordering key for a given message. If the attribute is not present, the message does not have an ordering key.
- Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers.
- "Deprecated, use
messaging.destination.partition.id
instead.". - Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from
messaging.message.id
in that they're not unique. If the key isnull
, the attribute MUST NOT be set. - The offset of a record in the corresponding Kafka partition.
- A boolean that is true if the message is a tombstone.
- 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.
- A string identifying the kind of messaging operation.
- RabbitMQ message routing key.
- RabbitMQ message delivery tag.
- Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind.
- Model of message consumption. This only applies to consumer spans.
- The delay time level for delay message, which determines the message delay time.
- The timestamp in milliseconds that the delay message is expected to be delivered to consumer.
- It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group.
- Key(s) of message, another way to mark message besides message id.
- The secondary classifier of message besides topic.
- Type of message.
- Namespace of RocketMQ resources, resources in different namespaces are individual.
- The name of the subscription in the topic messages are received from.
- Describes the settlement type.
- Number of deliveries that have been attempted for this message.
- The UTC epoch seconds at which the message has been accepted and stored in the entity.
- An identifier for the messaging system being used. See below for a list of well-known identifiers.
- The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.
- The mobile carrier country code.
- The mobile carrier network code.
- The name of the mobile carrier.
- This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.
- The internet connection type.
- The network IO operation direction.
- 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.
- Deprecated, use
server.address
. - Deprecated, use
server.port
. - Deprecated, use
server.address
on client spans andclient.address
on server spans. - Deprecated, use
server.port
on client spans andclient.port
on server spans. - Deprecated, use
network.protocol.name
. - Deprecated, use
network.protocol.version
. - Deprecated, use
network.transport
andnetwork.type
. - Deprecated, use
network.local.address
. - Deprecated, use
network.local.port
. - Deprecated, use
network.peer.address
. - Deprecated, no replacement at this time.
- Deprecated, use
network.peer.port
. - Deprecated, use
network.transport
. - The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.
- Unique identifier for a particular build or compilation of the operating system.
- Human readable (not intended to be parsed) OS version information, like e.g. reported by
ver
orlsb_release -a
commands. - Human readable operating system name.
- The operating system type.
- The version string of the operating system as defined in Version Attributes.
- None.
- None.
- The name of the instrumentation scope - (
InstrumentationScope.Name
in OTLP). - The version of the instrumentation scope - (
InstrumentationScope.Version
in OTLP). - The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of
server.address
andserver.port
attributes formatted asserver.address:server.port
. - The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in
proc/[pid]/cmdline
. On Windows, can be set to the first parameter extracted fromGetCommandLineW
. - 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 full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of
GetCommandLineW
. Do not set this if you have to assemble it just for monitoring; useprocess.command_args
instead. - The CPU state for this data point. A process SHOULD be characterized either by data points with no
state
labels, or only data points withstate
labels. - 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 username of the user that owns the process.
- Parent Process identifier (PPID).
- Process identifier (PID).
- An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.
- The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler.
- The version of the runtime of this process, as returned by the runtime without modification.
- The error codes of the Connect request. Error codes are always string 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. - 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.
- The string ID of the service instance.
- Logical name of the service.
- A namespace for
service.name
. - The version string of the service API or implementation. The format is not defined by these conventions.
- A unique id to identify a session.
- The previous
session.id
for this user, when known. - SignalR HTTP connection closure status.
- Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
- Source port number.
- The state of a connection in the pool.
- The logical CPU number [0..n-1].
- The CPU state for this data point. A system's CPU SHOULD be characterized either by data points with no
state
labels, or only data points withstate
labels. - The device identifier.
- The filesystem mode.
- The filesystem mount path.
- The filesystem state.
- The filesystem type.
- The memory state.
- A stateless protocol MUST NOT set this attribute.
- The paging access direction.
- The memory paging state.
- The memory paging type.
- Deprecated, use
system.process.status
instead. - The process state, e.g., Linux Process State Codes.
- The name of the auto instrumentation agent or distribution, if used.
- The version string of the auto instrumentation agent or distribution, if used.
- The language of the telemetry SDK.
- The name of the telemetry SDK as defined above.
- The version string of the telemetry SDK.
- Current "managed" thread ID (as opposed to OS thread ID).
- Current thread name.
- String indicating the cipher used during the current connection.
- PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of
client.certificate_chain
since this value also exists in that list. - Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of
client.certificate
since that value should be the first certificate in the chain. - Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.
- Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.
- Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.
- Distinguished name of subject of the issuer of the x.509 certificate presented by the client.
- A hash that identifies clients based on how they perform an SSL/TLS handshake.
- Date/Time indicating when client certificate is no longer considered valid.
- Date/Time indicating when client certificate is first considered valid.
- Also called an SNI, this tells the server which hostname to which the client is attempting to connect to.
- Distinguished name of subject of the x.509 certificate presented by the client.
- Array of ciphers offered by the client during the client hello.
- String indicating the curve used for the given cipher, when applicable.
- Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel.
- String indicating the protocol being tunneled. Per the values in the IANA registry, this string should be lower case.
- Normalized lowercase protocol name parsed from original string of the negotiated SSL/TLS protocol version.
- Numeric part of the version parsed from the original string of the negotiated SSL/TLS protocol version.
- Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation.
- PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of
server.certificate_chain
since this value also exists in that list. - Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of
server.certificate
since that value should be the first certificate in the chain. - Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.
- Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.
- Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.
- Distinguished name of subject of the issuer of the x.509 certificate presented by the client.
- A hash that identifies servers based on how they perform an SSL/TLS handshake.
- Date/Time indicating when server certificate is no longer considered valid.
- Date/Time indicating when server certificate is first considered valid.
- Distinguished name of subject of the x.509 certificate presented by the server.
- Domain extracted from the
url.full
, such as "opentelemetry.io". - The file extension extracted from the
url.full
, excluding the leading dot. - The URI fragment component.
- Absolute URL describing a network resource according to RFC3986.
- Unmodified original URL as seen in the event source.
- The URI path component.
- Port extracted from the
url.full
. - The URI query component.
- The highest registered url domain, stripped of the subdomain.
- The URI scheme component identifying the used protocol.
- The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.
- The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is
com
. - Name of the user-agent extracted from original. Usually refers to the browser's name.
- Value of the HTTP User-Agent header sent by the client.
- Version of the user-agent extracted from original. Usually refers to the browser's version.
- Additional description of the web engine (e.g. detailed version and edition information).
- The name of the web engine.
- The version of the web engine.