diff --git a/CHANGELOG.md b/CHANGELOG.md index 77e5579688..feb6406148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2964](https://github.com/open-telemetry/opentelemetry-python/pull/2964)) - Add OpenCensus trace bridge/shim ([#3210](https://github.com/open-telemetry/opentelemetry-python/pull/3210)) +- Update to semantic conventions v1.19.0 + ([#3233](https://github.com/open-telemetry/opentelemetry-python/pull/3233)) ## Version 1.16.0/0.37b0 (2023-02-17) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 028fedd6df..c489b3066e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -16,6 +16,37 @@ class ResourceAttributes: + BROWSER_BRANDS = "browser.brands" + """ + Array of brand name and version separated by a space. + Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). + """ + + BROWSER_PLATFORM = "browser.platform" + """ + The platform on which the browser is running. + Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. +The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. + """ + + BROWSER_MOBILE = "browser.mobile" + """ + A boolean that is true if the browser is running on a mobile device. + Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. + """ + + BROWSER_LANGUAGE = "browser.language" + """ + Preferred language of the user using the browser. + Note: This value is intended to be taken from the Navigator API `navigator.language`. + """ + + USER_AGENT_ORIGINAL = "user_agent.original" + """ + Full user-agent string provided by the browser. + Note: 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 `navigator.userAgent` API can be used. + """ + CLOUD_PROVIDER = "cloud.provider" """ Name of the cloud provider. @@ -29,7 +60,29 @@ class ResourceAttributes: CLOUD_REGION = "cloud.region" """ The geographical region the resource is running. - Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://intl.cloud.tencent.com/document/product/213/6091). + Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). + """ + + CLOUD_RESOURCE_ID = "cloud.resource_id" + """ + Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). + Note: On some cloud providers, it may not be possible to determine the full ID at startup, +so it may be necessary to set `cloud.resource_id` as a span attribute instead. + +The exact value to use for `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](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + Take care not to use the "invoked ARN" directly but replace any + [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + with the resolved function version, as the same runtime instance may be invokable with + multiple different aliases. +* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) +* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function, + *not* the function app, having the form + `/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. """ CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" @@ -102,6 +155,21 @@ class ResourceAttributes: Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. """ + HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" + """ + Time and date the release was created. + """ + + HEROKU_RELEASE_COMMIT = "heroku.release.commit" + """ + Commit hash for the current release. + """ + + HEROKU_APP_ID = "heroku.app.id" + """ + Unique identifier for the application. + """ + CONTAINER_NAME = "container.name" """ Container name used by container runtime. @@ -159,26 +227,22 @@ class ResourceAttributes: FAAS_NAME = "faas.name" """ The name of the single function that this runtime instance executes. - Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). - """ - - FAAS_ID = "faas.id" - """ - The unique ID of the single function that this runtime instance executes. - Note: Depending on the cloud provider, use: + Note: This is the name of the function as configured/deployed on the FaaS +platform and is usually different from the name of the callback +function (which may be stored in the +[`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) +span attributes). -* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). -Take care not to use the "invoked ARN" directly but replace any -[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invocable with multiple -different aliases. -* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) -* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). +For some cloud providers, the above definition is ambiguous. The following +definition of function name MUST be used for this attribute +(and consequently the span name) for the listed cloud providers/products: -On some providers, it may not be possible to determine the full ID at startup, -which is why this field cannot be made required. For example, on AWS the account ID -part of the ARN is not available without calling another AWS API -which may be deemed too slow for a short-running lambda function. -As an alternative, consider setting `faas.id` as a span attribute instead. +* **Azure:** The full name `/`, i.e., function app name + followed by a forward slash followed by the function name (this form + can also be seen in the resource JSON for the function). + This means that a span attribute MUST be used, as an Azure function + app can host multiple functions that would usually share + a TracerProvider (see also the `cloud.resource_id` attribute). """ FAAS_VERSION = "faas.version" @@ -203,13 +267,13 @@ class ResourceAttributes: FAAS_MAX_MEMORY = "faas.max_memory" """ - The amount of memory available to the serverless function in MiB. - Note: 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 `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. + The amount of memory available to the serverless function converted to Bytes. + Note: 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 `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). """ HOST_ID = "host.id" """ - Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. + 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 the `machine-id` based on operating system. """ HOST_NAME = "host.name" @@ -367,6 +431,11 @@ class ResourceAttributes: Process identifier (PID). """ + PROCESS_PARENT_PID = "process.parent_pid" + """ + Parent Process identifier (PID). + """ + PROCESS_EXECUTABLE_NAME = "process.executable.name" """ The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. @@ -470,6 +539,26 @@ class ResourceAttributes: Additional description of the web engine (e.g. detailed version and edition information). """ + OTEL_SCOPE_NAME = "otel.scope.name" + """ + The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). + """ + + OTEL_SCOPE_VERSION = "otel.scope.version" + """ + The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + """ + + OTEL_LIBRARY_NAME = "otel.library.name" + """ + Deprecated, use the `otel.scope.name` attribute. + """ + + OTEL_LIBRARY_VERSION = "otel.library.version" + """ + Deprecated, use the `otel.scope.version` attribute. + """ + class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" @@ -484,6 +573,12 @@ class CloudProviderValues(Enum): GCP = "gcp" """Google Cloud Platform.""" + HEROKU = "heroku" + """Heroku Platform as a Service.""" + + IBM_CLOUD = "ibm_cloud" + """IBM Cloud.""" + TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" @@ -495,6 +590,9 @@ class CloudPlatformValues(Enum): ALIBABA_CLOUD_FC = "alibaba_cloud_fc" """Alibaba Cloud Function Compute.""" + ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" + """Red Hat OpenShift on Alibaba Cloud.""" + AWS_EC2 = "aws_ec2" """AWS Elastic Compute Cloud.""" @@ -513,6 +611,9 @@ class CloudPlatformValues(Enum): AWS_APP_RUNNER = "aws_app_runner" """AWS App Runner.""" + AWS_OPENSHIFT = "aws_openshift" + """Red Hat OpenShift on AWS (ROSA).""" + AZURE_VM = "azure_vm" """Azure Virtual Machines.""" @@ -528,6 +629,9 @@ class CloudPlatformValues(Enum): AZURE_APP_SERVICE = "azure_app_service" """Azure App Service.""" + AZURE_OPENSHIFT = "azure_openshift" + """Azure Red Hat OpenShift.""" + GCP_COMPUTE_ENGINE = "gcp_compute_engine" """Google Cloud Compute Engine (GCE).""" @@ -543,6 +647,12 @@ class CloudPlatformValues(Enum): GCP_APP_ENGINE = "gcp_app_engine" """Google Cloud App Engine (GAE).""" + GCP_OPENSHIFT = "gcp_openshift" + """Red Hat OpenShift on Google Cloud.""" + + IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" + """Red Hat OpenShift on IBM Cloud.""" + TENCENT_CLOUD_CVM = "tencent_cloud_cvm" """Tencent Cloud Cloud Virtual Machine (CVM).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index 36bab3d1a1..64f0835311 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -12,16 +12,134 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pylint: disable=too-many-lines - from enum import Enum class SpanAttributes: + EXCEPTION_TYPE = "exception.type" + """ + The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. + """ + + EXCEPTION_MESSAGE = "exception.message" + """ + The exception message. + """ + + EXCEPTION_STACKTRACE = "exception.stacktrace" + """ + A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. + """ + + HTTP_METHOD = "http.method" + """ + HTTP request method. + """ + + HTTP_STATUS_CODE = "http.status_code" + """ + [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + """ + + HTTP_FLAVOR = "http.flavor" + """ + Kind of HTTP protocol used. + """ + + NET_PEER_NAME = "net.peer.name" + """ + Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. + Note: Determined by using the first of the following that applies + +- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) + if it's sent in absolute-form +- Host identifier of the `Host` header + +SHOULD NOT be set if capturing it would require an extra DNS lookup. + """ + + NET_PEER_PORT = "net.peer.port" + """ + Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. + Note: When [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) is absolute URI, `net.peer.name` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier. + """ + + HTTP_SCHEME = "http.scheme" + """ + The URI scheme identifying the used protocol. + """ + + HTTP_ROUTE = "http.route" + """ + The matched route (path template in the format used by the respective server framework). See note below. + Note: 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](/specification/trace/semantic_conventions/http.md#http-server-definitions) if there is one. + """ + + NET_HOST_NAME = "net.host.name" + """ + Name of the local HTTP server that received the request. + Note: Determined by using the first of the following that applies + +- The [primary server name](/specification/trace/semantic_conventions/http.md#http-server-definitions) of the matched virtual host. MUST only + include host identifier. +- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) + if it's sent in absolute-form. +- Host identifier of the `Host` header + +SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. + """ + + NET_HOST_PORT = "net.host.port" + """ + Port of the local HTTP server that received the request. + Note: Determined by using the first of the following that applies + +- Port identifier of the [primary server host](/specification/trace/semantic_conventions/http.md#http-server-definitions) of the matched virtual host. +- Port identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) + if it's sent in absolute-form. +- Port identifier of the `Host` header. + """ + + EVENT_NAME = "event.name" + """ + The name identifies the event. + """ + + EVENT_DOMAIN = "event.domain" + """ + The domain identifies the business context for the events. + Note: Events across different domains may have same `event.name`, yet be +unrelated events. + """ + + FEATURE_FLAG_KEY = "feature_flag.key" + """ + The unique identifier of the feature flag. + """ + + FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" + """ + The name of the service provider that performs the flag evaluation. + """ + + FEATURE_FLAG_VARIANT = "feature_flag.variant" + """ + SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. + Note: 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 `red` maybe be used for the value `#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. + """ + AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" """ The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - Note: This may be different from `faas.id` if an alias is involved. + Note: This may be different from `cloud.resource_id` if an alias is involved. """ CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" @@ -93,20 +211,24 @@ class SpanAttributes: Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. """ - NET_PEER_NAME = "net.peer.name" + NET_SOCK_PEER_ADDR = "net.sock.peer.addr" """ - Remote hostname or similar, see note below. - Note: `net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup. + Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). """ - NET_PEER_IP = "net.peer.ip" + NET_SOCK_PEER_PORT = "net.sock.peer.port" """ - Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). + Remote socket peer port. """ - NET_PEER_PORT = "net.peer.port" + NET_SOCK_FAMILY = "net.sock.family" + """ + Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. + """ + + NET_SOCK_PEER_NAME = "net.sock.peer.name" """ - Remote port number. + Remote socket peer name. """ NET_TRANSPORT = "net.transport" @@ -174,45 +296,19 @@ class SpanAttributes: Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ - EXCEPTION_TYPE = "exception.type" - """ - The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. - """ - - EXCEPTION_MESSAGE = "exception.message" - """ - The exception message. + OTEL_STATUS_CODE = "otel.status_code" """ - - EXCEPTION_STACKTRACE = "exception.stacktrace" - """ - A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. + Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ - EXCEPTION_ESCAPED = "exception.escaped" + OTEL_STATUS_DESCRIPTION = "otel.status_description" """ - 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. - Note: 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 `__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](#recording-an-exception). - -It follows that an exception may still escape the scope of the span -even if the `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. + Description of the Status if it has a value, otherwise not set. """ FAAS_TRIGGER = "faas.trigger" """ - Type of the trigger which caused this function execution. + Type of the trigger which caused this function invocation. Note: For the server/consumer span on the incoming side, `faas.trigger` MUST be set. @@ -224,9 +320,31 @@ class SpanAttributes: call to invoke the lambda, which is often HTTP). """ - FAAS_EXECUTION = "faas.execution" + FAAS_INVOCATION_ID = "faas.invocation_id" + """ + The invocation ID of the current function invocation. """ - The execution ID of the current function execution. + + CLOUD_RESOURCE_ID = "cloud.resource_id" + """ + Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). + Note: On some cloud providers, it may not be possible to determine the full ID at startup, +so it may be necessary to set `cloud.resource_id` as a span attribute instead. + +The exact value to use for `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](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + Take care not to use the "invoked ARN" directly but replace any + [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + with the resolved function version, as the same runtime instance may be invokable with + multiple different aliases. +* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) +* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function, + *not* the function app, having the form + `/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. """ FAAS_DOCUMENT_COLLECTION = "faas.document.collection" @@ -249,118 +367,87 @@ class SpanAttributes: 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. """ - HTTP_METHOD = "http.method" - """ - HTTP request method. - """ - - HTTP_URL = "http.url" - """ - Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. - Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. - """ - HTTP_TARGET = "http.target" """ The full request target as passed in a HTTP request line or equivalent. """ - HTTP_HOST = "http.host" - """ - The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. - Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. - """ - - HTTP_SCHEME = "http.scheme" - """ - The URI scheme identifying the used protocol. - """ - - HTTP_STATUS_CODE = "http.status_code" - """ - [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - """ - - HTTP_FLAVOR = "http.flavor" - """ - Kind of HTTP protocol used. - Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + HTTP_CLIENT_IP = "http.client_ip" """ + The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). + Note: This is not necessarily the same as `net.sock.peer.addr`, which would +identify the network-level peer, which may be a proxy. - HTTP_USER_AGENT = "http.user_agent" - """ - Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. +This attribute should be set when a source of information different +from the one used for `net.sock.peer.addr`, is available even if that other +source just confirms the same value as `net.sock.peer.addr`. +Rationale: For `net.sock.peer.addr`, one typically does not know if it +comes from a proxy, reverse proxy, or the actual client. Setting +`http.client_ip` when it's the same as `net.sock.peer.addr` means that +one is at least somewhat confident that the address is not that of +the closest proxy. """ - HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" + NET_SOCK_HOST_ADDR = "net.sock.host.addr" """ - 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](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + Local socket address. Useful in case of a multi-IP host. """ - HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = ( - "http.request_content_length_uncompressed" - ) + NET_SOCK_HOST_PORT = "net.sock.host.port" """ - The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. + Local socket port number. """ - HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" + MESSAGING_SYSTEM = "messaging.system" """ - 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](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + A string identifying the messaging system. """ - HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = ( - "http.response_content_length_uncompressed" - ) + MESSAGING_OPERATION = "messaging.operation" """ - The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. + A string identifying the kind of messaging operation as defined in the [Operation names](#operation-names) section above. + Note: If a custom value is used, it MUST be of low cardinality. """ - HTTP_RETRY_COUNT = "http.retry_count" + MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" """ - The ordinal number of request re-sending attempt. + The number of messages sent, received, or processed in the scope of the batching operation. + Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. """ - HTTP_SERVER_NAME = "http.server_name" + MESSAGING_MESSAGE_ID = "messaging.message.id" """ - The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). - Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. + A value used by the messaging system as an identifier for the message, represented as a string. """ - HTTP_ROUTE = "http.route" + MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" """ - The matched route (path template). + The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - HTTP_CLIENT_IP = "http.client_ip" + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = ( + "messaging.message.payload_size_bytes" + ) """ - The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). - Note: This is not necessarily the same as `net.peer.ip`, which would -identify the network-level peer, which may be a proxy. - -This attribute should be set when a source of information different -from the one used for `net.peer.ip`, is available even if that other -source just confirms the same value as `net.peer.ip`. -Rationale: For `net.peer.ip`, one typically does not know if it -comes from a proxy, reverse proxy, or the actual client. Setting -`http.client_ip` when it's the same as `net.peer.ip` means that -one is at least somewhat confident that the address is not that of -the closest proxy. + 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. """ - NET_HOST_IP = "net.host.ip" + MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = ( + "messaging.message.payload_compressed_size_bytes" + ) """ - Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. + The compressed size of the message payload in bytes. """ - NET_HOST_PORT = "net.host.port" + NET_APP_PROTOCOL_NAME = "net.app.protocol.name" """ - Like `net.peer.port` but for the host port. + Application layer protocol used. The value SHOULD be normalized to lowercase. """ - NET_HOST_NAME = "net.host.name" + NET_APP_PROTOCOL_VERSION = "net.app.protocol.version" """ - Local hostname or similar, see note below. + Version of the application layer protocol used. See note below. + Note: `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 `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. """ NET_HOST_CONNECTION_TYPE = "net.host.connection.type" @@ -393,65 +480,6 @@ class SpanAttributes: The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ - MESSAGING_SYSTEM = "messaging.system" - """ - A string identifying the messaging system. - """ - - MESSAGING_DESTINATION = "messaging.destination" - """ - The message destination name. This might be equal to the span name but is required nevertheless. - """ - - MESSAGING_DESTINATION_KIND = "messaging.destination_kind" - """ - The kind of message destination. - """ - - MESSAGING_TEMP_DESTINATION = "messaging.temp_destination" - """ - A boolean that is true if the message destination is temporary. - """ - - MESSAGING_PROTOCOL = "messaging.protocol" - """ - The name of the transport protocol. - """ - - MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version" - """ - The version of the transport protocol. - """ - - MESSAGING_URL = "messaging.url" - """ - Connection string. - """ - - MESSAGING_MESSAGE_ID = "messaging.message_id" - """ - A value used by the messaging system as an identifier for the message, represented as a string. - """ - - MESSAGING_CONVERSATION_ID = "messaging.conversation_id" - """ - The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - """ - - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = ( - "messaging.message_payload_size_bytes" - ) - """ - 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. - """ - - MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = ( - "messaging.message_payload_compressed_size_bytes" - ) - """ - The compressed size of the message payload in bytes. - """ - FAAS_TIME = "faas.time" """ A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). @@ -535,6 +563,38 @@ class SpanAttributes: The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ + CODE_COLUMN = "code.column" + """ + The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + """ + + HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" + """ + 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](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + """ + + HTTP_RESPONSE_CONTENT_LENGTH = "http.response_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](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + """ + + USER_AGENT_ORIGINAL = "user_agent.original" + """ + Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. + """ + + HTTP_URL = "http.url" + """ + Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. + Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. + """ + + HTTP_RESEND_COUNT = "http.resend_count" + """ + The ordinal number of request resending attempt (for any reason, including redirects). + Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). + """ + RPC_SYSTEM = "rpc.system" """ The value `aws-api`. @@ -674,28 +734,97 @@ class SpanAttributes: The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. """ - MESSAGING_OPERATION = "messaging.operation" + GRAPHQL_OPERATION_NAME = "graphql.operation.name" """ - A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + The name of the operation being executed. """ - MESSAGING_CONSUMER_ID = "messaging.consumer_id" + GRAPHQL_OPERATION_TYPE = "graphql.operation.type" """ - The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. + The type of the operation being executed. """ - MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key" + GRAPHQL_DOCUMENT = "graphql.document" + """ + The GraphQL document being executed. + Note: The value may be sanitized to exclude sensitive information. + """ + + MESSAGING_DESTINATION_NAME = "messaging.destination.name" + """ + The message destination name. + Note: 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. + """ + + MESSAGING_SOURCE_NAME = "messaging.source.name" + """ + The message source name. + Note: 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. + """ + + MESSAGING_DESTINATION_KIND = "messaging.destination.kind" + """ + The kind of message destination. + """ + + MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" + """ + Low cardinality representation of the messaging destination name. + Note: 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. + """ + + MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" + """ + A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. + """ + + MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" + """ + A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). + """ + + MESSAGING_SOURCE_KIND = "messaging.source.kind" + """ + The kind of message source. + """ + + MESSAGING_SOURCE_TEMPLATE = "messaging.source.template" + """ + Low cardinality representation of the messaging source name. + Note: 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. + """ + + MESSAGING_SOURCE_TEMPORARY = "messaging.source.temporary" + """ + A boolean that is true if the message source is temporary and might not exist anymore after messages are processed. + """ + + MESSAGING_SOURCE_ANONYMOUS = "messaging.source.anonymous" + """ + A boolean that is true if the message source is anonymous (could be unnamed or have auto-generated name). + """ + + MESSAGING_CONSUMER_ID = "messaging.consumer.id" + """ + The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer.group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. + """ + + MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( + "messaging.rabbitmq.destination.routing_key" + ) """ RabbitMQ message routing key. """ - MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message_key" + MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" """ - 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 is `null`, the attribute MUST NOT be set. + 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 is `null`, the attribute MUST NOT be set. Note: 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. """ - MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer_group" + MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" """ Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ @@ -705,12 +834,24 @@ class SpanAttributes: Client Id for the Consumer or Producer that is handling the message. """ - MESSAGING_KAFKA_PARTITION = "messaging.kafka.partition" + MESSAGING_KAFKA_DESTINATION_PARTITION = ( + "messaging.kafka.destination.partition" + ) """ Partition the message is sent to. """ - MESSAGING_KAFKA_TOMBSTONE = "messaging.kafka.tombstone" + MESSAGING_KAFKA_SOURCE_PARTITION = "messaging.kafka.source.partition" + """ + Partition the message is received from. + """ + + MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" + """ + The offset of a record in the corresponding Kafka partition. + """ + + MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" """ A boolean that is true if the message is a tombstone. """ @@ -730,17 +871,36 @@ class SpanAttributes: The unique identifier for each client. """ - MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message_type" + MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( + "messaging.rocketmq.message.delivery_timestamp" + ) + """ + The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + """ + + MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( + "messaging.rocketmq.message.delay_time_level" + ) + """ + The delay time level for delay message, which determines the message delay time. + """ + + MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" + """ + 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. + """ + + MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" """ Type of message. """ - MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message_tag" + MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" """ The secondary classifier of message besides topic. """ - MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message_keys" + MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" """ Key(s) of message, another way to mark message besides message id. """ @@ -798,6 +958,63 @@ class SpanAttributes: Uncompressed size of the message in bytes. """ + RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" + """ + The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. + """ + + EXCEPTION_ESCAPED = "exception.escaped" + """ + 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. + Note: 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 `__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](#recording-an-exception). + +It follows that an exception may still escape the scope of the span +even if the `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. + """ + + +class HttpFlavorValues(Enum): + HTTP_1_0 = "1.0" + """HTTP/1.0.""" + + HTTP_1_1 = "1.1" + """HTTP/1.1.""" + + HTTP_2_0 = "2.0" + """HTTP/2.""" + + HTTP_3_0 = "3.0" + """HTTP/3.""" + + SPDY = "SPDY" + """SPDY protocol.""" + + QUIC = "QUIC" + """QUIC protocol.""" + + +class EventDomainValues(Enum): + BROWSER = "browser" + """Events from browser apps.""" + + DEVICE = "device" + """Events from mobile apps.""" + + K8S = "k8s" + """Events from Kubernetes.""" + class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" @@ -814,6 +1031,9 @@ class DbSystemValues(Enum): MSSQL = "mssql" """Microsoft SQL Server.""" + MSSQLCOMPACT = "mssqlcompact" + """Microsoft SQL Server Compact.""" + MYSQL = "mysql" """MySQL.""" @@ -949,6 +1169,26 @@ class DbSystemValues(Enum): COCKROACHDB = "cockroachdb" """CockroachDB.""" + OPENSEARCH = "opensearch" + """OpenSearch.""" + + CLICKHOUSE = "clickhouse" + """ClickHouse.""" + + SPANNER = "spanner" + """Cloud Spanner.""" + + +class NetSockFamilyValues(Enum): + INET = "inet" + """IPv4 address.""" + + INET6 = "inet6" + """IPv6 address.""" + + UNIX = "unix" + """Unix domain socket path.""" + class NetTransportValues(Enum): IP_TCP = "ip_tcp" @@ -957,12 +1197,6 @@ class NetTransportValues(Enum): IP_UDP = "ip_udp" """ip_udp.""" - IP = "ip" - """Another IP-based protocol.""" - - UNIX = "unix" - """Unix Domain socket. See below.""" - PIPE = "pipe" """Named or anonymous pipe. See note below.""" @@ -1008,6 +1242,14 @@ class DbCassandraConsistencyLevelValues(Enum): """local_serial.""" +class OtelStatusCodeValues(Enum): + OK = "OK" + """The operation has been validated by an Application developer or Operator to have completed successfully.""" + + ERROR = "ERROR" + """The operation contains an error.""" + + class FaasTriggerValues(Enum): DATASOURCE = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" @@ -1036,24 +1278,15 @@ class FaasDocumentOperationValues(Enum): """When an object is deleted.""" -class HttpFlavorValues(Enum): - HTTP_1_0 = "1.0" - """HTTP/1.0.""" - - HTTP_1_1 = "1.1" - """HTTP/1.1.""" - - HTTP_2_0 = "2.0" - """HTTP/2.""" - - HTTP_3_0 = "3.0" - """HTTP/3.""" +class MessagingOperationValues(Enum): + PUBLISH = "publish" + """publish.""" - SPDY = "SPDY" - """SPDY protocol.""" + RECEIVE = "receive" + """receive.""" - QUIC = "QUIC" - """QUIC protocol.""" + PROCESS = "process" + """process.""" class NetHostConnectionTypeValues(Enum): @@ -1138,14 +1371,6 @@ class NetHostConnectionSubtypeValues(Enum): """LTE CA.""" -class MessagingDestinationKindValues(Enum): - QUEUE = "queue" - """A message sent to a queue.""" - - TOPIC = "topic" - """A message sent to a topic.""" - - class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -1176,13 +1401,35 @@ class RpcSystemValues(Enum): APACHE_DUBBO = "apache_dubbo" """Apache Dubbo.""" + CONNECT_RPC = "connect_rpc" + """Connect RPC.""" -class MessagingOperationValues(Enum): - RECEIVE = "receive" - """receive.""" - PROCESS = "process" - """process.""" +class GraphqlOperationTypeValues(Enum): + QUERY = "query" + """GraphQL query.""" + + MUTATION = "mutation" + """GraphQL mutation.""" + + SUBSCRIPTION = "subscription" + """GraphQL subscription.""" + + +class MessagingDestinationKindValues(Enum): + QUEUE = "queue" + """A message sent to a queue.""" + + TOPIC = "topic" + """A message sent to a topic.""" + + +class MessagingSourceKindValues(Enum): + QUEUE = "queue" + """A message received from a queue.""" + + TOPIC = "topic" + """A message received from a topic.""" class MessagingRocketmqMessageTypeValues(Enum): @@ -1266,3 +1513,53 @@ class MessageTypeValues(Enum): RECEIVED = "RECEIVED" """received.""" + + +class RpcConnectRpcErrorCodeValues(Enum): + CANCELLED = "cancelled" + """cancelled.""" + + UNKNOWN = "unknown" + """unknown.""" + + INVALID_ARGUMENT = "invalid_argument" + """invalid_argument.""" + + DEADLINE_EXCEEDED = "deadline_exceeded" + """deadline_exceeded.""" + + NOT_FOUND = "not_found" + """not_found.""" + + ALREADY_EXISTS = "already_exists" + """already_exists.""" + + PERMISSION_DENIED = "permission_denied" + """permission_denied.""" + + RESOURCE_EXHAUSTED = "resource_exhausted" + """resource_exhausted.""" + + FAILED_PRECONDITION = "failed_precondition" + """failed_precondition.""" + + ABORTED = "aborted" + """aborted.""" + + OUT_OF_RANGE = "out_of_range" + """out_of_range.""" + + UNIMPLEMENTED = "unimplemented" + """unimplemented.""" + + INTERNAL = "internal" + """internal.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + DATA_LOSS = "data_loss" + """data_loss.""" + + UNAUTHENTICATED = "unauthenticated" + """unauthenticated.""" diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 866832fe6b..64ca6edb24 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -4,8 +4,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible -SPEC_VERSION=v1.11.0 -OTEL_SEMCONV_GEN_IMG_VERSION=0.11.1 +SPEC_VERSION=v1.19.0 +OTEL_SEMCONV_GEN_IMG_VERSION=0.18.0 cd ${SCRIPT_DIR} @@ -20,20 +20,22 @@ git reset --hard FETCH_HEAD cd ${SCRIPT_DIR} docker run --rm \ - -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \ + -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/:/output \ otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + --only span,event,attribute_group,scope \ -f /source code \ --template /templates/semantic_attributes.j2 \ --output /output/__init__.py \ -Dclass=SpanAttributes docker run --rm \ - -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \ + -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/:/output \ otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + --only resource \ -f /source code \ --template /templates/semantic_attributes.j2 \ --output /output/__init__.py \