From f2cfb7cbcf38be15160d523adb7e9195029ca905 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 6 Mar 2023 21:35:46 +0100 Subject: [PATCH 1/4] Fix #2016 --- .../trace/semantic_conventions.h | 584 ++---------------- buildscripts/semantic-convention/generate.sh | 4 +- .../sdk/resource/semantic_conventions.h | 98 +-- 3 files changed, 107 insertions(+), 579 deletions(-) diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index d0485704ef..ddd227f795 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -21,7 +21,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; /** * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of @@ -40,26 +40,12 @@ static constexpr const char *kExceptionMessage = "exception.message"; */ static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; -/** - * The name identifies the event. - */ -static constexpr const char *kEventName = "event.name"; - -/** - * The domain identifies the business context for the events. - * - *

Notes: -

- */ -static constexpr const char *kEventDomain = "event.domain"; - /** * The full invoked ARN as provided on the {@code Context} passed to the function ({@code Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable). * *

Notes: -

+ */ static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; @@ -255,7 +241,7 @@ static constexpr const char *kOtelStatusCode = "otel.status_code"; static constexpr const char *kOtelStatusDescription = "otel.status_description"; /** - * Type of the trigger which caused this function execution. + * Type of the trigger which caused this function invocation. * *

Notes:

static constexpr const char *kFaasTrigger = "faas.trigger"; /** - * The execution ID of the current function execution. + * The invocation ID of the current function invocation. */ -static constexpr const char *kFaasExecution = "faas.execution"; +static constexpr const char *kFaasInvocationId = "faas.invocation_id"; /** * The name of the source on which the triggering operation was performed. For example, in Cloud @@ -343,114 +329,6 @@ static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider"; */ static constexpr const char *kFaasInvokedRegion = "faas.invoked_region"; -/** - * Transport protocol used. See note below. - */ -static constexpr const char *kNetTransport = "net.transport"; - -/** - * Application layer protocol used. The value SHOULD be normalized to lowercase. - */ -static constexpr const char *kNetAppProtocolName = "net.app.protocol.name"; - -/** - * Version of the application layer protocol used. See note below. - * - *

Notes: -

- */ -static constexpr const char *kNetAppProtocolVersion = "net.app.protocol.version"; - -/** - * Remote socket peer name. - */ -static constexpr const char *kNetSockPeerName = "net.sock.peer.name"; - -/** - * Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, etc. - */ -static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr"; - -/** - * Remote socket peer port. - */ -static constexpr const char *kNetSockPeerPort = "net.sock.peer.port"; - -/** - * Protocol address - * family which is used for communication. - */ -static constexpr const char *kNetSockFamily = "net.sock.family"; - -/** - * Logical remote hostname, see note below. - * - *

Notes: -

- */ -static constexpr const char *kNetPeerName = "net.peer.name"; - -/** - * Logical remote port number - */ -static constexpr const char *kNetPeerPort = "net.peer.port"; - -/** - * Logical local hostname or similar, see note below. - */ -static constexpr const char *kNetHostName = "net.host.name"; - -/** - * Logical local port number, preferably the one that the peer used to connect - */ -static constexpr const char *kNetHostPort = "net.host.port"; - -/** - * Local socket address. Useful in case of a multi-IP host. - */ -static constexpr const char *kNetSockHostAddr = "net.sock.host.addr"; - -/** - * Local socket port number. - */ -static constexpr const char *kNetSockHostPort = "net.sock.host.port"; - -/** - * The internet connection type currently being used by the host. - */ -static constexpr const char *kNetHostConnectionType = "net.host.connection.type"; - -/** - * 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. - */ -static constexpr const char *kNetHostConnectionSubtype = "net.host.connection.subtype"; - -/** - * The name of the mobile carrier. - */ -static constexpr const char *kNetHostCarrierName = "net.host.carrier.name"; - -/** - * The mobile carrier country code. - */ -static constexpr const char *kNetHostCarrierMcc = "net.host.carrier.mcc"; - -/** - * The mobile carrier network code. - */ -static constexpr const char *kNetHostCarrierMnc = "net.host.carrier.mnc"; - -/** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - */ -static constexpr const char *kNetHostCarrierIcc = "net.host.carrier.icc"; - /** * The {@code service.name} of * the remote service. SHOULD be equal to the actual {@code service.name} resource attribute of the @@ -521,47 +399,6 @@ static constexpr const char *kCodeLineno = "code.lineno"; */ static constexpr const char *kCodeColumn = "code.column"; -/** - * HTTP request method. - */ -static constexpr const char *kHttpMethod = "http.method"; - -/** - * HTTP response status code. - */ -static constexpr const char *kHttpStatusCode = "http.status_code"; - -/** - * Kind of HTTP protocol used. - * - *

Notes: -

- */ -static constexpr const char *kHttpFlavor = "http.flavor"; - -/** - * Value of the HTTP - * User-Agent header sent by the client. - */ -static constexpr const char *kHttpUserAgent = "http.user_agent"; - -/** - * 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. - */ -static constexpr const char *kHttpRequestContentLength = "http.request_content_length"; - -/** - * 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. - */ -static constexpr const char *kHttpResponseContentLength = "http.response_content_length"; - /** * Full HTTP request URL in the form {@code scheme://host[:port]/path?query[#fragment]}. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. @@ -583,27 +420,11 @@ static constexpr const char *kHttpUrl = "http.url"; */ static constexpr const char *kHttpResendCount = "http.resend_count"; -/** - * The URI scheme identifying the used protocol. - */ -static constexpr const char *kHttpScheme = "http.scheme"; - /** * The full request target as passed in a HTTP request line or equivalent. */ static constexpr const char *kHttpTarget = "http.target"; -/** - * The matched route (path template in the format used by the respective server framework). See note -below - * - *

Notes: -

- */ -static constexpr const char *kHttpRoute = "http.route"; - /** * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). @@ -757,106 +578,6 @@ static constexpr const char *kGraphqlOperationType = "graphql.operation.type"; */ static constexpr const char *kGraphqlDocument = "graphql.document"; -/** - * A value used by the messaging system as an identifier for the message, represented as a string. - */ -static constexpr const char *kMessagingMessageId = "messaging.message.id"; - -/** - * The conversation ID identifying the conversation to which the - * message belongs, represented as a string. Sometimes called "Correlation ID". - */ -static constexpr const char *kMessagingMessageConversationId = "messaging.message.conversation_id"; - -/** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown - * whether the compressed or uncompressed payload size is reported. - */ -static constexpr const char *kMessagingMessagePayloadSizeBytes = - "messaging.message.payload_size_bytes"; - -/** - * The compressed size of the message payload in bytes. - */ -static constexpr const char *kMessagingMessagePayloadCompressedSizeBytes = - "messaging.message.payload_compressed_size_bytes"; - -/** - * The message destination name - * - *

Notes: -

- */ -static constexpr const char *kMessagingDestinationName = "messaging.destination.name"; - -/** - * The kind of message destination - */ -static constexpr const char *kMessagingDestinationKind = "messaging.destination.kind"; - -/** - * Low cardinality representation of the messaging destination name - * - *

Notes: -

- */ -static constexpr const char *kMessagingDestinationTemplate = "messaging.destination.template"; - -/** - * A boolean that is true if the message destination is temporary and might not exist anymore after - * messages are processed. - */ -static constexpr const char *kMessagingDestinationTemporary = "messaging.destination.temporary"; - -/** - * A boolean that is true if the message destination is anonymous (could be unnamed or have - * auto-generated name). - */ -static constexpr const char *kMessagingDestinationAnonymous = "messaging.destination.anonymous"; - -/** - * The message source name - * - *

Notes: -

- */ -static constexpr const char *kMessagingSourceName = "messaging.source.name"; - -/** - * The kind of message source - */ -static constexpr const char *kMessagingSourceKind = "messaging.source.kind"; - -/** - * Low cardinality representation of the messaging source name - * - *

Notes: -

- */ -static constexpr const char *kMessagingSourceTemplate = "messaging.source.template"; - -/** - * A boolean that is true if the message source is temporary and might not exist anymore after - * messages are processed. - */ -static constexpr const char *kMessagingSourceTemporary = "messaging.source.temporary"; - -/** - * A boolean that is true if the message source is anonymous (could be unnamed or have - * auto-generated name). - */ -static constexpr const char *kMessagingSourceAnonymous = "messaging.source.anonymous"; - /** * A string identifying the messaging system. */ @@ -891,111 +612,6 @@ static constexpr const char *kMessagingBatchMessageCount = "messaging.batch.mess */ static constexpr const char *kMessagingConsumerId = "messaging.consumer.id"; -/** - * RabbitMQ message routing key. - */ -static constexpr const char *kMessagingRabbitmqDestinationRoutingKey = - "messaging.rabbitmq.destination.routing_key"; - -/** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the - same partition. They differ from {@code messaging.message.id} in that they're not unique. If the - key is {@code null}, the attribute MUST NOT be set. - * - *

Notes: -

- */ -static constexpr const char *kMessagingKafkaMessageKey = "messaging.kafka.message.key"; - -/** - * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not - * producers. - */ -static constexpr const char *kMessagingKafkaConsumerGroup = "messaging.kafka.consumer.group"; - -/** - * Client Id for the Consumer or Producer that is handling the message. - */ -static constexpr const char *kMessagingKafkaClientId = "messaging.kafka.client_id"; - -/** - * Partition the message is sent to. - */ -static constexpr const char *kMessagingKafkaDestinationPartition = - "messaging.kafka.destination.partition"; - -/** - * Partition the message is received from. - */ -static constexpr const char *kMessagingKafkaSourcePartition = "messaging.kafka.source.partition"; - -/** - * The offset of a record in the corresponding Kafka partition. - */ -static constexpr const char *kMessagingKafkaMessageOffset = "messaging.kafka.message.offset"; - -/** - * A boolean that is true if the message is a tombstone. - */ -static constexpr const char *kMessagingKafkaMessageTombstone = "messaging.kafka.message.tombstone"; - -/** - * Namespace of RocketMQ resources, resources in different namespaces are individual. - */ -static constexpr const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace"; - -/** - * Name of the RocketMQ producer/consumer group that is handling the message. The client type is - * identified by the SpanKind. - */ -static constexpr const char *kMessagingRocketmqClientGroup = "messaging.rocketmq.client_group"; - -/** - * The unique identifier for each client. - */ -static constexpr const char *kMessagingRocketmqClientId = "messaging.rocketmq.client_id"; - -/** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - */ -static constexpr const char *kMessagingRocketmqMessageDeliveryTimestamp = - "messaging.rocketmq.message.delivery_timestamp"; - -/** - * The delay time level for delay message, which determines the message delay time. - */ -static constexpr const char *kMessagingRocketmqMessageDelayTimeLevel = - "messaging.rocketmq.message.delay_time_level"; - -/** - * 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. - */ -static constexpr const char *kMessagingRocketmqMessageGroup = "messaging.rocketmq.message.group"; - -/** - * Type of message. - */ -static constexpr const char *kMessagingRocketmqMessageType = "messaging.rocketmq.message.type"; - -/** - * The secondary classifier of message besides topic. - */ -static constexpr const char *kMessagingRocketmqMessageTag = "messaging.rocketmq.message.tag"; - -/** - * Key(s) of message, another way to mark message besides message id. - */ -static constexpr const char *kMessagingRocketmqMessageKeys = "messaging.rocketmq.message.keys"; - -/** - * Model of message consumption. This only applies to consumer spans. - */ -static constexpr const char *kMessagingRocketmqConsumptionModel = - "messaging.rocketmq.consumption_model"; - /** * A string identifying the remoting system. See below for a list of well-known identifiers. */ @@ -1054,17 +670,13 @@ static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; */ static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; -// Enum definitions -namespace EventDomainValues -{ -/** Events from browser apps. */ -static constexpr const char *kBrowser = "browser"; -/** Events from mobile apps. */ -static constexpr const char *kDevice = "device"; -/** Events from Kubernetes. */ -static constexpr const char *kK8s = "k8s"; -} // namespace EventDomainValues +/** + * The error codes of the Connect + * request. Error codes are always string values. + */ +static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; +// Enum definitions namespace OpentracingRefTypeValues { /** The parent Span depends on the child Span in some capacity. */ @@ -1252,106 +864,6 @@ static constexpr const char *kGcp = "gcp"; static constexpr const char *kTencentCloud = "tencent_cloud"; } // namespace FaasInvokedProviderValues -namespace NetTransportValues -{ -/** ip_tcp. */ -static constexpr const char *kIpTcp = "ip_tcp"; -/** ip_udp. */ -static constexpr const char *kIpUdp = "ip_udp"; -/** Named or anonymous pipe. See note below. */ -static constexpr const char *kPipe = "pipe"; -/** In-process communication. */ -static constexpr const char *kInproc = "inproc"; -/** Something else (non IP-based). */ -static constexpr const char *kOther = "other"; -} // namespace NetTransportValues - -namespace NetSockFamilyValues -{ -/** IPv4 address. */ -static constexpr const char *kInet = "inet"; -/** IPv6 address. */ -static constexpr const char *kInet6 = "inet6"; -/** Unix domain socket path. */ -static constexpr const char *kUnix = "unix"; -} // namespace NetSockFamilyValues - -namespace NetHostConnectionTypeValues -{ -/** wifi. */ -static constexpr const char *kWifi = "wifi"; -/** wired. */ -static constexpr const char *kWired = "wired"; -/** cell. */ -static constexpr const char *kCell = "cell"; -/** unavailable. */ -static constexpr const char *kUnavailable = "unavailable"; -/** unknown. */ -static constexpr const char *kUnknown = "unknown"; -} // namespace NetHostConnectionTypeValues - -namespace NetHostConnectionSubtypeValues -{ -/** GPRS. */ -static constexpr const char *kGprs = "gprs"; -/** EDGE. */ -static constexpr const char *kEdge = "edge"; -/** UMTS. */ -static constexpr const char *kUmts = "umts"; -/** CDMA. */ -static constexpr const char *kCdma = "cdma"; -/** EVDO Rel. 0. */ -static constexpr const char *kEvdo0 = "evdo_0"; -/** EVDO Rev. A. */ -static constexpr const char *kEvdoA = "evdo_a"; -/** CDMA2000 1XRTT. */ -static constexpr const char *kCdma20001xrtt = "cdma2000_1xrtt"; -/** HSDPA. */ -static constexpr const char *kHsdpa = "hsdpa"; -/** HSUPA. */ -static constexpr const char *kHsupa = "hsupa"; -/** HSPA. */ -static constexpr const char *kHspa = "hspa"; -/** IDEN. */ -static constexpr const char *kIden = "iden"; -/** EVDO Rev. B. */ -static constexpr const char *kEvdoB = "evdo_b"; -/** LTE. */ -static constexpr const char *kLte = "lte"; -/** EHRPD. */ -static constexpr const char *kEhrpd = "ehrpd"; -/** HSPAP. */ -static constexpr const char *kHspap = "hspap"; -/** GSM. */ -static constexpr const char *kGsm = "gsm"; -/** TD-SCDMA. */ -static constexpr const char *kTdScdma = "td_scdma"; -/** IWLAN. */ -static constexpr const char *kIwlan = "iwlan"; -/** 5G NR (New Radio). */ -static constexpr const char *kNr = "nr"; -/** 5G NRNSA (New Radio Non-Standalone). */ -static constexpr const char *kNrnsa = "nrnsa"; -/** LTE CA. */ -static constexpr const char *kLteCa = "lte_ca"; -} // namespace NetHostConnectionSubtypeValues - -namespace HttpFlavorValues -{ -/** HTTP/1.0. */ -static constexpr const char *kHttp10 = "1.0"; -/** HTTP/1.1. */ -static constexpr const char *kHttp11 = "1.1"; -/** HTTP/2. */ -static constexpr const char *kHttp20 = "2.0"; -/** HTTP/3. */ -static constexpr const char *kHttp30 = "3.0"; -/** SPDY protocol. */ -static constexpr const char *kSpdy = "SPDY"; -/** QUIC protocol. */ -static constexpr const char *kQuic = "QUIC"; -} // namespace HttpFlavorValues - namespace GraphqlOperationTypeValues { /** GraphQL query. */ @@ -1362,22 +874,6 @@ static constexpr const char *kMutation = "mutation"; static constexpr const char *kSubscription = "subscription"; } // namespace GraphqlOperationTypeValues -namespace MessagingDestinationKindValues -{ -/** A message sent to a queue. */ -static constexpr const char *kQueue = "queue"; -/** A message sent to a topic. */ -static constexpr const char *kTopic = "topic"; -} // namespace MessagingDestinationKindValues - -namespace MessagingSourceKindValues -{ -/** A message received from a queue. */ -static constexpr const char *kQueue = "queue"; -/** A message received from a topic. */ -static constexpr const char *kTopic = "topic"; -} // namespace MessagingSourceKindValues - namespace MessagingOperationValues { /** publish. */ @@ -1388,26 +884,6 @@ static constexpr const char *kReceive = "receive"; static constexpr const char *kProcess = "process"; } // namespace MessagingOperationValues -namespace MessagingRocketmqMessageTypeValues -{ -/** Normal message. */ -static constexpr const char *kNormal = "normal"; -/** FIFO message. */ -static constexpr const char *kFifo = "fifo"; -/** Delay message. */ -static constexpr const char *kDelay = "delay"; -/** Transaction message. */ -static constexpr const char *kTransaction = "transaction"; -} // namespace MessagingRocketmqMessageTypeValues - -namespace MessagingRocketmqConsumptionModelValues -{ -/** Clustering consumption model. */ -static constexpr const char *kClustering = "clustering"; -/** Broadcasting consumption model. */ -static constexpr const char *kBroadcasting = "broadcasting"; -} // namespace MessagingRocketmqConsumptionModelValues - namespace RpcSystemValues { /** gRPC. */ @@ -1418,6 +894,8 @@ static constexpr const char *kJavaRmi = "java_rmi"; static constexpr const char *kDotnetWcf = "dotnet_wcf"; /** Apache Dubbo. */ static constexpr const char *kApacheDubbo = "apache_dubbo"; +/** Connect RPC. */ +static constexpr const char *kConnectRpc = "connect_rpc"; } // namespace RpcSystemValues namespace RpcGrpcStatusCodeValues @@ -1458,6 +936,42 @@ static constexpr const int kDataLoss = 15; static constexpr const int kUnauthenticated = 16; } // namespace RpcGrpcStatusCodeValues +namespace RpcConnectRpcErrorCodeValues +{ +/** cancelled. */ +static constexpr const char *kCancelled = "cancelled"; +/** unknown. */ +static constexpr const char *kUnknown = "unknown"; +/** invalid_argument. */ +static constexpr const char *kInvalidArgument = "invalid_argument"; +/** deadline_exceeded. */ +static constexpr const char *kDeadlineExceeded = "deadline_exceeded"; +/** not_found. */ +static constexpr const char *kNotFound = "not_found"; +/** already_exists. */ +static constexpr const char *kAlreadyExists = "already_exists"; +/** permission_denied. */ +static constexpr const char *kPermissionDenied = "permission_denied"; +/** resource_exhausted. */ +static constexpr const char *kResourceExhausted = "resource_exhausted"; +/** failed_precondition. */ +static constexpr const char *kFailedPrecondition = "failed_precondition"; +/** aborted. */ +static constexpr const char *kAborted = "aborted"; +/** out_of_range. */ +static constexpr const char *kOutOfRange = "out_of_range"; +/** unimplemented. */ +static constexpr const char *kUnimplemented = "unimplemented"; +/** internal. */ +static constexpr const char *kInternal = "internal"; +/** unavailable. */ +static constexpr const char *kUnavailable = "unavailable"; +/** data_loss. */ +static constexpr const char *kDataLoss = "data_loss"; +/** unauthenticated. */ +static constexpr const char *kUnauthenticated = "unauthenticated"; +} // namespace RpcConnectRpcErrorCodeValues + } // namespace SemanticConventions } // namespace trace OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index ee9d3ae1a4..3bae8d0b3b 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -15,10 +15,10 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible # repository: https://github.com/open-telemetry/opentelemetry-specification -SEMCONV_VERSION=1.18.0 +SEMCONV_VERSION=1.19.0 # repository: https://github.com/open-telemetry/build-tools -GENERATOR_VERSION=0.15.1 +GENERATOR_VERSION=0.17.0 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 27aff268cc..895aa720d3 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -23,7 +23,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; /** * Array of brand name and version separated by a space @@ -62,16 +62,6 @@ static constexpr const char *kBrowserPlatform = "browser.platform"; */ static constexpr const char *kBrowserMobile = "browser.mobile"; -/** - * Full user-agent string provided by the browser - * - *

Notes: -

- */ -static constexpr const char *kBrowserUserAgent = "browser.user_agent"; - /** * Preferred language of the user using the browser * @@ -100,11 +90,41 @@ static constexpr const char *kCloudAccountId = "cloud.account.id"; href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/">AWS regions, Azure regions, Google Cloud regions, or Tencent Cloud regions. - + href="https://www.tencentcloud.com/document/product/213/6091">Tencent Cloud regions. */ static constexpr const char *kCloudRegion = "cloud.region"; +/** + * 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) + * + *

Notes: +

+ */ +static constexpr const char *kCloudResourceId = "cloud.resource_id"; + /** * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. @@ -201,6 +221,21 @@ static constexpr const char *kAwsLogStreamNames = "aws.log.stream.names"; */ static constexpr const char *kAwsLogStreamArns = "aws.log.stream.arns"; +/** + * Time and date the release was created + */ +static constexpr const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; + +/** + * Commit hash for the current release + */ +static constexpr const char *kHerokuReleaseCommit = "heroku.release.commit"; + +/** + * Unique identifier for the application + */ +static constexpr const char *kHerokuAppId = "heroku.app.id"; + /** * Container name used by container runtime. */ @@ -295,35 +330,11 @@ providers/products:
  • Azure: The full name {@code +the {@code cloud.resource_id} attribute).
  • */ static constexpr const char *kFaasName = "faas.name"; -/** - * The unique ID of the single function that this runtime instance executes. - * - *

    Notes: -

    - */ -static constexpr const char *kFaasId = "faas.id"; - /** * The immutable version of the function being executed. * @@ -352,19 +363,20 @@ static constexpr const char *kFaasVersion = "faas.version"; static constexpr const char *kFaasInstance = "faas.instance"; /** - * The amount of memory available to the serverless function in MiB. + * The amount of memory available to the serverless function converted to Bytes. * *

    Notes:

    + AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information (which must be multiplied by + 1,048,576). */ static constexpr const char *kFaasMaxMemory = "faas.max_memory"; /** * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For - * non-containerized Linux systems, the {@code machine-id} located in {@code /etc/machine-id} or - * {@code /var/lib/dbus/machine-id} may be used. + * non-containerized systems, this should be the {@code machine-id}. See the table below for the + * sources to use to determine the {@code machine-id} based on operating system. */ static constexpr const char *kHostId = "host.id"; @@ -703,6 +715,8 @@ static constexpr const char *kAws = "aws"; static constexpr const char *kAzure = "azure"; /** Google Cloud Platform. */ static constexpr const char *kGcp = "gcp"; +/** Heroku Platform as a Service. */ +static constexpr const char *kHeroku = "heroku"; /** IBM Cloud. */ static constexpr const char *kIbmCloud = "ibm_cloud"; /** Tencent Cloud. */ From dfdb1c6453a28b5a417d480b76fa72ccef9a6af3 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 6 Mar 2023 21:40:28 +0100 Subject: [PATCH 2/4] Added CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e85d23935..8976644466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ Increment the: [#1982](https://github.com/open-telemetry/opentelemetry-cpp/pull/1982) * Provide version major/minor/patch macros [#2014](https://github.com/open-telemetry/opentelemetry-cpp/pull/2014) +* [SEMANTIC CONVENTIONS] Upgrade to version 1.19.0 + [#2017](https://github.com/open-telemetry/opentelemetry-cpp/pull/2017) ## [1.8.2] 2023-01-31 From 82a0b65347b3ca5707eaaee0fe62addfe41b87df Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 21 Mar 2023 22:58:22 +0100 Subject: [PATCH 3/4] Rollback --- .../trace/semantic_conventions.h | 584 ++++++++++++++++-- buildscripts/semantic-convention/generate.sh | 4 +- .../sdk/resource/semantic_conventions.h | 98 ++- 3 files changed, 579 insertions(+), 107 deletions(-) diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index ddd227f795..d0485704ef 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -21,7 +21,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0"; /** * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of @@ -40,12 +40,26 @@ static constexpr const char *kExceptionMessage = "exception.message"; */ static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; +/** + * The name identifies the event. + */ +static constexpr const char *kEventName = "event.name"; + +/** + * The domain identifies the business context for the events. + * + *

    Notes: +

    • Events across different domains may have same {@code event.name}, yet be +unrelated events.
    + */ +static constexpr const char *kEventDomain = "event.domain"; + /** * The full invoked ARN as provided on the {@code Context} passed to the function ({@code Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable). * *

    Notes: -

    • This may be different from {@code cloud.resource_id} if an alias is involved.
    +
    • This may be different from {@code faas.id} if an alias is involved.
    */ static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; @@ -241,7 +255,7 @@ static constexpr const char *kOtelStatusCode = "otel.status_code"; static constexpr const char *kOtelStatusDescription = "otel.status_description"; /** - * Type of the trigger which caused this function invocation. + * Type of the trigger which caused this function execution. * *

    Notes:

    • For the server/consumer span on the incoming side, @@ -254,9 +268,9 @@ lambda, which is often HTTP).
    static constexpr const char *kFaasTrigger = "faas.trigger"; /** - * The invocation ID of the current function invocation. + * The execution ID of the current function execution. */ -static constexpr const char *kFaasInvocationId = "faas.invocation_id"; +static constexpr const char *kFaasExecution = "faas.execution"; /** * The name of the source on which the triggering operation was performed. For example, in Cloud @@ -329,6 +343,114 @@ static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider"; */ static constexpr const char *kFaasInvokedRegion = "faas.invoked_region"; +/** + * Transport protocol used. See note below. + */ +static constexpr const char *kNetTransport = "net.transport"; + +/** + * Application layer protocol used. The value SHOULD be normalized to lowercase. + */ +static constexpr const char *kNetAppProtocolName = "net.app.protocol.name"; + +/** + * Version of the application layer protocol used. See note below. + * + *

    Notes: +

    • {@code net.app.protocol.version} refers to the version of the protocol used and might be + different from the protocol client's version. If the HTTP client used has a version of {@code + 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to {@code 1.1}.
    • +
    + */ +static constexpr const char *kNetAppProtocolVersion = "net.app.protocol.version"; + +/** + * Remote socket peer name. + */ +static constexpr const char *kNetSockPeerName = "net.sock.peer.name"; + +/** + * Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, etc. + */ +static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr"; + +/** + * Remote socket peer port. + */ +static constexpr const char *kNetSockPeerPort = "net.sock.peer.port"; + +/** + * Protocol address + * family which is used for communication. + */ +static constexpr const char *kNetSockFamily = "net.sock.family"; + +/** + * Logical remote hostname, see note below. + * + *

    Notes: +

    • {@code net.peer.name} SHOULD NOT be set if capturing it would require an extra DNS + lookup.
    + */ +static constexpr const char *kNetPeerName = "net.peer.name"; + +/** + * Logical remote port number + */ +static constexpr const char *kNetPeerPort = "net.peer.port"; + +/** + * Logical local hostname or similar, see note below. + */ +static constexpr const char *kNetHostName = "net.host.name"; + +/** + * Logical local port number, preferably the one that the peer used to connect + */ +static constexpr const char *kNetHostPort = "net.host.port"; + +/** + * Local socket address. Useful in case of a multi-IP host. + */ +static constexpr const char *kNetSockHostAddr = "net.sock.host.addr"; + +/** + * Local socket port number. + */ +static constexpr const char *kNetSockHostPort = "net.sock.host.port"; + +/** + * The internet connection type currently being used by the host. + */ +static constexpr const char *kNetHostConnectionType = "net.host.connection.type"; + +/** + * 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. + */ +static constexpr const char *kNetHostConnectionSubtype = "net.host.connection.subtype"; + +/** + * The name of the mobile carrier. + */ +static constexpr const char *kNetHostCarrierName = "net.host.carrier.name"; + +/** + * The mobile carrier country code. + */ +static constexpr const char *kNetHostCarrierMcc = "net.host.carrier.mcc"; + +/** + * The mobile carrier network code. + */ +static constexpr const char *kNetHostCarrierMnc = "net.host.carrier.mnc"; + +/** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + */ +static constexpr const char *kNetHostCarrierIcc = "net.host.carrier.icc"; + /** * The {@code service.name} of * the remote service. SHOULD be equal to the actual {@code service.name} resource attribute of the @@ -399,6 +521,47 @@ static constexpr const char *kCodeLineno = "code.lineno"; */ static constexpr const char *kCodeColumn = "code.column"; +/** + * HTTP request method. + */ +static constexpr const char *kHttpMethod = "http.method"; + +/** + * HTTP response status code. + */ +static constexpr const char *kHttpStatusCode = "http.status_code"; + +/** + * Kind of HTTP protocol used. + * + *

    Notes: +

    • If {@code net.transport} is not specified, it can be assumed to be {@code IP.TCP} except + if {@code http.flavor} is {@code QUIC}, in which case {@code IP.UDP} is assumed.
    + */ +static constexpr const char *kHttpFlavor = "http.flavor"; + +/** + * Value of the HTTP + * User-Agent header sent by the client. + */ +static constexpr const char *kHttpUserAgent = "http.user_agent"; + +/** + * 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. + */ +static constexpr const char *kHttpRequestContentLength = "http.request_content_length"; + +/** + * 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. + */ +static constexpr const char *kHttpResponseContentLength = "http.response_content_length"; + /** * Full HTTP request URL in the form {@code scheme://host[:port]/path?query[#fragment]}. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. @@ -420,11 +583,27 @@ static constexpr const char *kHttpUrl = "http.url"; */ static constexpr const char *kHttpResendCount = "http.resend_count"; +/** + * The URI scheme identifying the used protocol. + */ +static constexpr const char *kHttpScheme = "http.scheme"; + /** * The full request target as passed in a HTTP request line or equivalent. */ static constexpr const char *kHttpTarget = "http.target"; +/** + * The matched route (path template in the format used by the respective server framework). See note +below + * + *

    Notes: +

    • MUST NOT be populated when this is not supported by the HTTP server framework as the +route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include +the application root if there is one.
    + */ +static constexpr const char *kHttpRoute = "http.route"; + /** * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). @@ -578,6 +757,106 @@ static constexpr const char *kGraphqlOperationType = "graphql.operation.type"; */ static constexpr const char *kGraphqlDocument = "graphql.document"; +/** + * A value used by the messaging system as an identifier for the message, represented as a string. + */ +static constexpr const char *kMessagingMessageId = "messaging.message.id"; + +/** + * The conversation ID identifying the conversation to which the + * message belongs, represented as a string. Sometimes called "Correlation ID". + */ +static constexpr const char *kMessagingMessageConversationId = "messaging.message.conversation_id"; + +/** + * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown + * whether the compressed or uncompressed payload size is reported. + */ +static constexpr const char *kMessagingMessagePayloadSizeBytes = + "messaging.message.payload_size_bytes"; + +/** + * The compressed size of the message payload in bytes. + */ +static constexpr const char *kMessagingMessagePayloadCompressedSizeBytes = + "messaging.message.payload_compressed_size_bytes"; + +/** + * The message destination name + * + *

    Notes: +

    • Destination name SHOULD uniquely identify a specific queue, topic or other entity within +the broker. If the broker does not have such notion, the destination name SHOULD uniquely identify +the broker.
    + */ +static constexpr const char *kMessagingDestinationName = "messaging.destination.name"; + +/** + * The kind of message destination + */ +static constexpr const char *kMessagingDestinationKind = "messaging.destination.kind"; + +/** + * Low cardinality representation of the messaging destination name + * + *

    Notes: +

    • Destination names could be constructed from templates. An example would be a destination + name involving a user name or product id. Although the destination name in this case is of high + cardinality, the underlying template is of low cardinality and can be effectively used for grouping + and aggregation.
    + */ +static constexpr const char *kMessagingDestinationTemplate = "messaging.destination.template"; + +/** + * A boolean that is true if the message destination is temporary and might not exist anymore after + * messages are processed. + */ +static constexpr const char *kMessagingDestinationTemporary = "messaging.destination.temporary"; + +/** + * A boolean that is true if the message destination is anonymous (could be unnamed or have + * auto-generated name). + */ +static constexpr const char *kMessagingDestinationAnonymous = "messaging.destination.anonymous"; + +/** + * The message source name + * + *

    Notes: +

    • Source name SHOULD uniquely identify a specific queue, topic, or other entity within the +broker. If the broker does not have such notion, the source name SHOULD uniquely identify the +broker.
    + */ +static constexpr const char *kMessagingSourceName = "messaging.source.name"; + +/** + * The kind of message source + */ +static constexpr const char *kMessagingSourceKind = "messaging.source.kind"; + +/** + * Low cardinality representation of the messaging source name + * + *

    Notes: +

    • Source names could be constructed from templates. An example would be a source name + involving a user name or product id. Although the source name in this case is of high cardinality, + the underlying template is of low cardinality and can be effectively used for grouping and + aggregation.
    + */ +static constexpr const char *kMessagingSourceTemplate = "messaging.source.template"; + +/** + * A boolean that is true if the message source is temporary and might not exist anymore after + * messages are processed. + */ +static constexpr const char *kMessagingSourceTemporary = "messaging.source.temporary"; + +/** + * A boolean that is true if the message source is anonymous (could be unnamed or have + * auto-generated name). + */ +static constexpr const char *kMessagingSourceAnonymous = "messaging.source.anonymous"; + /** * A string identifying the messaging system. */ @@ -612,6 +891,111 @@ static constexpr const char *kMessagingBatchMessageCount = "messaging.batch.mess */ static constexpr const char *kMessagingConsumerId = "messaging.consumer.id"; +/** + * RabbitMQ message routing key. + */ +static constexpr const char *kMessagingRabbitmqDestinationRoutingKey = + "messaging.rabbitmq.destination.routing_key"; + +/** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the + same partition. They differ from {@code messaging.message.id} in that they're not unique. If the + key is {@code null}, the attribute MUST NOT be set. + * + *

    Notes: +

    • If the key type is not string, it's string representation has to be supplied for the + attribute. If the key has no unambiguous, canonical string form, don't include its value.
    • +
    + */ +static constexpr const char *kMessagingKafkaMessageKey = "messaging.kafka.message.key"; + +/** + * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not + * producers. + */ +static constexpr const char *kMessagingKafkaConsumerGroup = "messaging.kafka.consumer.group"; + +/** + * Client Id for the Consumer or Producer that is handling the message. + */ +static constexpr const char *kMessagingKafkaClientId = "messaging.kafka.client_id"; + +/** + * Partition the message is sent to. + */ +static constexpr const char *kMessagingKafkaDestinationPartition = + "messaging.kafka.destination.partition"; + +/** + * Partition the message is received from. + */ +static constexpr const char *kMessagingKafkaSourcePartition = "messaging.kafka.source.partition"; + +/** + * The offset of a record in the corresponding Kafka partition. + */ +static constexpr const char *kMessagingKafkaMessageOffset = "messaging.kafka.message.offset"; + +/** + * A boolean that is true if the message is a tombstone. + */ +static constexpr const char *kMessagingKafkaMessageTombstone = "messaging.kafka.message.tombstone"; + +/** + * Namespace of RocketMQ resources, resources in different namespaces are individual. + */ +static constexpr const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace"; + +/** + * Name of the RocketMQ producer/consumer group that is handling the message. The client type is + * identified by the SpanKind. + */ +static constexpr const char *kMessagingRocketmqClientGroup = "messaging.rocketmq.client_group"; + +/** + * The unique identifier for each client. + */ +static constexpr const char *kMessagingRocketmqClientId = "messaging.rocketmq.client_id"; + +/** + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + */ +static constexpr const char *kMessagingRocketmqMessageDeliveryTimestamp = + "messaging.rocketmq.message.delivery_timestamp"; + +/** + * The delay time level for delay message, which determines the message delay time. + */ +static constexpr const char *kMessagingRocketmqMessageDelayTimeLevel = + "messaging.rocketmq.message.delay_time_level"; + +/** + * 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. + */ +static constexpr const char *kMessagingRocketmqMessageGroup = "messaging.rocketmq.message.group"; + +/** + * Type of message. + */ +static constexpr const char *kMessagingRocketmqMessageType = "messaging.rocketmq.message.type"; + +/** + * The secondary classifier of message besides topic. + */ +static constexpr const char *kMessagingRocketmqMessageTag = "messaging.rocketmq.message.tag"; + +/** + * Key(s) of message, another way to mark message besides message id. + */ +static constexpr const char *kMessagingRocketmqMessageKeys = "messaging.rocketmq.message.keys"; + +/** + * Model of message consumption. This only applies to consumer spans. + */ +static constexpr const char *kMessagingRocketmqConsumptionModel = + "messaging.rocketmq.consumption_model"; + /** * A string identifying the remoting system. See below for a list of well-known identifiers. */ @@ -670,13 +1054,17 @@ static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; */ static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; -/** - * The error codes of the Connect - * request. Error codes are always string values. - */ -static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; - // Enum definitions +namespace EventDomainValues +{ +/** Events from browser apps. */ +static constexpr const char *kBrowser = "browser"; +/** Events from mobile apps. */ +static constexpr const char *kDevice = "device"; +/** Events from Kubernetes. */ +static constexpr const char *kK8s = "k8s"; +} // namespace EventDomainValues + namespace OpentracingRefTypeValues { /** The parent Span depends on the child Span in some capacity. */ @@ -864,6 +1252,106 @@ static constexpr const char *kGcp = "gcp"; static constexpr const char *kTencentCloud = "tencent_cloud"; } // namespace FaasInvokedProviderValues +namespace NetTransportValues +{ +/** ip_tcp. */ +static constexpr const char *kIpTcp = "ip_tcp"; +/** ip_udp. */ +static constexpr const char *kIpUdp = "ip_udp"; +/** Named or anonymous pipe. See note below. */ +static constexpr const char *kPipe = "pipe"; +/** In-process communication. */ +static constexpr const char *kInproc = "inproc"; +/** Something else (non IP-based). */ +static constexpr const char *kOther = "other"; +} // namespace NetTransportValues + +namespace NetSockFamilyValues +{ +/** IPv4 address. */ +static constexpr const char *kInet = "inet"; +/** IPv6 address. */ +static constexpr const char *kInet6 = "inet6"; +/** Unix domain socket path. */ +static constexpr const char *kUnix = "unix"; +} // namespace NetSockFamilyValues + +namespace NetHostConnectionTypeValues +{ +/** wifi. */ +static constexpr const char *kWifi = "wifi"; +/** wired. */ +static constexpr const char *kWired = "wired"; +/** cell. */ +static constexpr const char *kCell = "cell"; +/** unavailable. */ +static constexpr const char *kUnavailable = "unavailable"; +/** unknown. */ +static constexpr const char *kUnknown = "unknown"; +} // namespace NetHostConnectionTypeValues + +namespace NetHostConnectionSubtypeValues +{ +/** GPRS. */ +static constexpr const char *kGprs = "gprs"; +/** EDGE. */ +static constexpr const char *kEdge = "edge"; +/** UMTS. */ +static constexpr const char *kUmts = "umts"; +/** CDMA. */ +static constexpr const char *kCdma = "cdma"; +/** EVDO Rel. 0. */ +static constexpr const char *kEvdo0 = "evdo_0"; +/** EVDO Rev. A. */ +static constexpr const char *kEvdoA = "evdo_a"; +/** CDMA2000 1XRTT. */ +static constexpr const char *kCdma20001xrtt = "cdma2000_1xrtt"; +/** HSDPA. */ +static constexpr const char *kHsdpa = "hsdpa"; +/** HSUPA. */ +static constexpr const char *kHsupa = "hsupa"; +/** HSPA. */ +static constexpr const char *kHspa = "hspa"; +/** IDEN. */ +static constexpr const char *kIden = "iden"; +/** EVDO Rev. B. */ +static constexpr const char *kEvdoB = "evdo_b"; +/** LTE. */ +static constexpr const char *kLte = "lte"; +/** EHRPD. */ +static constexpr const char *kEhrpd = "ehrpd"; +/** HSPAP. */ +static constexpr const char *kHspap = "hspap"; +/** GSM. */ +static constexpr const char *kGsm = "gsm"; +/** TD-SCDMA. */ +static constexpr const char *kTdScdma = "td_scdma"; +/** IWLAN. */ +static constexpr const char *kIwlan = "iwlan"; +/** 5G NR (New Radio). */ +static constexpr const char *kNr = "nr"; +/** 5G NRNSA (New Radio Non-Standalone). */ +static constexpr const char *kNrnsa = "nrnsa"; +/** LTE CA. */ +static constexpr const char *kLteCa = "lte_ca"; +} // namespace NetHostConnectionSubtypeValues + +namespace HttpFlavorValues +{ +/** HTTP/1.0. */ +static constexpr const char *kHttp10 = "1.0"; +/** HTTP/1.1. */ +static constexpr const char *kHttp11 = "1.1"; +/** HTTP/2. */ +static constexpr const char *kHttp20 = "2.0"; +/** HTTP/3. */ +static constexpr const char *kHttp30 = "3.0"; +/** SPDY protocol. */ +static constexpr const char *kSpdy = "SPDY"; +/** QUIC protocol. */ +static constexpr const char *kQuic = "QUIC"; +} // namespace HttpFlavorValues + namespace GraphqlOperationTypeValues { /** GraphQL query. */ @@ -874,6 +1362,22 @@ static constexpr const char *kMutation = "mutation"; static constexpr const char *kSubscription = "subscription"; } // namespace GraphqlOperationTypeValues +namespace MessagingDestinationKindValues +{ +/** A message sent to a queue. */ +static constexpr const char *kQueue = "queue"; +/** A message sent to a topic. */ +static constexpr const char *kTopic = "topic"; +} // namespace MessagingDestinationKindValues + +namespace MessagingSourceKindValues +{ +/** A message received from a queue. */ +static constexpr const char *kQueue = "queue"; +/** A message received from a topic. */ +static constexpr const char *kTopic = "topic"; +} // namespace MessagingSourceKindValues + namespace MessagingOperationValues { /** publish. */ @@ -884,6 +1388,26 @@ static constexpr const char *kReceive = "receive"; static constexpr const char *kProcess = "process"; } // namespace MessagingOperationValues +namespace MessagingRocketmqMessageTypeValues +{ +/** Normal message. */ +static constexpr const char *kNormal = "normal"; +/** FIFO message. */ +static constexpr const char *kFifo = "fifo"; +/** Delay message. */ +static constexpr const char *kDelay = "delay"; +/** Transaction message. */ +static constexpr const char *kTransaction = "transaction"; +} // namespace MessagingRocketmqMessageTypeValues + +namespace MessagingRocketmqConsumptionModelValues +{ +/** Clustering consumption model. */ +static constexpr const char *kClustering = "clustering"; +/** Broadcasting consumption model. */ +static constexpr const char *kBroadcasting = "broadcasting"; +} // namespace MessagingRocketmqConsumptionModelValues + namespace RpcSystemValues { /** gRPC. */ @@ -894,8 +1418,6 @@ static constexpr const char *kJavaRmi = "java_rmi"; static constexpr const char *kDotnetWcf = "dotnet_wcf"; /** Apache Dubbo. */ static constexpr const char *kApacheDubbo = "apache_dubbo"; -/** Connect RPC. */ -static constexpr const char *kConnectRpc = "connect_rpc"; } // namespace RpcSystemValues namespace RpcGrpcStatusCodeValues @@ -936,42 +1458,6 @@ static constexpr const int kDataLoss = 15; static constexpr const int kUnauthenticated = 16; } // namespace RpcGrpcStatusCodeValues -namespace RpcConnectRpcErrorCodeValues -{ -/** cancelled. */ -static constexpr const char *kCancelled = "cancelled"; -/** unknown. */ -static constexpr const char *kUnknown = "unknown"; -/** invalid_argument. */ -static constexpr const char *kInvalidArgument = "invalid_argument"; -/** deadline_exceeded. */ -static constexpr const char *kDeadlineExceeded = "deadline_exceeded"; -/** not_found. */ -static constexpr const char *kNotFound = "not_found"; -/** already_exists. */ -static constexpr const char *kAlreadyExists = "already_exists"; -/** permission_denied. */ -static constexpr const char *kPermissionDenied = "permission_denied"; -/** resource_exhausted. */ -static constexpr const char *kResourceExhausted = "resource_exhausted"; -/** failed_precondition. */ -static constexpr const char *kFailedPrecondition = "failed_precondition"; -/** aborted. */ -static constexpr const char *kAborted = "aborted"; -/** out_of_range. */ -static constexpr const char *kOutOfRange = "out_of_range"; -/** unimplemented. */ -static constexpr const char *kUnimplemented = "unimplemented"; -/** internal. */ -static constexpr const char *kInternal = "internal"; -/** unavailable. */ -static constexpr const char *kUnavailable = "unavailable"; -/** data_loss. */ -static constexpr const char *kDataLoss = "data_loss"; -/** unauthenticated. */ -static constexpr const char *kUnauthenticated = "unauthenticated"; -} // namespace RpcConnectRpcErrorCodeValues - } // namespace SemanticConventions } // namespace trace OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 3bae8d0b3b..ee9d3ae1a4 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -15,10 +15,10 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible # repository: https://github.com/open-telemetry/opentelemetry-specification -SEMCONV_VERSION=1.19.0 +SEMCONV_VERSION=1.18.0 # repository: https://github.com/open-telemetry/build-tools -GENERATOR_VERSION=0.17.0 +GENERATOR_VERSION=0.15.1 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 895aa720d3..27aff268cc 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -23,7 +23,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0"; /** * Array of brand name and version separated by a space @@ -62,6 +62,16 @@ static constexpr const char *kBrowserPlatform = "browser.platform"; */ static constexpr const char *kBrowserMobile = "browser.mobile"; +/** + * Full user-agent string provided by the browser + * + *

    Notes: +

    • The user-agent value SHOULD be provided only from browsers that do not have a mechanism + to retrieve brands and platform individually from the User-Agent Client Hints API. To retrieve the + value, the legacy {@code navigator.userAgent} API can be used.
    + */ +static constexpr const char *kBrowserUserAgent = "browser.user_agent"; + /** * Preferred language of the user using the browser * @@ -90,40 +100,10 @@ static constexpr const char *kCloudAccountId = "cloud.account.id"; href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/">AWS regions, Azure regions, Google Cloud regions, or Tencent Cloud regions. - */ -static constexpr const char *kCloudRegion = "cloud.region"; - -/** - * 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) - * - *

    Notes: -

    • On some cloud providers, it may not be possible to determine the full ID at startup, -so it may be necessary to set {@code cloud.resource_id} as a span attribute instead.
    • The -exact value to use for {@code cloud.resource_id} depends on the cloud provider. The following -well-known definitions MUST be used if you set this attribute and they apply:
    • AWS -Lambda: The function ARN. Take care -not to use the "invoked ARN" directly but replace any alias suffix with -the resolved function version, as the same runtime instance may be invokable with multiple different -aliases.
    • GCP: The URI of the resource
    • -
    • Azure: The Fully Qualified -Resource ID of the invoked function, not the function app, having the form -{@code -/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}. -This means that a span attribute MUST be used, as an Azure function app can host multiple functions -that would usually share a TracerProvider.
    • + href="https://intl.cloud.tencent.com/document/product/213/6091">Tencent Cloud regions.
    */ -static constexpr const char *kCloudResourceId = "cloud.resource_id"; +static constexpr const char *kCloudRegion = "cloud.region"; /** * Cloud regions often have multiple, isolated locations known as zones to increase availability. @@ -221,21 +201,6 @@ static constexpr const char *kAwsLogStreamNames = "aws.log.stream.names"; */ static constexpr const char *kAwsLogStreamArns = "aws.log.stream.arns"; -/** - * Time and date the release was created - */ -static constexpr const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; - -/** - * Commit hash for the current release - */ -static constexpr const char *kHerokuReleaseCommit = "heroku.release.commit"; - -/** - * Unique identifier for the application - */ -static constexpr const char *kHerokuAppId = "heroku.app.id"; - /** * Container name used by container runtime. */ @@ -330,11 +295,35 @@ providers/products:
  • Azure: The full name {@code +the {@code faas.id} attribute).
  • */ static constexpr const char *kFaasName = "faas.name"; +/** + * The unique ID of the single function that this runtime instance executes. + * + *

    Notes: +

    • On some cloud providers, it may not be possible to determine the full ID at startup, +so consider setting {@code faas.id} as a span attribute instead.
    • The exact value to use for +{@code faas.id} depends on the cloud provider:
    • AWS Lambda: The function ARN. Take care +not to use the "invoked ARN" directly but replace any alias suffix with +the resolved function version, as the same runtime instance may be invokable with multiple different +aliases.
    • GCP: The URI of the resource
    • +
    • Azure: The Fully Qualified +Resource ID of the invoked function, not the function app, having the form +{@code +/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}. +This means that a span attribute MUST be used, as an Azure function app can host multiple functions +that would usually share a TracerProvider.
    • +
    + */ +static constexpr const char *kFaasId = "faas.id"; + /** * The immutable version of the function being executed. * @@ -363,20 +352,19 @@ static constexpr const char *kFaasVersion = "faas.version"; static constexpr const char *kFaasInstance = "faas.instance"; /** - * The amount of memory available to the serverless function converted to Bytes. + * The amount of memory available to the serverless function in MiB. * *

    Notes:

    • It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable {@code - AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information (which must be multiplied by - 1,048,576).
    + AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information. */ static constexpr const char *kFaasMaxMemory = "faas.max_memory"; /** * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For - * non-containerized systems, this should be the {@code machine-id}. See the table below for the - * sources to use to determine the {@code machine-id} based on operating system. + * non-containerized Linux systems, the {@code machine-id} located in {@code /etc/machine-id} or + * {@code /var/lib/dbus/machine-id} may be used. */ static constexpr const char *kHostId = "host.id"; @@ -715,8 +703,6 @@ static constexpr const char *kAws = "aws"; static constexpr const char *kAzure = "azure"; /** Google Cloud Platform. */ static constexpr const char *kGcp = "gcp"; -/** Heroku Platform as a Service. */ -static constexpr const char *kHeroku = "heroku"; /** IBM Cloud. */ static constexpr const char *kIbmCloud = "ibm_cloud"; /** Tencent Cloud. */ From beb9bb50aab3c5d42e46ba86d736584297f1e505 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 22 Mar 2023 01:13:00 +0100 Subject: [PATCH 4/4] Upgraded build tools to 0.18.0 --- .../trace/semantic_conventions.h | 241 +++++++++++++----- buildscripts/semantic-convention/generate.sh | 6 +- .../sdk/resource/semantic_conventions.h | 98 ++++--- 3 files changed, 238 insertions(+), 107 deletions(-) diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index d0485704ef..051d865f86 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -21,7 +21,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; /** * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of @@ -40,6 +40,38 @@ static constexpr const char *kExceptionMessage = "exception.message"; */ static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; +/** + * HTTP request method. + */ +static constexpr const char *kHttpMethod = "http.method"; + +/** + * HTTP response status code. + */ +static constexpr const char *kHttpStatusCode = "http.status_code"; + +/** + * Kind of HTTP protocol used. + */ +static constexpr const char *kHttpFlavor = "http.flavor"; + +/** + * The URI scheme identifying the used protocol. + */ +static constexpr const char *kHttpScheme = "http.scheme"; + +/** + * The matched route (path template in the format used by the respective server framework). See note +below + * + *

    Notes: +

    • MUST NOT be populated when this is not supported by the HTTP server framework as the +route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include +the application +root if there is one.
    + */ +static constexpr const char *kHttpRoute = "http.route"; + /** * The name identifies the event. */ @@ -59,7 +91,7 @@ static constexpr const char *kEventDomain = "event.domain"; Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable). * *

    Notes: -

    • This may be different from {@code faas.id} if an alias is involved.
    +
    • This may be different from {@code cloud.resource_id} if an alias is involved.
    */ static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; @@ -255,7 +287,7 @@ static constexpr const char *kOtelStatusCode = "otel.status_code"; static constexpr const char *kOtelStatusDescription = "otel.status_description"; /** - * Type of the trigger which caused this function execution. + * Type of the trigger which caused this function invocation. * *

    Notes:

    • For the server/consumer span on the incoming side, @@ -268,9 +300,9 @@ lambda, which is often HTTP).
    static constexpr const char *kFaasTrigger = "faas.trigger"; /** - * The execution ID of the current function execution. + * The invocation ID of the current function invocation. */ -static constexpr const char *kFaasExecution = "faas.execution"; +static constexpr const char *kFaasInvocationId = "faas.invocation_id"; /** * The name of the source on which the triggering operation was performed. For example, in Cloud @@ -343,6 +375,30 @@ static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider"; */ static constexpr const char *kFaasInvokedRegion = "faas.invoked_region"; +/** + * The unique identifier of the feature flag. + */ +static constexpr const char *kFeatureFlagKey = "feature_flag.key"; + +/** + * The name of the service provider that performs the flag evaluation. + */ +static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider_name"; + +/** + * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the +value can be used. + * + *

    Notes: +

    • A semantic identifier, commonly referred to as a variant, provides a means +for referring to a value without including the value itself. This can +provide additional context for understanding the meaning behind a value. +For example, the variant {@code red} maybe be used for the value {@code #c05543}.
    • A +stringified version of the value can be used in situations where a semantic identifier is +unavailable. String representation of the value should be determined by the implementer.
    + */ +static constexpr const char *kFeatureFlagVariant = "feature_flag.variant"; + /** * Transport protocol used. See note below. */ @@ -521,31 +577,6 @@ static constexpr const char *kCodeLineno = "code.lineno"; */ static constexpr const char *kCodeColumn = "code.column"; -/** - * HTTP request method. - */ -static constexpr const char *kHttpMethod = "http.method"; - -/** - * HTTP response status code. - */ -static constexpr const char *kHttpStatusCode = "http.status_code"; - -/** - * Kind of HTTP protocol used. - * - *

    Notes: -

    • If {@code net.transport} is not specified, it can be assumed to be {@code IP.TCP} except - if {@code http.flavor} is {@code QUIC}, in which case {@code IP.UDP} is assumed.
    - */ -static constexpr const char *kHttpFlavor = "http.flavor"; - -/** - * Value of the HTTP - * User-Agent header sent by the client. - */ -static constexpr const char *kHttpUserAgent = "http.user_agent"; - /** * 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 Notes: - - */ -static constexpr const char *kHttpRoute = "http.route"; - /** * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). @@ -1054,7 +1069,79 @@ static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; */ static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; +/** + * Whether this is a received or sent message. + */ +static constexpr const char *kMessageType = "message.type"; + +/** + * MUST be calculated as two different counters starting from {@code 1} one for sent messages and + one for received message. + * + *

    Notes: +

    • This way we guarantee that the values will be consistent between different + implementations.
    + */ +static constexpr const char *kMessageId = "message.id"; + +/** + * Compressed size of the message in bytes. + */ +static constexpr const char *kMessageCompressedSize = "message.compressed_size"; + +/** + * Uncompressed size of the message in bytes. + */ +static constexpr const char *kMessageUncompressedSize = "message.uncompressed_size"; + +/** + * The error codes of the Connect + * request. Error codes are always string values. + */ +static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; + +/** + * 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. + * + *

    Notes: +

    • An exception is considered to have escaped (or left) the scope of a span, +if that span is ended while the exception is still logically "in flight". +This may be actually "in flight" in some languages (e.g. if the exception +is passed to a Context manager's {@code __exit__} method in Python) but will +usually be caught at the point of recording the exception in most languages.
    • It is usually +not possible to determine at the point where an exception is thrown whether it will escape the scope +of a span. However, it is trivial to know that an exception will escape, if one checks for an active +exception just before ending the span, as done in the example +above.
    • It follows that an exception may still escape the scope of the span even if the +{@code exception.escaped} attribute was not set or set to false, since the event might have been +recorded at a time where it was not clear whether the exception will escape.
    + */ +static constexpr const char *kExceptionEscaped = "exception.escaped"; + +/** + * Value of the HTTP + * User-Agent header sent by the client. + */ +static constexpr const char *kUserAgentOriginal = "user_agent.original"; + // Enum definitions +namespace HttpFlavorValues +{ +/** HTTP/1.0. */ +static constexpr const char *kHttp10 = "1.0"; +/** HTTP/1.1. */ +static constexpr const char *kHttp11 = "1.1"; +/** HTTP/2. */ +static constexpr const char *kHttp20 = "2.0"; +/** HTTP/3. */ +static constexpr const char *kHttp30 = "3.0"; +/** SPDY protocol. */ +static constexpr const char *kSpdy = "SPDY"; +/** QUIC protocol. */ +static constexpr const char *kQuic = "QUIC"; +} // namespace HttpFlavorValues + namespace EventDomainValues { /** Events from browser apps. */ @@ -1336,22 +1423,6 @@ static constexpr const char *kNrnsa = "nrnsa"; static constexpr const char *kLteCa = "lte_ca"; } // namespace NetHostConnectionSubtypeValues -namespace HttpFlavorValues -{ -/** HTTP/1.0. */ -static constexpr const char *kHttp10 = "1.0"; -/** HTTP/1.1. */ -static constexpr const char *kHttp11 = "1.1"; -/** HTTP/2. */ -static constexpr const char *kHttp20 = "2.0"; -/** HTTP/3. */ -static constexpr const char *kHttp30 = "3.0"; -/** SPDY protocol. */ -static constexpr const char *kSpdy = "SPDY"; -/** QUIC protocol. */ -static constexpr const char *kQuic = "QUIC"; -} // namespace HttpFlavorValues - namespace GraphqlOperationTypeValues { /** GraphQL query. */ @@ -1418,6 +1489,8 @@ static constexpr const char *kJavaRmi = "java_rmi"; static constexpr const char *kDotnetWcf = "dotnet_wcf"; /** Apache Dubbo. */ static constexpr const char *kApacheDubbo = "apache_dubbo"; +/** Connect RPC. */ +static constexpr const char *kConnectRpc = "connect_rpc"; } // namespace RpcSystemValues namespace RpcGrpcStatusCodeValues @@ -1458,6 +1531,50 @@ static constexpr const int kDataLoss = 15; static constexpr const int kUnauthenticated = 16; } // namespace RpcGrpcStatusCodeValues +namespace MessageTypeValues +{ +/** sent. */ +static constexpr const char *kSent = "SENT"; +/** received. */ +static constexpr const char *kReceived = "RECEIVED"; +} // namespace MessageTypeValues + +namespace RpcConnectRpcErrorCodeValues +{ +/** cancelled. */ +static constexpr const char *kCancelled = "cancelled"; +/** unknown. */ +static constexpr const char *kUnknown = "unknown"; +/** invalid_argument. */ +static constexpr const char *kInvalidArgument = "invalid_argument"; +/** deadline_exceeded. */ +static constexpr const char *kDeadlineExceeded = "deadline_exceeded"; +/** not_found. */ +static constexpr const char *kNotFound = "not_found"; +/** already_exists. */ +static constexpr const char *kAlreadyExists = "already_exists"; +/** permission_denied. */ +static constexpr const char *kPermissionDenied = "permission_denied"; +/** resource_exhausted. */ +static constexpr const char *kResourceExhausted = "resource_exhausted"; +/** failed_precondition. */ +static constexpr const char *kFailedPrecondition = "failed_precondition"; +/** aborted. */ +static constexpr const char *kAborted = "aborted"; +/** out_of_range. */ +static constexpr const char *kOutOfRange = "out_of_range"; +/** unimplemented. */ +static constexpr const char *kUnimplemented = "unimplemented"; +/** internal. */ +static constexpr const char *kInternal = "internal"; +/** unavailable. */ +static constexpr const char *kUnavailable = "unavailable"; +/** data_loss. */ +static constexpr const char *kDataLoss = "data_loss"; +/** unauthenticated. */ +static constexpr const char *kUnauthenticated = "unauthenticated"; +} // namespace RpcConnectRpcErrorCodeValues + } // namespace SemanticConventions } // namespace trace OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index ee9d3ae1a4..22f556c486 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -15,10 +15,10 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible # repository: https://github.com/open-telemetry/opentelemetry-specification -SEMCONV_VERSION=1.18.0 +SEMCONV_VERSION=1.19.0 # repository: https://github.com/open-telemetry/build-tools -GENERATOR_VERSION=0.15.1 +GENERATOR_VERSION=0.18.0 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION @@ -46,7 +46,7 @@ docker run --rm \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output \ otel/semconvgen:$GENERATOR_VERSION \ - --only span \ + --only span,event,attribute_group,scope \ -f /source code \ --template /templates/SemanticAttributes.h.j2 \ --output /output/semantic_conventions.h \ diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 27aff268cc..895aa720d3 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -23,7 +23,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; /** * Array of brand name and version separated by a space @@ -62,16 +62,6 @@ static constexpr const char *kBrowserPlatform = "browser.platform"; */ static constexpr const char *kBrowserMobile = "browser.mobile"; -/** - * Full user-agent string provided by the browser - * - *

    Notes: -

    • The user-agent value SHOULD be provided only from browsers that do not have a mechanism - to retrieve brands and platform individually from the User-Agent Client Hints API. To retrieve the - value, the legacy {@code navigator.userAgent} API can be used.
    - */ -static constexpr const char *kBrowserUserAgent = "browser.user_agent"; - /** * Preferred language of the user using the browser * @@ -100,11 +90,41 @@ static constexpr const char *kCloudAccountId = "cloud.account.id"; href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/">AWS regions, Azure regions, Google Cloud regions, or Tencent Cloud regions. - + href="https://www.tencentcloud.com/document/product/213/6091">Tencent Cloud regions. */ static constexpr const char *kCloudRegion = "cloud.region"; +/** + * 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) + * + *

    Notes: +

    • On some cloud providers, it may not be possible to determine the full ID at startup, +so it may be necessary to set {@code cloud.resource_id} as a span attribute instead.
    • The +exact value to use for {@code cloud.resource_id} depends on the cloud provider. The following +well-known definitions MUST be used if you set this attribute and they apply:
    • AWS +Lambda: The function ARN. Take care +not to use the "invoked ARN" directly but replace any alias suffix with +the resolved function version, as the same runtime instance may be invokable with multiple different +aliases.
    • GCP: The URI of the resource
    • +
    • Azure: The Fully Qualified +Resource ID of the invoked function, not the function app, having the form +{@code +/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}. +This means that a span attribute MUST be used, as an Azure function app can host multiple functions +that would usually share a TracerProvider.
    • +
    + */ +static constexpr const char *kCloudResourceId = "cloud.resource_id"; + /** * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. @@ -201,6 +221,21 @@ static constexpr const char *kAwsLogStreamNames = "aws.log.stream.names"; */ static constexpr const char *kAwsLogStreamArns = "aws.log.stream.arns"; +/** + * Time and date the release was created + */ +static constexpr const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; + +/** + * Commit hash for the current release + */ +static constexpr const char *kHerokuReleaseCommit = "heroku.release.commit"; + +/** + * Unique identifier for the application + */ +static constexpr const char *kHerokuAppId = "heroku.app.id"; + /** * Container name used by container runtime. */ @@ -295,35 +330,11 @@ providers/products:
  • Azure: The full name {@code +the {@code cloud.resource_id} attribute).
  • */ static constexpr const char *kFaasName = "faas.name"; -/** - * The unique ID of the single function that this runtime instance executes. - * - *

    Notes: -

    • On some cloud providers, it may not be possible to determine the full ID at startup, -so consider setting {@code faas.id} as a span attribute instead.
    • The exact value to use for -{@code faas.id} depends on the cloud provider:
    • AWS Lambda: The function ARN. Take care -not to use the "invoked ARN" directly but replace any alias suffix with -the resolved function version, as the same runtime instance may be invokable with multiple different -aliases.
    • GCP: The URI of the resource
    • -
    • Azure: The Fully Qualified -Resource ID of the invoked function, not the function app, having the form -{@code -/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}. -This means that a span attribute MUST be used, as an Azure function app can host multiple functions -that would usually share a TracerProvider.
    • -
    - */ -static constexpr const char *kFaasId = "faas.id"; - /** * The immutable version of the function being executed. * @@ -352,19 +363,20 @@ static constexpr const char *kFaasVersion = "faas.version"; static constexpr const char *kFaasInstance = "faas.instance"; /** - * The amount of memory available to the serverless function in MiB. + * The amount of memory available to the serverless function converted to Bytes. * *

    Notes:

    • It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable {@code - AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information.
    + AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information (which must be multiplied by + 1,048,576). */ static constexpr const char *kFaasMaxMemory = "faas.max_memory"; /** * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For - * non-containerized Linux systems, the {@code machine-id} located in {@code /etc/machine-id} or - * {@code /var/lib/dbus/machine-id} may be used. + * non-containerized systems, this should be the {@code machine-id}. See the table below for the + * sources to use to determine the {@code machine-id} based on operating system. */ static constexpr const char *kHostId = "host.id"; @@ -703,6 +715,8 @@ static constexpr const char *kAws = "aws"; static constexpr const char *kAzure = "azure"; /** Google Cloud Platform. */ static constexpr const char *kGcp = "gcp"; +/** Heroku Platform as a Service. */ +static constexpr const char *kHeroku = "heroku"; /** IBM Cloud. */ static constexpr const char *kIbmCloud = "ibm_cloud"; /** Tencent Cloud. */