From 6af29095fbd0e0ccfc0f05463263ca1b9c8b24a1 Mon Sep 17 00:00:00 2001 From: Kristopher Wuollett Date: Wed, 1 Nov 2023 11:45:15 -0500 Subject: [PATCH 1/5] feat: add generated modules that output const &str for tracing compatibility --- opentelemetry-datadog/src/exporter/mod.rs | 4 +- .../src/exporter/config/mod.rs | 4 +- .../examples/basic-otlp-http/src/main.rs | 4 +- .../examples/basic-otlp/src/main.rs | 4 +- .../src/main.rs | 6 +- .../tests/integration_test.rs | 12 +- .../CHANGELOG.md | 1 + .../scripts/templates/header_resource.rs | 21 +- .../scripts/templates/header_trace.rs | 23 +- .../templates/semantic_attributes.rs.j2 | 4 +- .../src/resource.rs | 232 +-- .../src/semconv/mod.rs | 2 + .../src/semconv/resource.rs | 882 +++++++++ .../src/semconv/trace.rs | 1599 +++++++++++++++++ .../src/trace.rs | 473 +++-- opentelemetry-stackdriver/src/lib.rs | 80 +- opentelemetry-zipkin/src/exporter/mod.rs | 4 +- 17 files changed, 2942 insertions(+), 413 deletions(-) create mode 100644 opentelemetry-semantic-conventions/src/semconv/mod.rs create mode 100644 opentelemetry-semantic-conventions/src/semconv/resource.rs create mode 100644 opentelemetry-semantic-conventions/src/semconv/trace.rs diff --git a/opentelemetry-datadog/src/exporter/mod.rs b/opentelemetry-datadog/src/exporter/mod.rs index 9b07183390..576b5cb2e8 100644 --- a/opentelemetry-datadog/src/exporter/mod.rs +++ b/opentelemetry-datadog/src/exporter/mod.rs @@ -212,7 +212,7 @@ impl DatadogPipelineBuilder { cfg.resource = Cow::Owned(Resource::new( cfg.resource .iter() - .filter(|(k, _v)| **k != semcov::resource::SERVICE_NAME) + .filter(|(k, _v)| k.as_str() != semcov::resource::SERVICE_NAME) .map(|(k, v)| KeyValue::new(k.clone(), v.clone())), )); cfg @@ -226,7 +226,7 @@ impl DatadogPipelineBuilder { } else { let service_name = SdkProvidedResourceDetector .detect(Duration::from_secs(0)) - .get(semcov::resource::SERVICE_NAME) + .get(semcov::resource::SERVICE_NAME.into()) .unwrap() .to_string(); ( diff --git a/opentelemetry-jaeger/src/exporter/config/mod.rs b/opentelemetry-jaeger/src/exporter/config/mod.rs index ea598b417d..2967fd1879 100644 --- a/opentelemetry-jaeger/src/exporter/config/mod.rs +++ b/opentelemetry-jaeger/src/exporter/config/mod.rs @@ -61,7 +61,7 @@ fn build_config_and_process( let service_name = service_name_opt.unwrap_or_else(|| { config .resource - .get(semcov::resource::SERVICE_NAME) + .get(semcov::resource::SERVICE_NAME.into()) .map(|v| v.to_string()) .unwrap_or_else(|| "unknown_service".to_string()) }); @@ -70,7 +70,7 @@ fn build_config_and_process( let mut tags = config .resource .iter() - .filter(|(key, _)| **key != semcov::resource::SERVICE_NAME) + .filter(|(key, _)| key.as_str() != semcov::resource::SERVICE_NAME) .map(|(key, value)| KeyValue::new(key.clone(), value.clone())) .collect::>(); diff --git a/opentelemetry-otlp/examples/basic-otlp-http/src/main.rs b/opentelemetry-otlp/examples/basic-otlp-http/src/main.rs index 893788475c..86df2d9406 100644 --- a/opentelemetry-otlp/examples/basic-otlp-http/src/main.rs +++ b/opentelemetry-otlp/examples/basic-otlp-http/src/main.rs @@ -91,11 +91,11 @@ async fn main() -> Result<(), Box> { "Nice operation!".to_string(), vec![Key::new("bogons").i64(100)], ); - span.set_attribute(ANOTHER_KEY.string("yes")); + span.set_attribute(KeyValue::new(ANOTHER_KEY, "yes")); tracer.in_span("Sub operation...", |cx| { let span = cx.span(); - span.set_attribute(LEMONS_KEY.string("five")); + span.set_attribute(KeyValue::new(LEMONS_KEY, "five")); span.add_event("Sub span event", vec![]); }); diff --git a/opentelemetry-otlp/examples/basic-otlp/src/main.rs b/opentelemetry-otlp/examples/basic-otlp/src/main.rs index 61df37c2ec..90136d8ae1 100644 --- a/opentelemetry-otlp/examples/basic-otlp/src/main.rs +++ b/opentelemetry-otlp/examples/basic-otlp/src/main.rs @@ -121,13 +121,13 @@ async fn main() -> Result<(), Box> { "Nice operation!".to_string(), vec![Key::new("bogons").i64(100)], ); - span.set_attribute(ANOTHER_KEY.string("yes")); + span.set_attribute(KeyValue::new(ANOTHER_KEY, "yes")); info!(target: "my-target", "hello from {}. My price is {}. I am also inside a Span!", "banana", 2.99); tracer.in_span("Sub operation...", |cx| { let span = cx.span(); - span.set_attribute(LEMONS_KEY.string("five")); + span.set_attribute(KeyValue::new(LEMONS_KEY, "five")); span.add_event("Sub span event", vec![]); diff --git a/opentelemetry-otlp/examples/external-otlp-grpcio-async-std/src/main.rs b/opentelemetry-otlp/examples/external-otlp-grpcio-async-std/src/main.rs index 72c5bf5f9b..1555eab935 100644 --- a/opentelemetry-otlp/examples/external-otlp-grpcio-async-std/src/main.rs +++ b/opentelemetry-otlp/examples/external-otlp-grpcio-async-std/src/main.rs @@ -11,7 +11,7 @@ use opentelemetry::{ global::{shutdown_tracer_provider, tracer}, trace::TraceError, trace::{TraceContextExt, Tracer}, - Key, + Key, KeyValue, }; use opentelemetry_otlp::WithExportConfig; use std::{ @@ -85,11 +85,11 @@ async fn main() -> Result<(), Box> { "Nice operation!".to_string(), vec![Key::new("bogons").i64(100)], ); - span.set_attribute(ANOTHER_KEY.string("yes")); + span.set_attribute(KeyValue::new(ANOTHER_KEY, "yes")); tracer.in_span("Sub operation...", |cx| { let span = cx.span(); - span.set_attribute(LEMONS_KEY.string("five")); + span.set_attribute(KeyValue::new(LEMONS_KEY, "five")); span.add_event("Sub span event", vec![]); }); diff --git a/opentelemetry-prometheus/tests/integration_test.rs b/opentelemetry-prometheus/tests/integration_test.rs index 95e95c9f16..161a62b822 100644 --- a/opentelemetry-prometheus/tests/integration_test.rs +++ b/opentelemetry-prometheus/tests/integration_test.rs @@ -327,9 +327,9 @@ fn prometheus_exporter_integration() { .merge(&mut Resource::new( vec![ // always specify service.name because the default depends on the running OS - SERVICE_NAME.string("prometheus_test"), + KeyValue::new(SERVICE_NAME, "prometheus_test"), // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version - TELEMETRY_SDK_VERSION.string("latest"), + KeyValue::new(TELEMETRY_SDK_VERSION, "latest"), ] .into_iter() .chain(tc.custom_resource_attrs.into_iter()), @@ -390,9 +390,9 @@ fn multiple_scopes() { ) .merge(&mut Resource::new(vec![ // always specify service.name because the default depends on the running OS - SERVICE_NAME.string("prometheus_test"), + KeyValue::new(SERVICE_NAME, "prometheus_test"), // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version - TELEMETRY_SDK_VERSION.string("latest"), + KeyValue::new(TELEMETRY_SDK_VERSION, "latest"), ])); let provider = MeterProvider::builder() @@ -722,9 +722,9 @@ fn duplicate_metrics() { .merge(&mut Resource::new( vec![ // always specify service.name because the default depends on the running OS - SERVICE_NAME.string("prometheus_test"), + KeyValue::new(SERVICE_NAME, "prometheus_test"), // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version - TELEMETRY_SDK_VERSION.string("latest"), + KeyValue::new(TELEMETRY_SDK_VERSION, "latest"), ] .into_iter() .chain(tc.custom_resource_attrs.into_iter()), diff --git a/opentelemetry-semantic-conventions/CHANGELOG.md b/opentelemetry-semantic-conventions/CHANGELOG.md index 33d43e9f90..c042eabe4d 100644 --- a/opentelemetry-semantic-conventions/CHANGELOG.md +++ b/opentelemetry-semantic-conventions/CHANGELOG.md @@ -4,6 +4,7 @@ ### Changed +- Replaced Key constants with &'static str [#1320] - Bump MSRV to 1.65 [#1318](https://github.com/open-telemetry/opentelemetry-rust/pull/1318) - Bump MSRV to 1.64 [#1203](https://github.com/open-telemetry/opentelemetry-rust/pull/1203) diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs index af7c416c1e..c46bfdad9b 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs @@ -7,14 +7,31 @@ //! //! ## Usage //! +//! `tracing`: +//! //! ``` +//! use opentelemetry_semantic_conventions as semconv; +//! use tracing::span; +//! +//! let span = span!( +//! LEVEL::INFO, +//! "handle_request", +//! { semconv::resource::SERVICE_NAME = "my-service" }, +//! { semconv::resource::SERVICE_NAMESPACE = "my-namespace" } +//! ); +//! ``` +//! +//! OpenTelemetry SDK: +//! +//! ``` +//! use opentelemetry::KeyValue; //! use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource}; //! use opentelemetry_semantic_conventions as semconv; //! //! let _tracer = TracerProvider::builder() //! .with_config(config().with_resource(Resource::new(vec![ -//! semconv::resource::SERVICE_NAME.string("my-service"), -//! semconv::resource::SERVICE_NAMESPACE.string("my-namespace"), +//! KeyValue::new(semconv::resource::SERVICE_NAME, "my-service"), +//! KeyValue::new(semconv::resource::SERVICE_NAMESPACE, "my-namespace"), //! ]))) //! .build(); //! ``` diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs index 7487abb82b..74d103a9c9 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs @@ -7,16 +7,33 @@ //! //! ## Usage //! +//! `tracing`: +//! //! ``` +//! use opentelemetry_semantic_conventions as semconv; +//! use tracing::span; +//! +//! let span = span!( +//! LEVEL::INFO, +//! "handle_request", +//! { semconv::trace::NET_PEER_NAME = "example.org" }, +//! { semconv::trace::NET_PEER_PORT = 80 } +//! ); +//! ``` +//! +//! OpenTelemetry SDK: +//! +//! ``` +//! use opentelemetry::KeyValue; //! use opentelemetry::{global, trace::Tracer as _}; -//! use opentelemetry_semantic_conventions as semcov; +//! use opentelemetry_semantic_conventions as semconv; //! //! let tracer = global::tracer("my-component"); //! let _span = tracer //! .span_builder("span-name") //! .with_attributes(vec![ -//! semcov::trace::NET_PEER_NAME.string("example.org"), -//! semcov::trace::NET_PEER_PORT.i64(80), +//! KeyValue::new(semconv::trace::NET_PEER_NAME, "example.org"), +//! KeyValue::new(semconv::trace::NET_PEER_PORT, 80i64), //! ]) //! .start(&tracer); //! ``` diff --git a/opentelemetry-semantic-conventions/scripts/templates/semantic_attributes.rs.j2 b/opentelemetry-semantic-conventions/scripts/templates/semantic_attributes.rs.j2 index fcbb1bc2e1..604d6233cf 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/semantic_attributes.rs.j2 +++ b/opentelemetry-semantic-conventions/scripts/templates/semantic_attributes.rs.j2 @@ -6,8 +6,6 @@ {% include 'header_' + conventions + '.rs' %} -use opentelemetry::Key; - {%- for attribute in attributes if attribute.is_local and not attribute.ref %} /// {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %} @@ -28,5 +26,5 @@ use opentelemetry::Key; {%- if (attribute.stability | string()) == "StabilityLevel.DEPRECATED" %} #[deprecated] {%- endif %} -pub const {{attribute.fqn | to_const_name}}: Key = Key::from_static_str("{{attribute.fqn}}"); +pub const {{attribute.fqn | to_const_name}}: &str = "{{attribute.fqn}}"; {%- endfor %} diff --git a/opentelemetry-semantic-conventions/src/resource.rs b/opentelemetry-semantic-conventions/src/resource.rs index 6632bc0d18..cf2e1bf586 100644 --- a/opentelemetry-semantic-conventions/src/resource.rs +++ b/opentelemetry-semantic-conventions/src/resource.rs @@ -13,20 +13,35 @@ //! //! ## Usage //! +//! `tracing`: +//! +//! ``` +//! use opentelemetry_semantic_conventions as semconv; +//! use tracing::span; +//! +//! let span = span!( +//! LEVEL::INFO, +//! "handle_request", +//! { semconv::resource::SERVICE_NAME = "my-service" }, +//! { semconv::resource::SERVICE_NAMESPACE = "my-namespace" } +//! ); //! ``` +//! +//! OpenTelemetry SDK: +//! +//! ``` +//! use opentelemetry::KeyValue; //! use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource}; //! use opentelemetry_semantic_conventions as semconv; //! //! let _tracer = TracerProvider::builder() //! .with_config(config().with_resource(Resource::new(vec![ -//! semconv::resource::SERVICE_NAME.string("my-service"), -//! semconv::resource::SERVICE_NAMESPACE.string("my-namespace"), +//! KeyValue::new(semconv::resource::SERVICE_NAME, "my-service"), +//! KeyValue::new(semconv::resource::SERVICE_NAMESPACE, "my-namespace"), //! ]))) //! .build(); //! ``` -use opentelemetry::Key; - /// Array of brand name and version separated by a space. /// /// This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). @@ -36,7 +51,7 @@ use opentelemetry::Key; /// - ` Not A;Brand 99` /// - `Chromium 99` /// - `Chrome 99` -pub const BROWSER_BRANDS: Key = Key::from_static_str("browser.brands"); +pub const BROWSER_BRANDS: &str = "browser.brands"; /// The platform on which the browser is running. /// @@ -48,12 +63,12 @@ pub const BROWSER_BRANDS: Key = Key::from_static_str("browser.brands"); /// - `Windows` /// - `macOS` /// - `Android` -pub const BROWSER_PLATFORM: Key = Key::from_static_str("browser.platform"); +pub const BROWSER_PLATFORM: &str = "browser.platform"; /// A boolean that is true if the browser is running on a mobile device. /// /// 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. -pub const BROWSER_MOBILE: Key = Key::from_static_str("browser.mobile"); +pub const BROWSER_MOBILE: &str = "browser.mobile"; /// Preferred language of the user using the browser. /// @@ -65,10 +80,10 @@ pub const BROWSER_MOBILE: Key = Key::from_static_str("browser.mobile"); /// - `en-US` /// - `fr` /// - `fr-FR` -pub const BROWSER_LANGUAGE: Key = Key::from_static_str("browser.language"); +pub const BROWSER_LANGUAGE: &str = "browser.language"; /// Name of the cloud provider. -pub const CLOUD_PROVIDER: Key = Key::from_static_str("cloud.provider"); +pub const CLOUD_PROVIDER: &str = "cloud.provider"; /// The cloud account ID the resource is assigned to. /// @@ -76,7 +91,7 @@ pub const CLOUD_PROVIDER: Key = Key::from_static_str("cloud.provider"); /// /// - `111111111111` /// - `opentelemetry` -pub const CLOUD_ACCOUNT_ID: Key = Key::from_static_str("cloud.account.id"); +pub const CLOUD_ACCOUNT_ID: &str = "cloud.account.id"; /// The geographical region the resource is running. /// @@ -86,7 +101,7 @@ pub const CLOUD_ACCOUNT_ID: Key = Key::from_static_str("cloud.account.id"); /// /// - `us-central1` /// - `us-east-1` -pub const CLOUD_REGION: Key = Key::from_static_str("cloud.region"); +pub const CLOUD_REGION: &str = "cloud.region"; /// 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). /// @@ -113,7 +128,7 @@ pub const CLOUD_REGION: Key = Key::from_static_str("cloud.region"); /// - `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function` /// - `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID` /// - `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/` -pub const CLOUD_RESOURCE_ID: Key = Key::from_static_str("cloud.resource_id"); +pub const CLOUD_RESOURCE_ID: &str = "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. /// @@ -122,43 +137,43 @@ pub const CLOUD_RESOURCE_ID: Key = Key::from_static_str("cloud.resource_id"); /// # Examples /// /// - `us-east-1c` -pub const CLOUD_AVAILABILITY_ZONE: Key = Key::from_static_str("cloud.availability_zone"); +pub const CLOUD_AVAILABILITY_ZONE: &str = "cloud.availability_zone"; /// The cloud platform in use. /// /// The prefix of the service SHOULD match the one specified in `cloud.provider`. -pub const CLOUD_PLATFORM: Key = Key::from_static_str("cloud.platform"); +pub const CLOUD_PLATFORM: &str = "cloud.platform"; /// The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). /// /// # Examples /// /// - `arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9` -pub const AWS_ECS_CONTAINER_ARN: Key = Key::from_static_str("aws.ecs.container.arn"); +pub const AWS_ECS_CONTAINER_ARN: &str = "aws.ecs.container.arn"; /// The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). /// /// # Examples /// /// - `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` -pub const AWS_ECS_CLUSTER_ARN: Key = Key::from_static_str("aws.ecs.cluster.arn"); +pub const AWS_ECS_CLUSTER_ARN: &str = "aws.ecs.cluster.arn"; /// The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. -pub const AWS_ECS_LAUNCHTYPE: Key = Key::from_static_str("aws.ecs.launchtype"); +pub const AWS_ECS_LAUNCHTYPE: &str = "aws.ecs.launchtype"; /// The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). /// /// # Examples /// /// - `arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b` -pub const AWS_ECS_TASK_ARN: Key = Key::from_static_str("aws.ecs.task.arn"); +pub const AWS_ECS_TASK_ARN: &str = "aws.ecs.task.arn"; /// The task definition family this task definition is a member of. /// /// # Examples /// /// - `opentelemetry-family` -pub const AWS_ECS_TASK_FAMILY: Key = Key::from_static_str("aws.ecs.task.family"); +pub const AWS_ECS_TASK_FAMILY: &str = "aws.ecs.task.family"; /// The revision for this task definition. /// @@ -166,14 +181,14 @@ pub const AWS_ECS_TASK_FAMILY: Key = Key::from_static_str("aws.ecs.task.family") /// /// - `8` /// - `26` -pub const AWS_ECS_TASK_REVISION: Key = Key::from_static_str("aws.ecs.task.revision"); +pub const AWS_ECS_TASK_REVISION: &str = "aws.ecs.task.revision"; /// The ARN of an EKS cluster. /// /// # Examples /// /// - `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` -pub const AWS_EKS_CLUSTER_ARN: Key = Key::from_static_str("aws.eks.cluster.arn"); +pub const AWS_EKS_CLUSTER_ARN: &str = "aws.eks.cluster.arn"; /// The name(s) of the AWS log group(s) an application is writing to. /// @@ -183,7 +198,7 @@ pub const AWS_EKS_CLUSTER_ARN: Key = Key::from_static_str("aws.eks.cluster.arn") /// /// - `/aws/lambda/my-function` /// - `opentelemetry-service` -pub const AWS_LOG_GROUP_NAMES: Key = Key::from_static_str("aws.log.group.names"); +pub const AWS_LOG_GROUP_NAMES: &str = "aws.log.group.names"; /// The Amazon Resource Name(s) (ARN) of the AWS log group(s). /// @@ -192,14 +207,14 @@ pub const AWS_LOG_GROUP_NAMES: Key = Key::from_static_str("aws.log.group.names") /// # Examples /// /// - `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*` -pub const AWS_LOG_GROUP_ARNS: Key = Key::from_static_str("aws.log.group.arns"); +pub const AWS_LOG_GROUP_ARNS: &str = "aws.log.group.arns"; /// The name(s) of the AWS log stream(s) an application is writing to. /// /// # Examples /// /// - `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` -pub const AWS_LOG_STREAM_NAMES: Key = Key::from_static_str("aws.log.stream.names"); +pub const AWS_LOG_STREAM_NAMES: &str = "aws.log.stream.names"; /// The ARN(s) of the AWS log stream(s). /// @@ -208,7 +223,7 @@ pub const AWS_LOG_STREAM_NAMES: Key = Key::from_static_str("aws.log.stream.names /// # Examples /// /// - `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` -pub const AWS_LOG_STREAM_ARNS: Key = Key::from_static_str("aws.log.stream.arns"); +pub const AWS_LOG_STREAM_ARNS: &str = "aws.log.stream.arns"; /// The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. /// @@ -216,7 +231,7 @@ pub const AWS_LOG_STREAM_ARNS: Key = Key::from_static_str("aws.log.stream.arns") /// /// - `job-name-xxxx` /// - `sample-job-mdw84` -pub const GCP_CLOUD_RUN_JOB_EXECUTION: Key = Key::from_static_str("gcp.cloud_run.job.execution"); +pub const GCP_CLOUD_RUN_JOB_EXECUTION: &str = "gcp.cloud_run.job.execution"; /// The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. /// @@ -224,7 +239,7 @@ pub const GCP_CLOUD_RUN_JOB_EXECUTION: Key = Key::from_static_str("gcp.cloud_run /// /// - `0` /// - `1` -pub const GCP_CLOUD_RUN_JOB_TASK_INDEX: Key = Key::from_static_str("gcp.cloud_run.job.task_index"); +pub const GCP_CLOUD_RUN_JOB_TASK_INDEX: &str = "gcp.cloud_run.job.task_index"; /// The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). /// @@ -232,7 +247,7 @@ pub const GCP_CLOUD_RUN_JOB_TASK_INDEX: Key = Key::from_static_str("gcp.cloud_ru /// /// - `instance-1` /// - `my-vm-name` -pub const GCP_GCE_INSTANCE_NAME: Key = Key::from_static_str("gcp.gce.instance.name"); +pub const GCP_GCE_INSTANCE_NAME: &str = "gcp.gce.instance.name"; /// The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). /// @@ -240,43 +255,42 @@ pub const GCP_GCE_INSTANCE_NAME: Key = Key::from_static_str("gcp.gce.instance.na /// /// - `my-host1234.example.com` /// - `sample-vm.us-west1-b.c.my-project.internal` -pub const GCP_GCE_INSTANCE_HOSTNAME: Key = Key::from_static_str("gcp.gce.instance.hostname"); +pub const GCP_GCE_INSTANCE_HOSTNAME: &str = "gcp.gce.instance.hostname"; /// Time and date the release was created. /// /// # Examples /// /// - `2022-10-23T18:00:42Z` -pub const HEROKU_RELEASE_CREATION_TIMESTAMP: Key = - Key::from_static_str("heroku.release.creation_timestamp"); +pub const HEROKU_RELEASE_CREATION_TIMESTAMP: &str = "heroku.release.creation_timestamp"; /// Commit hash for the current release. /// /// # Examples /// /// - `e6134959463efd8966b20e75b913cafe3f5ec` -pub const HEROKU_RELEASE_COMMIT: Key = Key::from_static_str("heroku.release.commit"); +pub const HEROKU_RELEASE_COMMIT: &str = "heroku.release.commit"; /// Unique identifier for the application. /// /// # Examples /// /// - `2daa2797-e42b-4624-9322-ec3f968df4da` -pub const HEROKU_APP_ID: Key = Key::from_static_str("heroku.app.id"); +pub const HEROKU_APP_ID: &str = "heroku.app.id"; /// Container name used by container runtime. /// /// # Examples /// /// - `opentelemetry-autoconf` -pub const CONTAINER_NAME: Key = Key::from_static_str("container.name"); +pub const CONTAINER_NAME: &str = "container.name"; /// Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. /// /// # Examples /// /// - `a3bf90e006b2` -pub const CONTAINER_ID: Key = Key::from_static_str("container.id"); +pub const CONTAINER_ID: &str = "container.id"; /// The container runtime managing this container. /// @@ -285,21 +299,21 @@ pub const CONTAINER_ID: Key = Key::from_static_str("container.id"); /// - `docker` /// - `containerd` /// - `rkt` -pub const CONTAINER_RUNTIME: Key = Key::from_static_str("container.runtime"); +pub const CONTAINER_RUNTIME: &str = "container.runtime"; /// Name of the image the container was built on. /// /// # Examples /// /// - `gcr.io/opentelemetry/operator` -pub const CONTAINER_IMAGE_NAME: Key = Key::from_static_str("container.image.name"); +pub const CONTAINER_IMAGE_NAME: &str = "container.image.name"; /// Container image tag. /// /// # Examples /// /// - `0.1` -pub const CONTAINER_IMAGE_TAG: Key = Key::from_static_str("container.image.tag"); +pub const CONTAINER_IMAGE_TAG: &str = "container.image.tag"; /// Runtime specific image identifier. Usually a hash algorithm followed by a UUID. /// @@ -310,7 +324,7 @@ pub const CONTAINER_IMAGE_TAG: Key = Key::from_static_str("container.image.tag") /// # Examples /// /// - `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` -pub const CONTAINER_IMAGE_ID: Key = Key::from_static_str("container.image.id"); +pub const CONTAINER_IMAGE_ID: &str = "container.image.id"; /// The command used to run the container (i.e. the command name). /// @@ -319,21 +333,21 @@ pub const CONTAINER_IMAGE_ID: Key = Key::from_static_str("container.image.id"); /// # Examples /// /// - `otelcontribcol` -pub const CONTAINER_COMMAND: Key = Key::from_static_str("container.command"); +pub const CONTAINER_COMMAND: &str = "container.command"; /// The full command run by the container as a single string representing the full command. /// /// # Examples /// /// - `otelcontribcol --config config.yaml` -pub const CONTAINER_COMMAND_LINE: Key = Key::from_static_str("container.command_line"); +pub const CONTAINER_COMMAND_LINE: &str = "container.command_line"; /// All the command arguments (including the command/executable itself) run by the container. /// /// # Examples /// /// - `otelcontribcol, --config, config.yaml` -pub const CONTAINER_COMMAND_ARGS: Key = Key::from_static_str("container.command_args"); +pub const CONTAINER_COMMAND_ARGS: &str = "container.command_args"; /// Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). /// @@ -341,7 +355,7 @@ pub const CONTAINER_COMMAND_ARGS: Key = Key::from_static_str("container.command_ /// /// - `staging` /// - `production` -pub const DEPLOYMENT_ENVIRONMENT: Key = Key::from_static_str("deployment.environment"); +pub const DEPLOYMENT_ENVIRONMENT: &str = "deployment.environment"; /// A unique identifier representing the device. /// @@ -350,7 +364,7 @@ pub const DEPLOYMENT_ENVIRONMENT: Key = Key::from_static_str("deployment.environ /// # Examples /// /// - `2ab2916d-a51f-4ac8-80ee-45ac31a28092` -pub const DEVICE_ID: Key = Key::from_static_str("device.id"); +pub const DEVICE_ID: &str = "device.id"; /// The model identifier for the device. /// @@ -360,7 +374,7 @@ pub const DEVICE_ID: Key = Key::from_static_str("device.id"); /// /// - `iPhone3,4` /// - `SM-G920F` -pub const DEVICE_MODEL_IDENTIFIER: Key = Key::from_static_str("device.model.identifier"); +pub const DEVICE_MODEL_IDENTIFIER: &str = "device.model.identifier"; /// The marketing name for the device model. /// @@ -370,7 +384,7 @@ pub const DEVICE_MODEL_IDENTIFIER: Key = Key::from_static_str("device.model.iden /// /// - `iPhone 6s Plus` /// - `Samsung Galaxy S6` -pub const DEVICE_MODEL_NAME: Key = Key::from_static_str("device.model.name"); +pub const DEVICE_MODEL_NAME: &str = "device.model.name"; /// The name of the device manufacturer. /// @@ -380,7 +394,7 @@ pub const DEVICE_MODEL_NAME: Key = Key::from_static_str("device.model.name"); /// /// - `Apple` /// - `Samsung` -pub const DEVICE_MANUFACTURER: Key = Key::from_static_str("device.manufacturer"); +pub const DEVICE_MANUFACTURER: &str = "device.manufacturer"; /// The name of the single function that this runtime instance executes. /// @@ -405,7 +419,7 @@ pub const DEVICE_MANUFACTURER: Key = Key::from_static_str("device.manufacturer") /// /// - `my-function` /// - `myazurefunctionapp/some-function-name` -pub const FAAS_NAME: Key = Key::from_static_str("faas.name"); +pub const FAAS_NAME: &str = "faas.name"; /// The immutable version of the function being executed. /// @@ -423,7 +437,7 @@ pub const FAAS_NAME: Key = Key::from_static_str("faas.name"); /// /// - `26` /// - `pinkfroid-00002` -pub const FAAS_VERSION: Key = Key::from_static_str("faas.version"); +pub const FAAS_VERSION: &str = "faas.version"; /// The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. /// @@ -432,7 +446,7 @@ pub const FAAS_VERSION: Key = Key::from_static_str("faas.version"); /// # Examples /// /// - `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` -pub const FAAS_INSTANCE: Key = Key::from_static_str("faas.instance"); +pub const FAAS_INSTANCE: &str = "faas.instance"; /// The amount of memory available to the serverless function converted to Bytes. /// @@ -441,31 +455,31 @@ pub const FAAS_INSTANCE: Key = Key::from_static_str("faas.instance"); /// # Examples /// /// - `134217728` -pub const FAAS_MAX_MEMORY: Key = Key::from_static_str("faas.max_memory"); +pub const FAAS_MAX_MEMORY: &str = "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 `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. /// /// # Examples /// /// - `fdbf79e8af94cb7f9e8df36789187052` -pub const HOST_ID: Key = Key::from_static_str("host.id"); +pub const HOST_ID: &str = "host.id"; /// Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. /// /// # Examples /// /// - `opentelemetry-test` -pub const HOST_NAME: Key = Key::from_static_str("host.name"); +pub const HOST_NAME: &str = "host.name"; /// Type of host. For Cloud, this must be the machine type. /// /// # Examples /// /// - `n1-standard-1` -pub const HOST_TYPE: Key = Key::from_static_str("host.type"); +pub const HOST_TYPE: &str = "host.type"; /// The CPU architecture the host system is running on. -pub const HOST_ARCH: Key = Key::from_static_str("host.arch"); +pub const HOST_ARCH: &str = "host.arch"; /// Name of the VM image or OS install the host was instantiated from. /// @@ -473,28 +487,28 @@ pub const HOST_ARCH: Key = Key::from_static_str("host.arch"); /// /// - `infra-ami-eks-worker-node-7d4ec78312` /// - `CentOS-8-x86_64-1905` -pub const HOST_IMAGE_NAME: Key = Key::from_static_str("host.image.name"); +pub const HOST_IMAGE_NAME: &str = "host.image.name"; /// VM image ID or host OS image ID. For Cloud, this value is from the provider. /// /// # Examples /// /// - `ami-07b06b442921831e5` -pub const HOST_IMAGE_ID: Key = Key::from_static_str("host.image.id"); +pub const HOST_IMAGE_ID: &str = "host.image.id"; /// The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). /// /// # Examples /// /// - `0.1` -pub const HOST_IMAGE_VERSION: Key = Key::from_static_str("host.image.version"); +pub const HOST_IMAGE_VERSION: &str = "host.image.version"; /// The name of the cluster. /// /// # Examples /// /// - `opentelemetry-cluster` -pub const K8S_CLUSTER_NAME: Key = Key::from_static_str("k8s.cluster.name"); +pub const K8S_CLUSTER_NAME: &str = "k8s.cluster.name"; /// A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. /// @@ -524,49 +538,49 @@ pub const K8S_CLUSTER_NAME: Key = Key::from_static_str("k8s.cluster.name"); /// # Examples /// /// - `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` -pub const K8S_CLUSTER_UID: Key = Key::from_static_str("k8s.cluster.uid"); +pub const K8S_CLUSTER_UID: &str = "k8s.cluster.uid"; /// The name of the Node. /// /// # Examples /// /// - `node-1` -pub const K8S_NODE_NAME: Key = Key::from_static_str("k8s.node.name"); +pub const K8S_NODE_NAME: &str = "k8s.node.name"; /// The UID of the Node. /// /// # Examples /// /// - `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` -pub const K8S_NODE_UID: Key = Key::from_static_str("k8s.node.uid"); +pub const K8S_NODE_UID: &str = "k8s.node.uid"; /// The name of the namespace that the pod is running in. /// /// # Examples /// /// - `default` -pub const K8S_NAMESPACE_NAME: Key = Key::from_static_str("k8s.namespace.name"); +pub const K8S_NAMESPACE_NAME: &str = "k8s.namespace.name"; /// The UID of the Pod. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_POD_UID: Key = Key::from_static_str("k8s.pod.uid"); +pub const K8S_POD_UID: &str = "k8s.pod.uid"; /// The name of the Pod. /// /// # Examples /// /// - `opentelemetry-pod-autoconf` -pub const K8S_POD_NAME: Key = Key::from_static_str("k8s.pod.name"); +pub const K8S_POD_NAME: &str = "k8s.pod.name"; /// The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). /// /// # Examples /// /// - `redis` -pub const K8S_CONTAINER_NAME: Key = Key::from_static_str("k8s.container.name"); +pub const K8S_CONTAINER_NAME: &str = "k8s.container.name"; /// Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. /// @@ -574,94 +588,94 @@ pub const K8S_CONTAINER_NAME: Key = Key::from_static_str("k8s.container.name"); /// /// - `0` /// - `2` -pub const K8S_CONTAINER_RESTART_COUNT: Key = Key::from_static_str("k8s.container.restart_count"); +pub const K8S_CONTAINER_RESTART_COUNT: &str = "k8s.container.restart_count"; /// The UID of the ReplicaSet. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_REPLICASET_UID: Key = Key::from_static_str("k8s.replicaset.uid"); +pub const K8S_REPLICASET_UID: &str = "k8s.replicaset.uid"; /// The name of the ReplicaSet. /// /// # Examples /// /// - `opentelemetry` -pub const K8S_REPLICASET_NAME: Key = Key::from_static_str("k8s.replicaset.name"); +pub const K8S_REPLICASET_NAME: &str = "k8s.replicaset.name"; /// The UID of the Deployment. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_DEPLOYMENT_UID: Key = Key::from_static_str("k8s.deployment.uid"); +pub const K8S_DEPLOYMENT_UID: &str = "k8s.deployment.uid"; /// The name of the Deployment. /// /// # Examples /// /// - `opentelemetry` -pub const K8S_DEPLOYMENT_NAME: Key = Key::from_static_str("k8s.deployment.name"); +pub const K8S_DEPLOYMENT_NAME: &str = "k8s.deployment.name"; /// The UID of the StatefulSet. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_STATEFULSET_UID: Key = Key::from_static_str("k8s.statefulset.uid"); +pub const K8S_STATEFULSET_UID: &str = "k8s.statefulset.uid"; /// The name of the StatefulSet. /// /// # Examples /// /// - `opentelemetry` -pub const K8S_STATEFULSET_NAME: Key = Key::from_static_str("k8s.statefulset.name"); +pub const K8S_STATEFULSET_NAME: &str = "k8s.statefulset.name"; /// The UID of the DaemonSet. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_DAEMONSET_UID: Key = Key::from_static_str("k8s.daemonset.uid"); +pub const K8S_DAEMONSET_UID: &str = "k8s.daemonset.uid"; /// The name of the DaemonSet. /// /// # Examples /// /// - `opentelemetry` -pub const K8S_DAEMONSET_NAME: Key = Key::from_static_str("k8s.daemonset.name"); +pub const K8S_DAEMONSET_NAME: &str = "k8s.daemonset.name"; /// The UID of the Job. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_JOB_UID: Key = Key::from_static_str("k8s.job.uid"); +pub const K8S_JOB_UID: &str = "k8s.job.uid"; /// The name of the Job. /// /// # Examples /// /// - `opentelemetry` -pub const K8S_JOB_NAME: Key = Key::from_static_str("k8s.job.name"); +pub const K8S_JOB_NAME: &str = "k8s.job.name"; /// The UID of the CronJob. /// /// # Examples /// /// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_CRONJOB_UID: Key = Key::from_static_str("k8s.cronjob.uid"); +pub const K8S_CRONJOB_UID: &str = "k8s.cronjob.uid"; /// The name of the CronJob. /// /// # Examples /// /// - `opentelemetry` -pub const K8S_CRONJOB_NAME: Key = Key::from_static_str("k8s.cronjob.name"); +pub const K8S_CRONJOB_NAME: &str = "k8s.cronjob.name"; /// The operating system type. -pub const OS_TYPE: Key = Key::from_static_str("os.type"); +pub const OS_TYPE: &str = "os.type"; /// Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. /// @@ -669,7 +683,7 @@ pub const OS_TYPE: Key = Key::from_static_str("os.type"); /// /// - `Microsoft Windows [Version 10.0.18363.778]` /// - `Ubuntu 18.04.1 LTS` -pub const OS_DESCRIPTION: Key = Key::from_static_str("os.description"); +pub const OS_DESCRIPTION: &str = "os.description"; /// Human readable operating system name. /// @@ -678,7 +692,7 @@ pub const OS_DESCRIPTION: Key = Key::from_static_str("os.description"); /// - `iOS` /// - `Android` /// - `Ubuntu` -pub const OS_NAME: Key = Key::from_static_str("os.name"); +pub const OS_NAME: &str = "os.name"; /// The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). /// @@ -686,49 +700,49 @@ pub const OS_NAME: Key = Key::from_static_str("os.name"); /// /// - `14.2.1` /// - `18.04.1` -pub const OS_VERSION: Key = Key::from_static_str("os.version"); +pub const OS_VERSION: &str = "os.version"; /// Process identifier (PID). /// /// # Examples /// /// - `1234` -pub const PROCESS_PID: Key = Key::from_static_str("process.pid"); +pub const PROCESS_PID: &str = "process.pid"; /// Parent Process identifier (PID). /// /// # Examples /// /// - `111` -pub const PROCESS_PARENT_PID: Key = Key::from_static_str("process.parent_pid"); +pub const PROCESS_PARENT_PID: &str = "process.parent_pid"; /// 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`. /// /// # Examples /// /// - `otelcol` -pub const PROCESS_EXECUTABLE_NAME: Key = Key::from_static_str("process.executable.name"); +pub const PROCESS_EXECUTABLE_NAME: &str = "process.executable.name"; /// The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. /// /// # Examples /// /// - `/usr/bin/cmd/otelcol` -pub const PROCESS_EXECUTABLE_PATH: Key = Key::from_static_str("process.executable.path"); +pub const PROCESS_EXECUTABLE_PATH: &str = "process.executable.path"; /// The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. /// /// # Examples /// /// - `cmd/otelcol` -pub const PROCESS_COMMAND: Key = Key::from_static_str("process.command"); +pub const PROCESS_COMMAND: &str = "process.command"; /// The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. /// /// # Examples /// /// - `C:\cmd\otecol --config="my directory\config.yaml"` -pub const PROCESS_COMMAND_LINE: Key = Key::from_static_str("process.command_line"); +pub const PROCESS_COMMAND_LINE: &str = "process.command_line"; /// All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. /// @@ -736,35 +750,35 @@ pub const PROCESS_COMMAND_LINE: Key = Key::from_static_str("process.command_line /// /// - `cmd/otecol` /// - `--config=config.yaml` -pub const PROCESS_COMMAND_ARGS: Key = Key::from_static_str("process.command_args"); +pub const PROCESS_COMMAND_ARGS: &str = "process.command_args"; /// The username of the user that owns the process. /// /// # Examples /// /// - `root` -pub const PROCESS_OWNER: Key = Key::from_static_str("process.owner"); +pub const PROCESS_OWNER: &str = "process.owner"; /// The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. /// /// # Examples /// /// - `OpenJDK Runtime Environment` -pub const PROCESS_RUNTIME_NAME: Key = Key::from_static_str("process.runtime.name"); +pub const PROCESS_RUNTIME_NAME: &str = "process.runtime.name"; /// The version of the runtime of this process, as returned by the runtime without modification. /// /// # Examples /// /// - `14.0.2` -pub const PROCESS_RUNTIME_VERSION: Key = Key::from_static_str("process.runtime.version"); +pub const PROCESS_RUNTIME_VERSION: &str = "process.runtime.version"; /// An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. /// /// # Examples /// /// - `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` -pub const PROCESS_RUNTIME_DESCRIPTION: Key = Key::from_static_str("process.runtime.description"); +pub const PROCESS_RUNTIME_DESCRIPTION: &str = "process.runtime.description"; /// Logical name of the service. /// @@ -773,7 +787,7 @@ pub const PROCESS_RUNTIME_DESCRIPTION: Key = Key::from_static_str("process.runti /// # Examples /// /// - `shoppingcart` -pub const SERVICE_NAME: Key = Key::from_static_str("service.name"); +pub const SERVICE_NAME: &str = "service.name"; /// The version string of the service API or implementation. The format is not defined by these conventions. /// @@ -781,7 +795,7 @@ pub const SERVICE_NAME: Key = Key::from_static_str("service.name"); /// /// - `2.0.0` /// - `a01dbef8a` -pub const SERVICE_VERSION: Key = Key::from_static_str("service.version"); +pub const SERVICE_VERSION: &str = "service.version"; /// A namespace for `service.name`. /// @@ -790,7 +804,7 @@ pub const SERVICE_VERSION: Key = Key::from_static_str("service.version"); /// # Examples /// /// - `Shop` -pub const SERVICE_NAMESPACE: Key = Key::from_static_str("service.namespace"); +pub const SERVICE_NAMESPACE: &str = "service.namespace"; /// The string ID of the service instance. /// @@ -800,7 +814,7 @@ pub const SERVICE_NAMESPACE: Key = Key::from_static_str("service.namespace"); /// /// - `my-k8s-pod-deployment-1` /// - `627cc493-f310-47de-96bd-71410b7dec09` -pub const SERVICE_INSTANCE_ID: Key = Key::from_static_str("service.instance.id"); +pub const SERVICE_INSTANCE_ID: &str = "service.instance.id"; /// The name of the telemetry SDK as defined above. /// @@ -814,59 +828,59 @@ pub const SERVICE_INSTANCE_ID: Key = Key::from_static_str("service.instance.id") /// # Examples /// /// - `opentelemetry` -pub const TELEMETRY_SDK_NAME: Key = Key::from_static_str("telemetry.sdk.name"); +pub const TELEMETRY_SDK_NAME: &str = "telemetry.sdk.name"; /// The language of the telemetry SDK. -pub const TELEMETRY_SDK_LANGUAGE: Key = Key::from_static_str("telemetry.sdk.language"); +pub const TELEMETRY_SDK_LANGUAGE: &str = "telemetry.sdk.language"; /// The version string of the telemetry SDK. /// /// # Examples /// /// - `1.2.3` -pub const TELEMETRY_SDK_VERSION: Key = Key::from_static_str("telemetry.sdk.version"); +pub const TELEMETRY_SDK_VERSION: &str = "telemetry.sdk.version"; /// The version string of the auto instrumentation agent, if used. /// /// # Examples /// /// - `1.2.3` -pub const TELEMETRY_AUTO_VERSION: Key = Key::from_static_str("telemetry.auto.version"); +pub const TELEMETRY_AUTO_VERSION: &str = "telemetry.auto.version"; /// The name of the web engine. /// /// # Examples /// /// - `WildFly` -pub const WEBENGINE_NAME: Key = Key::from_static_str("webengine.name"); +pub const WEBENGINE_NAME: &str = "webengine.name"; /// The version of the web engine. /// /// # Examples /// /// - `21.0.0` -pub const WEBENGINE_VERSION: Key = Key::from_static_str("webengine.version"); +pub const WEBENGINE_VERSION: &str = "webengine.version"; /// Additional description of the web engine (e.g. detailed version and edition information). /// /// # Examples /// /// - `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` -pub const WEBENGINE_DESCRIPTION: Key = Key::from_static_str("webengine.description"); +pub const WEBENGINE_DESCRIPTION: &str = "webengine.description"; /// The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). /// /// # Examples /// /// - `io.opentelemetry.contrib.mongodb` -pub const OTEL_SCOPE_NAME: Key = Key::from_static_str("otel.scope.name"); +pub const OTEL_SCOPE_NAME: &str = "otel.scope.name"; /// The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). /// /// # Examples /// /// - `1.0.0` -pub const OTEL_SCOPE_VERSION: Key = Key::from_static_str("otel.scope.version"); +pub const OTEL_SCOPE_VERSION: &str = "otel.scope.version"; /// Deprecated, use the `otel.scope.name` attribute. /// @@ -874,7 +888,7 @@ pub const OTEL_SCOPE_VERSION: Key = Key::from_static_str("otel.scope.version"); /// /// - `io.opentelemetry.contrib.mongodb` #[deprecated] -pub const OTEL_LIBRARY_NAME: Key = Key::from_static_str("otel.library.name"); +pub const OTEL_LIBRARY_NAME: &str = "otel.library.name"; /// Deprecated, use the `otel.scope.version` attribute. /// @@ -882,4 +896,4 @@ pub const OTEL_LIBRARY_NAME: Key = Key::from_static_str("otel.library.name"); /// /// - `1.0.0` #[deprecated] -pub const OTEL_LIBRARY_VERSION: Key = Key::from_static_str("otel.library.version"); +pub const OTEL_LIBRARY_VERSION: &str = "otel.library.version"; diff --git a/opentelemetry-semantic-conventions/src/semconv/mod.rs b/opentelemetry-semantic-conventions/src/semconv/mod.rs new file mode 100644 index 0000000000..15a9774c50 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/semconv/mod.rs @@ -0,0 +1,2 @@ +pub mod resource; +pub mod trace; diff --git a/opentelemetry-semantic-conventions/src/semconv/resource.rs b/opentelemetry-semantic-conventions/src/semconv/resource.rs new file mode 100644 index 0000000000..c405682c26 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/semconv/resource.rs @@ -0,0 +1,882 @@ +// DO NOT EDIT, this is an auto-generated file +// +// If you want to update the file: +// - Edit the template at scripts/templates/semconv_semantic_attributes.rs.j2 +// - Run the script at scripts/generate-consts-from-spec.sh + +//! # Resource Semantic Conventions +//! +//! The [resource semantic conventions] define a set of standardized attributes +//! to be used in `Resource`s. +//! +//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource +//! +//! ## Usage +//! +//! ``` +//! use opentelemetry_semantic_conventions::semconv; +//! use tracing::span; +//! +//! let span = span!( +//! LEVEL::INFO, +//! "handle_request", +//! { semconv::resource::SERVICE_NAME = "my-service" }, +//! { semconv::resource::SERVICE_NAMESPACE = "my-namespace" } +//! ); +//! ``` + +/// Array of brand name and version separated by a space. +/// +/// This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). +/// +/// # Examples +/// +/// - ` Not A;Brand 99` +/// - `Chromium 99` +/// - `Chrome 99` +pub const BROWSER_BRANDS: &str = "browser.brands"; + +/// The platform on which the browser is running. +/// +/// 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. +/// +/// # Examples +/// +/// - `Windows` +/// - `macOS` +/// - `Android` +pub const BROWSER_PLATFORM: &str = "browser.platform"; + +/// A boolean that is true if the browser is running on a mobile device. +/// +/// 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. +pub const BROWSER_MOBILE: &str = "browser.mobile"; + +/// Preferred language of the user using the browser. +/// +/// This value is intended to be taken from the Navigator API `navigator.language`. +/// +/// # Examples +/// +/// - `en` +/// - `en-US` +/// - `fr` +/// - `fr-FR` +pub const BROWSER_LANGUAGE: &str = "browser.language"; + +/// Name of the cloud provider. +pub const CLOUD_PROVIDER: &str = "cloud.provider"; + +/// The cloud account ID the resource is assigned to. +/// +/// # Examples +/// +/// - `111111111111` +/// - `opentelemetry` +pub const CLOUD_ACCOUNT_ID: &str = "cloud.account.id"; + +/// The geographical region the resource is running. +/// +/// 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). +/// +/// # Examples +/// +/// - `us-central1` +/// - `us-east-1` +pub const CLOUD_REGION: &str = "cloud.region"; + +/// 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). +/// +/// 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/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`. +/// This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share +/// a TracerProvider. +/// +/// # Examples +/// +/// - `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function` +/// - `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID` +/// - `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/` +pub const CLOUD_RESOURCE_ID: &str = "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. +/// +/// Availability zones are called "zones" on Alibaba Cloud and Google Cloud. +/// +/// # Examples +/// +/// - `us-east-1c` +pub const CLOUD_AVAILABILITY_ZONE: &str = "cloud.availability_zone"; + +/// The cloud platform in use. +/// +/// The prefix of the service SHOULD match the one specified in `cloud.provider`. +pub const CLOUD_PLATFORM: &str = "cloud.platform"; + +/// The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +/// +/// # Examples +/// +/// - `arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9` +pub const AWS_ECS_CONTAINER_ARN: &str = "aws.ecs.container.arn"; + +/// The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +/// +/// # Examples +/// +/// - `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` +pub const AWS_ECS_CLUSTER_ARN: &str = "aws.ecs.cluster.arn"; + +/// The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +pub const AWS_ECS_LAUNCHTYPE: &str = "aws.ecs.launchtype"; + +/// The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +/// +/// # Examples +/// +/// - `arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b` +pub const AWS_ECS_TASK_ARN: &str = "aws.ecs.task.arn"; + +/// The task definition family this task definition is a member of. +/// +/// # Examples +/// +/// - `opentelemetry-family` +pub const AWS_ECS_TASK_FAMILY: &str = "aws.ecs.task.family"; + +/// The revision for this task definition. +/// +/// # Examples +/// +/// - `8` +/// - `26` +pub const AWS_ECS_TASK_REVISION: &str = "aws.ecs.task.revision"; + +/// The ARN of an EKS cluster. +/// +/// # Examples +/// +/// - `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` +pub const AWS_EKS_CLUSTER_ARN: &str = "aws.eks.cluster.arn"; + +/// The name(s) of the AWS log group(s) an application is writing to. +/// +/// Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. +/// +/// # Examples +/// +/// - `/aws/lambda/my-function` +/// - `opentelemetry-service` +pub const AWS_LOG_GROUP_NAMES: &str = "aws.log.group.names"; + +/// The Amazon Resource Name(s) (ARN) of the AWS log group(s). +/// +/// See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). +/// +/// # Examples +/// +/// - `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*` +pub const AWS_LOG_GROUP_ARNS: &str = "aws.log.group.arns"; + +/// The name(s) of the AWS log stream(s) an application is writing to. +/// +/// # Examples +/// +/// - `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` +pub const AWS_LOG_STREAM_NAMES: &str = "aws.log.stream.names"; + +/// The ARN(s) of the AWS log stream(s). +/// +/// 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. +/// +/// # Examples +/// +/// - `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` +pub const AWS_LOG_STREAM_ARNS: &str = "aws.log.stream.arns"; + +/// The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +/// +/// # Examples +/// +/// - `job-name-xxxx` +/// - `sample-job-mdw84` +pub const GCP_CLOUD_RUN_JOB_EXECUTION: &str = "gcp.cloud_run.job.execution"; + +/// The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +/// +/// # Examples +/// +/// - `0` +/// - `1` +pub const GCP_CLOUD_RUN_JOB_TASK_INDEX: &str = "gcp.cloud_run.job.task_index"; + +/// The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +/// +/// # Examples +/// +/// - `instance-1` +/// - `my-vm-name` +pub const GCP_GCE_INSTANCE_NAME: &str = "gcp.gce.instance.name"; + +/// The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +/// +/// # Examples +/// +/// - `my-host1234.example.com` +/// - `sample-vm.us-west1-b.c.my-project.internal` +pub const GCP_GCE_INSTANCE_HOSTNAME: &str = "gcp.gce.instance.hostname"; + +/// Time and date the release was created. +/// +/// # Examples +/// +/// - `2022-10-23T18:00:42Z` +pub const HEROKU_RELEASE_CREATION_TIMESTAMP: &str = "heroku.release.creation_timestamp"; + +/// Commit hash for the current release. +/// +/// # Examples +/// +/// - `e6134959463efd8966b20e75b913cafe3f5ec` +pub const HEROKU_RELEASE_COMMIT: &str = "heroku.release.commit"; + +/// Unique identifier for the application. +/// +/// # Examples +/// +/// - `2daa2797-e42b-4624-9322-ec3f968df4da` +pub const HEROKU_APP_ID: &str = "heroku.app.id"; + +/// Container name used by container runtime. +/// +/// # Examples +/// +/// - `opentelemetry-autoconf` +pub const CONTAINER_NAME: &str = "container.name"; + +/// Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +/// +/// # Examples +/// +/// - `a3bf90e006b2` +pub const CONTAINER_ID: &str = "container.id"; + +/// The container runtime managing this container. +/// +/// # Examples +/// +/// - `docker` +/// - `containerd` +/// - `rkt` +pub const CONTAINER_RUNTIME: &str = "container.runtime"; + +/// Name of the image the container was built on. +/// +/// # Examples +/// +/// - `gcr.io/opentelemetry/operator` +pub const CONTAINER_IMAGE_NAME: &str = "container.image.name"; + +/// Container image tag. +/// +/// # Examples +/// +/// - `0.1` +pub const CONTAINER_IMAGE_TAG: &str = "container.image.tag"; + +/// Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +/// +/// Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. +/// K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. +/// OCI defines a digest of manifest. +/// +/// # Examples +/// +/// - `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` +pub const CONTAINER_IMAGE_ID: &str = "container.image.id"; + +/// The command used to run the container (i.e. the command name). +/// +/// If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. +/// +/// # Examples +/// +/// - `otelcontribcol` +pub const CONTAINER_COMMAND: &str = "container.command"; + +/// The full command run by the container as a single string representing the full command. [2]. +/// +/// # Examples +/// +/// - `otelcontribcol --config config.yaml` +pub const CONTAINER_COMMAND_LINE: &str = "container.command_line"; + +/// All the command arguments (including the command/executable itself) run by the container. [2]. +/// +/// # Examples +/// +/// - `otelcontribcol, --config, config.yaml` +pub const CONTAINER_COMMAND_ARGS: &str = "container.command_args"; + +/// Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +/// +/// # Examples +/// +/// - `staging` +/// - `production` +pub const DEPLOYMENT_ENVIRONMENT: &str = "deployment.environment"; + +/// A unique identifier representing the device. +/// +/// The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. +/// +/// # Examples +/// +/// - `2ab2916d-a51f-4ac8-80ee-45ac31a28092` +pub const DEVICE_ID: &str = "device.id"; + +/// The model identifier for the device. +/// +/// It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. +/// +/// # Examples +/// +/// - `iPhone3,4` +/// - `SM-G920F` +pub const DEVICE_MODEL_IDENTIFIER: &str = "device.model.identifier"; + +/// The marketing name for the device model. +/// +/// It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. +/// +/// # Examples +/// +/// - `iPhone 6s Plus` +/// - `Samsung Galaxy S6` +pub const DEVICE_MODEL_NAME: &str = "device.model.name"; + +/// The name of the device manufacturer. +/// +/// The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. +/// +/// # Examples +/// +/// - `Apple` +/// - `Samsung` +pub const DEVICE_MANUFACTURER: &str = "device.manufacturer"; + +/// The name of the single function that this runtime instance executes. +/// +/// 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`](/docs/general/general-attributes.md#source-code-attributes) +/// span attributes). +/// +/// 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: +/// +/// * **Azure:** The full name `<FUNCAPP>/<FUNC>`, 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). +/// +/// # Examples +/// +/// - `my-function` +/// - `myazurefunctionapp/some-function-name` +pub const FAAS_NAME: &str = "faas.name"; + +/// The immutable version of the function being executed. +/// +/// Depending on the cloud provider and platform, use: +/// +/// * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) +/// (an integer represented as a decimal string). +/// * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) +/// (i.e., the function name plus the revision suffix). +/// * **Google Cloud Functions:** The value of the +/// [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). +/// * **Azure Functions:** Not applicable. Do not set this attribute. +/// +/// # Examples +/// +/// - `26` +/// - `pinkfroid-00002` +pub const FAAS_VERSION: &str = "faas.version"; + +/// The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +/// +/// * **AWS Lambda:** Use the (full) log stream name. +/// +/// # Examples +/// +/// - `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` +pub const FAAS_INSTANCE: &str = "faas.instance"; + +/// The amount of memory available to the serverless function converted to Bytes. +/// +/// 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). +/// +/// # Examples +/// +/// - `134217728` +pub const FAAS_MAX_MEMORY: &str = "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 `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +/// +/// # Examples +/// +/// - `fdbf79e8af94cb7f9e8df36789187052` +pub const HOST_ID: &str = "host.id"; + +/// Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +/// +/// # Examples +/// +/// - `opentelemetry-test` +pub const HOST_NAME: &str = "host.name"; + +/// Type of host. For Cloud, this must be the machine type. +/// +/// # Examples +/// +/// - `n1-standard-1` +pub const HOST_TYPE: &str = "host.type"; + +/// The CPU architecture the host system is running on. +pub const HOST_ARCH: &str = "host.arch"; + +/// Name of the VM image or OS install the host was instantiated from. +/// +/// # Examples +/// +/// - `infra-ami-eks-worker-node-7d4ec78312` +/// - `CentOS-8-x86_64-1905` +pub const HOST_IMAGE_NAME: &str = "host.image.name"; + +/// VM image ID or host OS image ID. For Cloud, this value is from the provider. +/// +/// # Examples +/// +/// - `ami-07b06b442921831e5` +pub const HOST_IMAGE_ID: &str = "host.image.id"; + +/// The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). +/// +/// # Examples +/// +/// - `0.1` +pub const HOST_IMAGE_VERSION: &str = "host.image.version"; + +/// The name of the cluster. +/// +/// # Examples +/// +/// - `opentelemetry-cluster` +pub const K8S_CLUSTER_NAME: &str = "k8s.cluster.name"; + +/// A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +/// +/// K8s does not have support for obtaining a cluster ID. If this is ever +/// added, we will recommend collecting the `k8s.cluster.uid` through the +/// official APIs. In the meantime, we are able to use the `uid` of the +/// `kube-system` namespace as a proxy for cluster ID. Read on for the +/// rationale. +/// +/// Every object created in a K8s cluster is assigned a distinct UID. The +/// `kube-system` namespace is used by Kubernetes itself and will exist +/// for the lifetime of the cluster. Using the `uid` of the `kube-system` +/// namespace is a reasonable proxy for the K8s ClusterID as it will only +/// change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are +/// UUIDs as standardized by +/// [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). +/// Which states: +/// +/// > If generated according to one of the mechanisms defined in Rec. +/// ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be +/// different from all other UUIDs generated before 3603 A.D., or is +/// extremely likely to be different (depending on the mechanism chosen). +/// +/// Therefore, UIDs between clusters should be extremely unlikely to +/// conflict. +/// +/// # Examples +/// +/// - `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` +pub const K8S_CLUSTER_UID: &str = "k8s.cluster.uid"; + +/// The name of the Node. +/// +/// # Examples +/// +/// - `node-1` +pub const K8S_NODE_NAME: &str = "k8s.node.name"; + +/// The UID of the Node. +/// +/// # Examples +/// +/// - `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` +pub const K8S_NODE_UID: &str = "k8s.node.uid"; + +/// The name of the namespace that the pod is running in. +/// +/// # Examples +/// +/// - `default` +pub const K8S_NAMESPACE_NAME: &str = "k8s.namespace.name"; + +/// The UID of the Pod. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_POD_UID: &str = "k8s.pod.uid"; + +/// The name of the Pod. +/// +/// # Examples +/// +/// - `opentelemetry-pod-autoconf` +pub const K8S_POD_NAME: &str = "k8s.pod.name"; + +/// The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +/// +/// # Examples +/// +/// - `redis` +pub const K8S_CONTAINER_NAME: &str = "k8s.container.name"; + +/// Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +/// +/// # Examples +/// +/// - `0` +/// - `2` +pub const K8S_CONTAINER_RESTART_COUNT: &str = "k8s.container.restart_count"; + +/// The UID of the ReplicaSet. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_REPLICASET_UID: &str = "k8s.replicaset.uid"; + +/// The name of the ReplicaSet. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const K8S_REPLICASET_NAME: &str = "k8s.replicaset.name"; + +/// The UID of the Deployment. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_DEPLOYMENT_UID: &str = "k8s.deployment.uid"; + +/// The name of the Deployment. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const K8S_DEPLOYMENT_NAME: &str = "k8s.deployment.name"; + +/// The UID of the StatefulSet. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_STATEFULSET_UID: &str = "k8s.statefulset.uid"; + +/// The name of the StatefulSet. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const K8S_STATEFULSET_NAME: &str = "k8s.statefulset.name"; + +/// The UID of the DaemonSet. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_DAEMONSET_UID: &str = "k8s.daemonset.uid"; + +/// The name of the DaemonSet. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const K8S_DAEMONSET_NAME: &str = "k8s.daemonset.name"; + +/// The UID of the Job. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_JOB_UID: &str = "k8s.job.uid"; + +/// The name of the Job. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const K8S_JOB_NAME: &str = "k8s.job.name"; + +/// The UID of the CronJob. +/// +/// # Examples +/// +/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` +pub const K8S_CRONJOB_UID: &str = "k8s.cronjob.uid"; + +/// The name of the CronJob. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const K8S_CRONJOB_NAME: &str = "k8s.cronjob.name"; + +/// The operating system type. +pub const OS_TYPE: &str = "os.type"; + +/// Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. +/// +/// # Examples +/// +/// - `Microsoft Windows [Version 10.0.18363.778]` +/// - `Ubuntu 18.04.1 LTS` +pub const OS_DESCRIPTION: &str = "os.description"; + +/// Human readable operating system name. +/// +/// # Examples +/// +/// - `iOS` +/// - `Android` +/// - `Ubuntu` +pub const OS_NAME: &str = "os.name"; + +/// The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +/// +/// # Examples +/// +/// - `14.2.1` +/// - `18.04.1` +pub const OS_VERSION: &str = "os.version"; + +/// Process identifier (PID). +/// +/// # Examples +/// +/// - `1234` +pub const PROCESS_PID: &str = "process.pid"; + +/// Parent Process identifier (PID). +/// +/// # Examples +/// +/// - `111` +pub const PROCESS_PARENT_PID: &str = "process.parent_pid"; + +/// 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`. +/// +/// # Examples +/// +/// - `otelcol` +pub const PROCESS_EXECUTABLE_NAME: &str = "process.executable.name"; + +/// The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +/// +/// # Examples +/// +/// - `/usr/bin/cmd/otelcol` +pub const PROCESS_EXECUTABLE_PATH: &str = "process.executable.path"; + +/// The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +/// +/// # Examples +/// +/// - `cmd/otelcol` +pub const PROCESS_COMMAND: &str = "process.command"; + +/// The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +/// +/// # Examples +/// +/// - `C:\cmd\otecol --config="my directory\config.yaml"` +pub const PROCESS_COMMAND_LINE: &str = "process.command_line"; + +/// All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +/// +/// # Examples +/// +/// - `cmd/otecol` +/// - `--config=config.yaml` +pub const PROCESS_COMMAND_ARGS: &str = "process.command_args"; + +/// The username of the user that owns the process. +/// +/// # Examples +/// +/// - `root` +pub const PROCESS_OWNER: &str = "process.owner"; + +/// The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +/// +/// # Examples +/// +/// - `OpenJDK Runtime Environment` +pub const PROCESS_RUNTIME_NAME: &str = "process.runtime.name"; + +/// The version of the runtime of this process, as returned by the runtime without modification. +/// +/// # Examples +/// +/// - `14.0.2` +pub const PROCESS_RUNTIME_VERSION: &str = "process.runtime.version"; + +/// An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +/// +/// # Examples +/// +/// - `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` +pub const PROCESS_RUNTIME_DESCRIPTION: &str = "process.runtime.description"; + +/// Logical name of the service. +/// +/// MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. +/// +/// # Examples +/// +/// - `shoppingcart` +pub const SERVICE_NAME: &str = "service.name"; + +/// The version string of the service API or implementation. The format is not defined by these conventions. +/// +/// # Examples +/// +/// - `2.0.0` +/// - `a01dbef8a` +pub const SERVICE_VERSION: &str = "service.version"; + +/// A namespace for `service.name`. +/// +/// A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. +/// +/// # Examples +/// +/// - `Shop` +pub const SERVICE_NAMESPACE: &str = "service.namespace"; + +/// The string ID of the service instance. +/// +/// MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). +/// +/// # Examples +/// +/// - `my-k8s-pod-deployment-1` +/// - `627cc493-f310-47de-96bd-71410b7dec09` +pub const SERVICE_INSTANCE_ID: &str = "service.instance.id"; + +/// The name of the telemetry SDK as defined above. +/// +/// The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. +/// If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the +/// `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point +/// or another suitable identifier depending on the language. +/// The identifier `opentelemetry` is reserved and MUST NOT be used in this case. +/// All custom identifiers SHOULD be stable across different versions of an implementation. +/// +/// # Examples +/// +/// - `opentelemetry` +pub const TELEMETRY_SDK_NAME: &str = "telemetry.sdk.name"; + +/// The language of the telemetry SDK. +pub const TELEMETRY_SDK_LANGUAGE: &str = "telemetry.sdk.language"; + +/// The version string of the telemetry SDK. +/// +/// # Examples +/// +/// - `1.2.3` +pub const TELEMETRY_SDK_VERSION: &str = "telemetry.sdk.version"; + +/// The version string of the auto instrumentation agent, if used. +/// +/// # Examples +/// +/// - `1.2.3` +pub const TELEMETRY_AUTO_VERSION: &str = "telemetry.auto.version"; + +/// The name of the web engine. +/// +/// # Examples +/// +/// - `WildFly` +pub const WEBENGINE_NAME: &str = "webengine.name"; + +/// The version of the web engine. +/// +/// # Examples +/// +/// - `21.0.0` +pub const WEBENGINE_VERSION: &str = "webengine.version"; + +/// Additional description of the web engine (e.g. detailed version and edition information). +/// +/// # Examples +/// +/// - `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` +pub const WEBENGINE_DESCRIPTION: &str = "webengine.description"; + +/// The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +/// +/// # Examples +/// +/// - `io.opentelemetry.contrib.mongodb` +pub const OTEL_SCOPE_NAME: &str = "otel.scope.name"; + +/// The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +/// +/// # Examples +/// +/// - `1.0.0` +pub const OTEL_SCOPE_VERSION: &str = "otel.scope.version"; + +/// Deprecated, use the `otel.scope.name` attribute. +/// +/// # Examples +/// +/// - `io.opentelemetry.contrib.mongodb` +#[deprecated] +pub const OTEL_LIBRARY_NAME: &str = "otel.library.name"; + +/// Deprecated, use the `otel.scope.version` attribute. +/// +/// # Examples +/// +/// - `1.0.0` +#[deprecated] +pub const OTEL_LIBRARY_VERSION: &str = "otel.library.version"; \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/semconv/trace.rs b/opentelemetry-semantic-conventions/src/semconv/trace.rs new file mode 100644 index 0000000000..ae24542d7d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/semconv/trace.rs @@ -0,0 +1,1599 @@ +// DO NOT EDIT, this is an auto-generated file +// +// If you want to update the file: +// - Edit the template at scripts/templates/semconv_semantic_attributes.rs.j2 +// - Run the script at scripts/generate-consts-from-spec.sh + +//! # Trace Semantic Conventions +//! +//! The [trace semantic conventions] define a set of standardized attributes to +//! be used in `Span`s. +//! +//! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace +//! +//! ## Usage +//! +//! ``` +//! use opentelemetry_semantic_conventions::semconv; +//! use tracing::span; +//! +//! let span = span!( +//! LEVEL::INFO, +//! "handle_request", +//! { semconv::trace::NET_PEER_NAME = "example.org" }, +//! { semconv::trace::NET_PEER_PORT = 80 } +//! ); +//! ``` + +/// Client address - unix domain socket name, IPv4 or IPv6 address. +/// +/// When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent client address behind any intermediaries (e.g. proxies) if it's available. +/// +/// # Examples +/// +/// - `/tmp/my.sock` +/// - `10.1.2.80` +pub const CLIENT_ADDRESS: &str = "client.address"; + +/// Client port number. +/// +/// When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent client port behind any intermediaries (e.g. proxies) if it's available. +/// +/// # Examples +/// +/// - `65123` +pub const CLIENT_PORT: &str = "client.port"; + +/// Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. +/// +/// # Examples +/// +/// - `/tmp/my.sock` +/// - `127.0.0.1` +pub const CLIENT_SOCKET_ADDRESS: &str = "client.socket.address"; + +/// Immediate client peer port number. +/// +/// # Examples +/// +/// - `35555` +pub const CLIENT_SOCKET_PORT: &str = "client.socket.port"; + +/// Deprecated, use `http.request.method` instead. +/// +/// # Examples +/// +/// - `GET` +/// - `POST` +/// - `HEAD` +#[deprecated] +pub const HTTP_METHOD: &str = "http.method"; + +/// Deprecated, use `http.response.status_code` instead. +/// +/// # Examples +/// +/// - `200` +#[deprecated] +pub const HTTP_STATUS_CODE: &str = "http.status_code"; + +/// Deprecated, use `url.scheme` instead. +/// +/// # Examples +/// +/// - `http` +/// - `https` +#[deprecated] +pub const HTTP_SCHEME: &str = "http.scheme"; + +/// Deprecated, use `url.full` instead. +/// +/// # Examples +/// +/// - `https://www.foo.bar/search?q=OpenTelemetry#SemConv` +#[deprecated] +pub const HTTP_URL: &str = "http.url"; + +/// Deprecated, use `url.path` and `url.query` instead. +/// +/// # Examples +/// +/// - `/search?q=OpenTelemetry#SemConv` +#[deprecated] +pub const HTTP_TARGET: &str = "http.target"; + +/// Deprecated, use `http.request.body.size` instead. +/// +/// # Examples +/// +/// - `3495` +#[deprecated] +pub const HTTP_REQUEST_CONTENT_LENGTH: &str = "http.request_content_length"; + +/// Deprecated, use `http.response.body.size` instead. +/// +/// # Examples +/// +/// - `3495` +#[deprecated] +pub const HTTP_RESPONSE_CONTENT_LENGTH: &str = "http.response_content_length"; + +/// Deprecated, use `server.socket.domain` on client spans. +/// +/// # Examples +/// +/// - `/var/my.sock` +#[deprecated] +pub const NET_SOCK_PEER_NAME: &str = "net.sock.peer.name"; + +/// Deprecated, use `server.socket.address` on client spans and `client.socket.address` on server spans. +/// +/// # Examples +/// +/// - `192.168.0.1` +#[deprecated] +pub const NET_SOCK_PEER_ADDR: &str = "net.sock.peer.addr"; + +/// Deprecated, use `server.socket.port` on client spans and `client.socket.port` on server spans. +/// +/// # Examples +/// +/// - `65531` +#[deprecated] +pub const NET_SOCK_PEER_PORT: &str = "net.sock.peer.port"; + +/// Deprecated, use `server.address` on client spans and `client.address` on server spans. +/// +/// # Examples +/// +/// - `example.com` +#[deprecated] +pub const NET_PEER_NAME: &str = "net.peer.name"; + +/// Deprecated, use `server.port` on client spans and `client.port` on server spans. +/// +/// # Examples +/// +/// - `8080` +#[deprecated] +pub const NET_PEER_PORT: &str = "net.peer.port"; + +/// Deprecated, use `server.address`. +/// +/// # Examples +/// +/// - `example.com` +#[deprecated] +pub const NET_HOST_NAME: &str = "net.host.name"; + +/// Deprecated, use `server.port`. +/// +/// # Examples +/// +/// - `8080` +#[deprecated] +pub const NET_HOST_PORT: &str = "net.host.port"; + +/// Deprecated, use `server.socket.address`. +/// +/// # Examples +/// +/// - `/var/my.sock` +#[deprecated] +pub const NET_SOCK_HOST_ADDR: &str = "net.sock.host.addr"; + +/// Deprecated, use `server.socket.port`. +/// +/// # Examples +/// +/// - `8080` +#[deprecated] +pub const NET_SOCK_HOST_PORT: &str = "net.sock.host.port"; + +/// Deprecated, use `network.transport`. +#[deprecated] +pub const NET_TRANSPORT: &str = "net.transport"; + +/// Deprecated, use `network.protocol.name`. +/// +/// # Examples +/// +/// - `amqp` +/// - `http` +/// - `mqtt` +#[deprecated] +pub const NET_PROTOCOL_NAME: &str = "net.protocol.name"; + +/// Deprecated, use `network.protocol.version`. +/// +/// # Examples +/// +/// - `3.1.1` +#[deprecated] +pub const NET_PROTOCOL_VERSION: &str = "net.protocol.version"; + +/// Deprecated, use `network.transport` and `network.type`. +#[deprecated] +pub const NET_SOCK_FAMILY: &str = "net.sock.family"; + +/// The domain name of the destination system. +/// +/// This value may be a host name, a fully qualified domain name, or another host naming format. +/// +/// # Examples +/// +/// - `foo.example.com` +pub const DESTINATION_DOMAIN: &str = "destination.domain"; + +/// Peer address, for example IP address or UNIX socket name. +/// +/// # Examples +/// +/// - `10.5.3.2` +pub const DESTINATION_ADDRESS: &str = "destination.address"; + +/// Peer port number. +/// +/// # Examples +/// +/// - `3389` +/// - `2888` +pub const DESTINATION_PORT: &str = "destination.port"; + +/// 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. +/// +/// # Examples +/// +/// - `java.net.ConnectException` +/// - `OSError` +pub const EXCEPTION_TYPE: &str = "exception.type"; + +/// The exception message. +/// +/// # Examples +/// +/// - `Division by zero` +/// - `Can't convert 'int' object to str implicitly` +pub const EXCEPTION_MESSAGE: &str = "exception.message"; + +/// A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +/// +/// # Examples +/// +/// - `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` +pub const EXCEPTION_STACKTRACE: &str = "exception.stacktrace"; + +/// HTTP request method. +/// +/// HTTP request method value SHOULD be "known" to the instrumentation. +/// By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) +/// and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). +/// +/// If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER` and, except if reporting a metric, MUST +/// set the exact method received in the request line as value of the `http.request.method_original` attribute. +/// +/// If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override +/// the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named +/// OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods +/// (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). +/// +/// HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. +/// Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. +/// Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. +/// +/// # Examples +/// +/// - `GET` +/// - `POST` +/// - `HEAD` +pub const HTTP_REQUEST_METHOD: &str = "http.request.method"; + +/// [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +/// +/// # Examples +/// +/// - `200` +pub const HTTP_RESPONSE_STATUS_CODE: &str = "http.response.status_code"; + +/// The matched route (path template in the format used by the respective server framework). See note below. +/// +/// 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](/docs/http/http-spans.md#http-server-definitions) if there is one. +/// +/// # Examples +/// +/// - `/users/:userID?` +/// - `{controller}/{action}/{id?}` +pub const HTTP_ROUTE: &str = "http.route"; + +/// The name identifies the event. +/// +/// # Examples +/// +/// - `click` +/// - `exception` +pub const EVENT_NAME: &str = "event.name"; + +/// The domain identifies the business context for the events. +/// +/// Events across different domains may have same `event.name`, yet be +/// unrelated events. +pub const EVENT_DOMAIN: &str = "event.domain"; + +/// A unique identifier for the Log Record. +/// +/// If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. +/// The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. +/// +/// # Examples +/// +/// - `01ARZ3NDEKTSV4RRFFQ69G5FAV` +pub const LOG_RECORD_UID: &str = "log.record.uid"; + +/// The stream associated with the log. See below for a list of well-known values. +pub const LOG_IOSTREAM: &str = "log.iostream"; + +/// The basename of the file. +/// +/// # Examples +/// +/// - `audit.log` +pub const LOG_FILE_NAME: &str = "log.file.name"; + +/// The full path to the file. +/// +/// # Examples +/// +/// - `/var/log/mysql/audit.log` +pub const LOG_FILE_PATH: &str = "log.file.path"; + +/// The basename of the file, with symlinks resolved. +/// +/// # Examples +/// +/// - `uuid.log` +pub const LOG_FILE_NAME_RESOLVED: &str = "log.file.name_resolved"; + +/// The full path to the file, with symlinks resolved. +/// +/// # Examples +/// +/// - `/var/lib/docker/uuid.log` +pub const LOG_FILE_PATH_RESOLVED: &str = "log.file.path_resolved"; + +/// The type of memory. +/// +/// # Examples +/// +/// - `heap` +/// - `non_heap` +pub const TYPE: &str = "type"; + +/// Name of the memory pool. +/// +/// Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). +/// +/// # Examples +/// +/// - `G1 Old Gen` +/// - `G1 Eden space` +/// - `G1 Survivor Space` +pub const POOL: &str = "pool"; + +/// Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is not known. +/// +/// # Examples +/// +/// - `example.com` +pub const SERVER_ADDRESS: &str = "server.address"; + +/// Logical server port number. +/// +/// # Examples +/// +/// - `80` +/// - `8080` +/// - `443` +pub const SERVER_PORT: &str = "server.port"; + +/// The domain name of an immediate peer. +/// +/// Typically observed from the client side, and represents a proxy or other intermediary domain name. +/// +/// # Examples +/// +/// - `proxy.example.com` +pub const SERVER_SOCKET_DOMAIN: &str = "server.socket.domain"; + +/// Physical server IP address or Unix socket address. If set from the client, should simply use the socket's peer address, and not attempt to find any actual server IP (i.e., if set from client, this may represent some proxy server instead of the logical server). +/// +/// # Examples +/// +/// - `10.5.3.2` +pub const SERVER_SOCKET_ADDRESS: &str = "server.socket.address"; + +/// Physical server port. +/// +/// # Examples +/// +/// - `16456` +pub const SERVER_SOCKET_PORT: &str = "server.socket.port"; + +/// The domain name of the source system. +/// +/// This value may be a host name, a fully qualified domain name, or another host naming format. +/// +/// # Examples +/// +/// - `foo.example.com` +pub const SOURCE_DOMAIN: &str = "source.domain"; + +/// Source address, for example IP address or Unix socket name. +/// +/// # Examples +/// +/// - `10.5.3.2` +pub const SOURCE_ADDRESS: &str = "source.address"; + +/// Source port number. +/// +/// # Examples +/// +/// - `3389` +/// - `2888` +pub const SOURCE_PORT: &str = "source.port"; + +/// 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). +/// +/// This may be different from `cloud.resource_id` if an alias is involved. +/// +/// # Examples +/// +/// - `arn:aws:lambda:us-east-1:123456:function:myfunction:myalias` +pub const AWS_LAMBDA_INVOKED_ARN: &str = "aws.lambda.invoked_arn"; + +/// The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +/// +/// # Examples +/// +/// - `123e4567-e89b-12d3-a456-426614174000` +/// - `0001` +pub const CLOUDEVENTS_EVENT_ID: &str = "cloudevents.event_id"; + +/// The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +/// +/// # Examples +/// +/// - `https://github.com/cloudevents` +/// - `/cloudevents/spec/pull/123` +/// - `my-service` +pub const CLOUDEVENTS_EVENT_SOURCE: &str = "cloudevents.event_source"; + +/// The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +/// +/// # Examples +/// +/// - `1.0` +pub const CLOUDEVENTS_EVENT_SPEC_VERSION: &str = "cloudevents.event_spec_version"; + +/// The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +/// +/// # Examples +/// +/// - `com.github.pull_request.opened` +/// - `com.example.object.deleted.v2` +pub const CLOUDEVENTS_EVENT_TYPE: &str = "cloudevents.event_type"; + +/// The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +/// +/// # Examples +/// +/// - `mynewfile.jpg` +pub const CLOUDEVENTS_EVENT_SUBJECT: &str = "cloudevents.event_subject"; + +/// Parent-child Reference type. +/// +/// The causal relationship between a child Span and a parent Span. +pub const OPENTRACING_REF_TYPE: &str = "opentracing.ref_type"; + +/// An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +pub const DB_SYSTEM: &str = "db.system"; + +/// The connection string used to connect to the database. It is recommended to remove embedded credentials. +/// +/// # Examples +/// +/// - `Server=(localdb)\v11.0;Integrated Security=true;` +pub const DB_CONNECTION_STRING: &str = "db.connection_string"; + +/// Username for accessing the database. +/// +/// # Examples +/// +/// - `readonly_user` +/// - `reporting_user` +pub const DB_USER: &str = "db.user"; + +/// The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. +/// +/// # Examples +/// +/// - `org.postgresql.Driver` +/// - `com.microsoft.sqlserver.jdbc.SQLServerDriver` +pub const DB_JDBC_DRIVER_CLASSNAME: &str = "db.jdbc.driver_classname"; + +/// This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +/// +/// In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +/// +/// # Examples +/// +/// - `customers` +/// - `main` +pub const DB_NAME: &str = "db.name"; + +/// The database statement being executed. +/// +/// # Examples +/// +/// - `SELECT * FROM wuser_table` +/// - `SET mykey "WuValue"` +pub const DB_STATEMENT: &str = "db.statement"; + +/// The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +/// +/// 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. +/// +/// # Examples +/// +/// - `findAndModify` +/// - `HMSET` +/// - `SELECT` +pub const DB_OPERATION: &str = "db.operation"; + +/// The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +/// +/// If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). +/// +/// # Examples +/// +/// - `MSSQLSERVER` +pub const DB_MSSQL_INSTANCE_NAME: &str = "db.mssql.instance_name"; + +/// The fetch size used for paging, i.e. how many rows will be returned at once. +/// +/// # Examples +/// +/// - `5000` +pub const DB_CASSANDRA_PAGE_SIZE: &str = "db.cassandra.page_size"; + +/// The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +pub const DB_CASSANDRA_CONSISTENCY_LEVEL: &str = "db.cassandra.consistency_level"; + +/// The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). +/// +/// This mirrors the db.sql.table attribute but references cassandra rather than sql. 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. +/// +/// # Examples +/// +/// - `mytable` +pub const DB_CASSANDRA_TABLE: &str = "db.cassandra.table"; + +/// Whether or not the query is idempotent. +pub const DB_CASSANDRA_IDEMPOTENCE: &str = "db.cassandra.idempotence"; + +/// The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +/// +/// # Examples +/// +/// - `0` +/// - `2` +pub const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: &str = "db.cassandra.speculative_execution_count"; + +/// The ID of the coordinating node for a query. +/// +/// # Examples +/// +/// - `be13faa2-8574-4d71-926d-27f16cf8a7af` +pub const DB_CASSANDRA_COORDINATOR_ID: &str = "db.cassandra.coordinator.id"; + +/// The data center of the coordinating node for a query. +/// +/// # Examples +/// +/// - `us-west-2` +pub const DB_CASSANDRA_COORDINATOR_DC: &str = "db.cassandra.coordinator.dc"; + +/// The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +/// +/// # Examples +/// +/// - `0` +/// - `1` +/// - `15` +pub const DB_REDIS_DATABASE_INDEX: &str = "db.redis.database_index"; + +/// The collection being accessed within the database stated in `db.name`. +/// +/// # Examples +/// +/// - `customers` +/// - `products` +pub const DB_MONGODB_COLLECTION: &str = "db.mongodb.collection"; + +/// The name of the primary table that the operation is acting upon, including the database name (if applicable). +/// +/// 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. +/// +/// # Examples +/// +/// - `public.users` +/// - `customers` +pub const DB_SQL_TABLE: &str = "db.sql.table"; + +/// Unique Cosmos client instance id. +/// +/// # Examples +/// +/// - `3ba4827d-4422-483f-b59f-85b74211c11d` +pub const DB_COSMOSDB_CLIENT_ID: &str = "db.cosmosdb.client_id"; + +/// CosmosDB Operation Type. +pub const DB_COSMOSDB_OPERATION_TYPE: &str = "db.cosmosdb.operation_type"; + +/// Cosmos client connection mode. +pub const DB_COSMOSDB_CONNECTION_MODE: &str = "db.cosmosdb.connection_mode"; + +/// Cosmos DB container name. +/// +/// # Examples +/// +/// - `anystring` +pub const DB_COSMOSDB_CONTAINER: &str = "db.cosmosdb.container"; + +/// Request payload size in bytes. +pub const DB_COSMOSDB_REQUEST_CONTENT_LENGTH: &str = "db.cosmosdb.request_content_length"; + +/// Cosmos DB status code. +/// +/// # Examples +/// +/// - `200` +/// - `201` +pub const DB_COSMOSDB_STATUS_CODE: &str = "db.cosmosdb.status_code"; + +/// Cosmos DB sub status code. +/// +/// # Examples +/// +/// - `1000` +/// - `1002` +pub const DB_COSMOSDB_SUB_STATUS_CODE: &str = "db.cosmosdb.sub_status_code"; + +/// RU consumed for that operation. +/// +/// # Examples +/// +/// - `46.18` +/// - `1.0` +pub const DB_COSMOSDB_REQUEST_CHARGE: &str = "db.cosmosdb.request_charge"; + +/// Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +pub const OTEL_STATUS_CODE: &str = "otel.status_code"; + +/// Description of the Status if it has a value, otherwise not set. +/// +/// # Examples +/// +/// - `resource not found` +pub const OTEL_STATUS_DESCRIPTION: &str = "otel.status_description"; + +/// Type of the trigger which caused this function invocation. +/// +/// For the server/consumer span on the incoming side, +/// `faas.trigger` MUST be set. +/// +/// Clients invoking FaaS instances usually cannot set `faas.trigger`, +/// since they would typically need to look in the payload to determine +/// the event type. If clients set it, it should be the same as the +/// trigger that corresponding incoming would have (i.e., this has +/// nothing to do with the underlying transport used to make the API +/// call to invoke the lambda, which is often HTTP). +pub const FAAS_TRIGGER: &str = "faas.trigger"; + +/// The invocation ID of the current function invocation. +/// +/// # Examples +/// +/// - `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` +pub const FAAS_INVOCATION_ID: &str = "faas.invocation_id"; + +/// The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +/// +/// # Examples +/// +/// - `myBucketName` +/// - `myDbName` +pub const FAAS_DOCUMENT_COLLECTION: &str = "faas.document.collection"; + +/// Describes the type of the operation that was performed on the data. +pub const FAAS_DOCUMENT_OPERATION: &str = "faas.document.operation"; + +/// A string containing the time when the data was accessed 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). +/// +/// # Examples +/// +/// - `2020-01-23T13:47:06Z` +pub const FAAS_DOCUMENT_TIME: &str = "faas.document.time"; + +/// 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. +/// +/// # Examples +/// +/// - `myFile.txt` +/// - `myTableName` +pub const FAAS_DOCUMENT_NAME: &str = "faas.document.name"; + +/// 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). +/// +/// # Examples +/// +/// - `2020-01-23T13:47:06Z` +pub const FAAS_TIME: &str = "faas.time"; + +/// A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +/// +/// # Examples +/// +/// - `0/5 * * * ? *` +pub const FAAS_CRON: &str = "faas.cron"; + +/// A boolean that is true if the serverless function is executed for the first time (aka cold-start). +pub const FAAS_COLDSTART: &str = "faas.coldstart"; + +/// The name of the invoked function. +/// +/// SHOULD be equal to the `faas.name` resource attribute of the invoked function. +/// +/// # Examples +/// +/// - `my-function` +pub const FAAS_INVOKED_NAME: &str = "faas.invoked_name"; + +/// The cloud provider of the invoked function. +/// +/// SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. +pub const FAAS_INVOKED_PROVIDER: &str = "faas.invoked_provider"; + +/// The cloud region of the invoked function. +/// +/// SHOULD be equal to the `cloud.region` resource attribute of the invoked function. +/// +/// # Examples +/// +/// - `eu-central-1` +pub const FAAS_INVOKED_REGION: &str = "faas.invoked_region"; + +/// The unique identifier of the feature flag. +/// +/// # Examples +/// +/// - `logo-color` +pub const FEATURE_FLAG_KEY: &str = "feature_flag.key"; + +/// The name of the service provider that performs the flag evaluation. +/// +/// # Examples +/// +/// - `Flag Manager` +pub const FEATURE_FLAG_PROVIDER_NAME: &str = "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. +/// +/// 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. +/// +/// # Examples +/// +/// - `red` +/// - `true` +/// - `on` +pub const FEATURE_FLAG_VARIANT: &str = "feature_flag.variant"; + +/// [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. +/// +/// # Examples +/// +/// - `tcp` +/// - `udp` +pub const NETWORK_TRANSPORT: &str = "network.transport"; + +/// [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. +/// +/// # Examples +/// +/// - `ipv4` +/// - `ipv6` +pub const NETWORK_TYPE: &str = "network.type"; + +/// [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. +/// +/// # Examples +/// +/// - `amqp` +/// - `http` +/// - `mqtt` +pub const NETWORK_PROTOCOL_NAME: &str = "network.protocol.name"; + +/// Version of the application layer protocol used. See note below. +/// +/// `network.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`. +/// +/// # Examples +/// +/// - `3.1.1` +pub const NETWORK_PROTOCOL_VERSION: &str = "network.protocol.version"; + +/// The internet connection type. +/// +/// # Examples +/// +/// - `wifi` +pub const NETWORK_CONNECTION_TYPE: &str = "network.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. +/// +/// # Examples +/// +/// - `LTE` +pub const NETWORK_CONNECTION_SUBTYPE: &str = "network.connection.subtype"; + +/// The name of the mobile carrier. +/// +/// # Examples +/// +/// - `sprint` +pub const NETWORK_CARRIER_NAME: &str = "network.carrier.name"; + +/// The mobile carrier country code. +/// +/// # Examples +/// +/// - `310` +pub const NETWORK_CARRIER_MCC: &str = "network.carrier.mcc"; + +/// The mobile carrier network code. +/// +/// # Examples +/// +/// - `001` +pub const NETWORK_CARRIER_MNC: &str = "network.carrier.mnc"; + +/// The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +/// +/// # Examples +/// +/// - `DE` +pub const NETWORK_CARRIER_ICC: &str = "network.carrier.icc"; + +/// The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +/// +/// # Examples +/// +/// - `AuthTokenCache` +pub const PEER_SERVICE: &str = "peer.service"; + +/// Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +/// +/// # Examples +/// +/// - `username` +pub const ENDUSER_ID: &str = "enduser.id"; + +/// Actual/assumed role the client is making the request under extracted from token or application security context. +/// +/// # Examples +/// +/// - `admin` +pub const ENDUSER_ROLE: &str = "enduser.role"; + +/// Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +/// +/// # Examples +/// +/// - `read:message, write:files` +pub const ENDUSER_SCOPE: &str = "enduser.scope"; + +/// Current "managed" thread ID (as opposed to OS thread ID). +/// +/// # Examples +/// +/// - `42` +pub const THREAD_ID: &str = "thread.id"; + +/// Current thread name. +/// +/// # Examples +/// +/// - `main` +pub const THREAD_NAME: &str = "thread.name"; + +/// The method or function name, or equivalent (usually rightmost part of the code unit's name). +/// +/// # Examples +/// +/// - `serveRequest` +pub const CODE_FUNCTION: &str = "code.function"; + +/// The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +/// +/// # Examples +/// +/// - `com.example.MyHttpService` +pub const CODE_NAMESPACE: &str = "code.namespace"; + +/// The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +/// +/// # Examples +/// +/// - `/usr/local/MyApplication/content_root/app/index.php` +pub const CODE_FILEPATH: &str = "code.filepath"; + +/// The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +/// +/// # Examples +/// +/// - `42` +pub const CODE_LINENO: &str = "code.lineno"; + +/// The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +/// +/// # Examples +/// +/// - `16` +pub const CODE_COLUMN: &str = "code.column"; + +/// Original HTTP method sent by the client in the request line. +/// +/// # Examples +/// +/// - `GeT` +/// - `ACL` +/// - `foo` +pub const HTTP_REQUEST_METHOD_ORIGINAL: &str = "http.request.method_original"; + +/// 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. +/// +/// # Examples +/// +/// - `3495` +pub const HTTP_REQUEST_BODY_SIZE: &str = "http.request.body.size"; + +/// 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. +/// +/// # Examples +/// +/// - `3495` +pub const HTTP_RESPONSE_BODY_SIZE: &str = "http.response.body.size"; + +/// The ordinal number of request resending attempt (for any reason, including redirects). +/// +/// 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). +/// +/// # Examples +/// +/// - `3` +pub const HTTP_RESEND_COUNT: &str = "http.resend_count"; + +/// The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +/// +/// # Examples +/// +/// - `79b9da39-b7ae-508a-a6bc-864b2829c622` +/// - `C9ER4AJX75574TDJ` +pub const AWS_REQUEST_ID: &str = "aws.request_id"; + +/// The keys in the `RequestItems` object field. +/// +/// # Examples +/// +/// - `Users` +/// - `Cats` +pub const AWS_DYNAMODB_TABLE_NAMES: &str = "aws.dynamodb.table_names"; + +/// The JSON-serialized value of each item in the `ConsumedCapacity` response field. +/// +/// # Examples +/// +/// - `{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number }` +pub const AWS_DYNAMODB_CONSUMED_CAPACITY: &str = "aws.dynamodb.consumed_capacity"; + +/// The JSON-serialized value of the `ItemCollectionMetrics` response field. +/// +/// # Examples +/// +/// - `{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }` +pub const AWS_DYNAMODB_ITEM_COLLECTION_METRICS: &str = "aws.dynamodb.item_collection_metrics"; + +/// The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +/// +/// # Examples +/// +/// - `1.0` +/// - `2.0` +pub const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: &str = "aws.dynamodb.provisioned_read_capacity"; + +/// The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +/// +/// # Examples +/// +/// - `1.0` +/// - `2.0` +pub const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: &str = "aws.dynamodb.provisioned_write_capacity"; + +/// The value of the `ConsistentRead` request parameter. +pub const AWS_DYNAMODB_CONSISTENT_READ: &str = "aws.dynamodb.consistent_read"; + +/// The value of the `ProjectionExpression` request parameter. +/// +/// # Examples +/// +/// - `Title` +/// - `Title, Price, Color` +/// - `Title, Description, RelatedItems, ProductReviews` +pub const AWS_DYNAMODB_PROJECTION: &str = "aws.dynamodb.projection"; + +/// The value of the `Limit` request parameter. +/// +/// # Examples +/// +/// - `10` +pub const AWS_DYNAMODB_LIMIT: &str = "aws.dynamodb.limit"; + +/// The value of the `AttributesToGet` request parameter. +/// +/// # Examples +/// +/// - `lives` +/// - `id` +pub const AWS_DYNAMODB_ATTRIBUTES_TO_GET: &str = "aws.dynamodb.attributes_to_get"; + +/// The value of the `IndexName` request parameter. +/// +/// # Examples +/// +/// - `name_to_group` +pub const AWS_DYNAMODB_INDEX_NAME: &str = "aws.dynamodb.index_name"; + +/// The value of the `Select` request parameter. +/// +/// # Examples +/// +/// - `ALL_ATTRIBUTES` +/// - `COUNT` +pub const AWS_DYNAMODB_SELECT: &str = "aws.dynamodb.select"; + +/// The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +/// +/// # Examples +/// +/// - `{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }` +pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: &str = "aws.dynamodb.global_secondary_indexes"; + +/// The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +/// +/// # Examples +/// +/// - `{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }` +pub const AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: &str = "aws.dynamodb.local_secondary_indexes"; + +/// The value of the `ExclusiveStartTableName` request parameter. +/// +/// # Examples +/// +/// - `Users` +/// - `CatsTable` +pub const AWS_DYNAMODB_EXCLUSIVE_START_TABLE: &str = "aws.dynamodb.exclusive_start_table"; + +/// The the number of items in the `TableNames` response parameter. +/// +/// # Examples +/// +/// - `20` +pub const AWS_DYNAMODB_TABLE_COUNT: &str = "aws.dynamodb.table_count"; + +/// The value of the `ScanIndexForward` request parameter. +pub const AWS_DYNAMODB_SCAN_FORWARD: &str = "aws.dynamodb.scan_forward"; + +/// The value of the `Segment` request parameter. +/// +/// # Examples +/// +/// - `10` +pub const AWS_DYNAMODB_SEGMENT: &str = "aws.dynamodb.segment"; + +/// The value of the `TotalSegments` request parameter. +/// +/// # Examples +/// +/// - `100` +pub const AWS_DYNAMODB_TOTAL_SEGMENTS: &str = "aws.dynamodb.total_segments"; + +/// The value of the `Count` response parameter. +/// +/// # Examples +/// +/// - `10` +pub const AWS_DYNAMODB_COUNT: &str = "aws.dynamodb.count"; + +/// The value of the `ScannedCount` response parameter. +/// +/// # Examples +/// +/// - `50` +pub const AWS_DYNAMODB_SCANNED_COUNT: &str = "aws.dynamodb.scanned_count"; + +/// The JSON-serialized value of each item in the `AttributeDefinitions` request field. +/// +/// # Examples +/// +/// - `{ "AttributeName": "string", "AttributeType": "string" }` +pub const AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: &str = "aws.dynamodb.attribute_definitions"; + +/// The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. +/// +/// # Examples +/// +/// - `{ "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }` +pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: &str = "aws.dynamodb.global_secondary_index_updates"; + +/// The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +/// +/// The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. +/// This applies to almost all S3 operations except `list-buckets`. +/// +/// # Examples +/// +/// - `some-bucket-name` +pub const AWS_S3_BUCKET: &str = "aws.s3.bucket"; + +/// The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +/// +/// The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. +/// This applies in particular to the following operations: +/// +/// - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) +/// - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) +/// - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) +/// - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) +/// - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) +/// - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) +/// - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) +/// - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) +/// - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) +/// - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) +/// - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) +/// - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +/// - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) +/// +/// # Examples +/// +/// - `someFile.yml` +pub const AWS_S3_KEY: &str = "aws.s3.key"; + +/// The source object (in the form `bucket`/`key`) for the copy operation. +/// +/// The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter +/// of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). +/// This applies in particular to the following operations: +/// +/// - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) +/// - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) +/// +/// # Examples +/// +/// - `someFile.yml` +pub const AWS_S3_COPY_SOURCE: &str = "aws.s3.copy_source"; + +/// Upload ID that identifies the multipart upload. +/// +/// The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter +/// of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. +/// This applies in particular to the following operations: +/// +/// - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) +/// - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) +/// - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) +/// - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +/// - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) +/// +/// # Examples +/// +/// - `dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ` +pub const AWS_S3_UPLOAD_ID: &str = "aws.s3.upload_id"; + +/// The delete request container that specifies the objects to be deleted. +/// +/// The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. +/// The `delete` attribute corresponds to the `--delete` parameter of the +/// [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). +/// +/// # Examples +/// +/// - `Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean` +pub const AWS_S3_DELETE: &str = "aws.s3.delete"; + +/// The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +/// +/// The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +/// and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. +/// The `part_number` attribute corresponds to the `--part-number` parameter of the +/// [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). +/// +/// # Examples +/// +/// - `3456` +pub const AWS_S3_PART_NUMBER: &str = "aws.s3.part_number"; + +/// The name of the operation being executed. +/// +/// # Examples +/// +/// - `findBookById` +pub const GRAPHQL_OPERATION_NAME: &str = "graphql.operation.name"; + +/// The type of the operation being executed. +/// +/// # Examples +/// +/// - `query` +/// - `mutation` +/// - `subscription` +pub const GRAPHQL_OPERATION_TYPE: &str = "graphql.operation.type"; + +/// The GraphQL document being executed. +/// +/// The value may be sanitized to exclude sensitive information. +/// +/// # Examples +/// +/// - `query findBookById { bookById(id: ?) { name } }` +pub const GRAPHQL_DOCUMENT: &str = "graphql.document"; + +/// A value used by the messaging system as an identifier for the message, represented as a string. +/// +/// # Examples +/// +/// - `452a7c7c7c7048c2f887f61572b18fc2` +pub const MESSAGING_MESSAGE_ID: &str = "messaging.message.id"; + +/// The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +/// +/// # Examples +/// +/// - `MyConversationId` +pub const MESSAGING_MESSAGE_CONVERSATION_ID: &str = "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. +/// +/// # Examples +/// +/// - `2738` +pub const MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: &str = "messaging.message.payload_size_bytes"; + +/// The compressed size of the message payload in bytes. +/// +/// # Examples +/// +/// - `2048` +pub const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: &str = "messaging.message.payload_compressed_size_bytes"; + +/// The message destination name. +/// +/// 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. +/// +/// # Examples +/// +/// - `MyQueue` +/// - `MyTopic` +pub const MESSAGING_DESTINATION_NAME: &str = "messaging.destination.name"; + +/// Low cardinality representation of the messaging destination name. +/// +/// 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. +/// +/// # Examples +/// +/// - `/customers/{customerId}` +pub const MESSAGING_DESTINATION_TEMPLATE: &str = "messaging.destination.template"; + +/// A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +pub const MESSAGING_DESTINATION_TEMPORARY: &str = "messaging.destination.temporary"; + +/// A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +pub const MESSAGING_DESTINATION_ANONYMOUS: &str = "messaging.destination.anonymous"; + +/// A string identifying the messaging system. +/// +/// # Examples +/// +/// - `kafka` +/// - `rabbitmq` +/// - `rocketmq` +/// - `activemq` +/// - `AmazonSQS` +pub const MESSAGING_SYSTEM: &str = "messaging.system"; + +/// A string identifying the kind of messaging operation as defined in the [Operation names](#operation-names) section above. +/// +/// If a custom value is used, it MUST be of low cardinality. +pub const MESSAGING_OPERATION: &str = "messaging.operation"; + +/// The number of messages sent, received, or processed in the scope of the batching operation. +/// +/// 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. +/// +/// # Examples +/// +/// - `0` +/// - `1` +/// - `2` +pub const MESSAGING_BATCH_MESSAGE_COUNT: &str = "messaging.batch.message_count"; + +/// A unique identifier for the client that consumes or produces a message. +/// +/// # Examples +/// +/// - `client-5` +/// - `myhost@8742@s8083jm` +pub const MESSAGING_CLIENT_ID: &str = "messaging.client_id"; + +/// RabbitMQ message routing key. +/// +/// # Examples +/// +/// - `myKey` +pub const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: &str = "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 `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +/// +/// 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. +/// +/// # Examples +/// +/// - `myKey` +pub const MESSAGING_KAFKA_MESSAGE_KEY: &str = "messaging.kafka.message.key"; + +/// Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +/// +/// # Examples +/// +/// - `my-group` +pub const MESSAGING_KAFKA_CONSUMER_GROUP: &str = "messaging.kafka.consumer.group"; + +/// Partition the message is sent to. +/// +/// # Examples +/// +/// - `2` +pub const MESSAGING_KAFKA_DESTINATION_PARTITION: &str = "messaging.kafka.destination.partition"; + +/// The offset of a record in the corresponding Kafka partition. +/// +/// # Examples +/// +/// - `42` +pub const MESSAGING_KAFKA_MESSAGE_OFFSET: &str = "messaging.kafka.message.offset"; + +/// A boolean that is true if the message is a tombstone. +pub const MESSAGING_KAFKA_MESSAGE_TOMBSTONE: &str = "messaging.kafka.message.tombstone"; + +/// Namespace of RocketMQ resources, resources in different namespaces are individual. +/// +/// # Examples +/// +/// - `myNamespace` +pub const MESSAGING_ROCKETMQ_NAMESPACE: &str = "messaging.rocketmq.namespace"; + +/// Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +/// +/// # Examples +/// +/// - `myConsumerGroup` +pub const MESSAGING_ROCKETMQ_CLIENT_GROUP: &str = "messaging.rocketmq.client_group"; + +/// The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +/// +/// # Examples +/// +/// - `1665987217045` +pub const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: &str = "messaging.rocketmq.message.delivery_timestamp"; + +/// The delay time level for delay message, which determines the message delay time. +/// +/// # Examples +/// +/// - `3` +pub const MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: &str = "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. +/// +/// # Examples +/// +/// - `myMessageGroup` +pub const MESSAGING_ROCKETMQ_MESSAGE_GROUP: &str = "messaging.rocketmq.message.group"; + +/// Type of message. +pub const MESSAGING_ROCKETMQ_MESSAGE_TYPE: &str = "messaging.rocketmq.message.type"; + +/// The secondary classifier of message besides topic. +/// +/// # Examples +/// +/// - `tagA` +pub const MESSAGING_ROCKETMQ_MESSAGE_TAG: &str = "messaging.rocketmq.message.tag"; + +/// Key(s) of message, another way to mark message besides message id. +/// +/// # Examples +/// +/// - `keyA` +/// - `keyB` +pub const MESSAGING_ROCKETMQ_MESSAGE_KEYS: &str = "messaging.rocketmq.message.keys"; + +/// Model of message consumption. This only applies to consumer spans. +pub const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: &str = "messaging.rocketmq.consumption_model"; + +/// A string identifying the remoting system. See below for a list of well-known identifiers. +pub const RPC_SYSTEM: &str = "rpc.system"; + +/// The full (logical) name of the service being called, including its package name, if applicable. +/// +/// This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). +/// +/// # Examples +/// +/// - `myservice.EchoService` +pub const RPC_SERVICE: &str = "rpc.service"; + +/// The name of the (logical) method being called, must be equal to the $method part in the span name. +/// +/// This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +/// +/// # Examples +/// +/// - `exampleMethod` +pub const RPC_METHOD: &str = "rpc.method"; + +/// The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +pub const RPC_GRPC_STATUS_CODE: &str = "rpc.grpc.status_code"; + +/// Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. +/// +/// # Examples +/// +/// - `2.0` +/// - `1.0` +pub const RPC_JSONRPC_VERSION: &str = "rpc.jsonrpc.version"; + +/// `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +/// +/// # Examples +/// +/// - `10` +/// - `request-7` +/// - `` +pub const RPC_JSONRPC_REQUEST_ID: &str = "rpc.jsonrpc.request_id"; + +/// `error.code` property of response if it is an error response. +/// +/// # Examples +/// +/// - `-32700` +/// - `100` +pub const RPC_JSONRPC_ERROR_CODE: &str = "rpc.jsonrpc.error_code"; + +/// `error.message` property of response if it is an error response. +/// +/// # Examples +/// +/// - `Parse error` +/// - `User already exists` +pub const RPC_JSONRPC_ERROR_MESSAGE: &str = "rpc.jsonrpc.error_message"; + +/// Whether this is a received or sent message. +pub const MESSAGE_TYPE: &str = "message.type"; + +/// MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +/// +/// This way we guarantee that the values will be consistent between different implementations. +pub const MESSAGE_ID: &str = "message.id"; + +/// Compressed size of the message in bytes. +pub const MESSAGE_COMPRESSED_SIZE: &str = "message.compressed_size"; + +/// Uncompressed size of the message in bytes. +pub const MESSAGE_UNCOMPRESSED_SIZE: &str = "message.uncompressed_size"; + +/// The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +pub const RPC_CONNECT_RPC_ERROR_CODE: &str = "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. +/// +/// 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. +pub const EXCEPTION_ESCAPED: &str = "exception.escaped"; + +/// The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +/// +/// # Examples +/// +/// - `https` +/// - `ftp` +/// - `telnet` +pub const URL_SCHEME: &str = "url.scheme"; + +/// Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +/// +/// For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. +/// `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:REDACTED@www.example.com/`. +/// `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. +/// +/// # Examples +/// +/// - `https://www.foo.bar/search?q=OpenTelemetry#SemConv` +/// - `//localhost` +pub const URL_FULL: &str = "url.full"; + +/// The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +/// +/// When missing, the value is assumed to be `/` +/// +/// # Examples +/// +/// - `/search` +pub const URL_PATH: &str = "url.path"; + +/// The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +/// +/// Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. +/// +/// # Examples +/// +/// - `q=OpenTelemetry` +pub const URL_QUERY: &str = "url.query"; + +/// The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +/// +/// # Examples +/// +/// - `SemConv` +pub const URL_FRAGMENT: &str = "url.fragment"; + +/// Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. +/// +/// # Examples +/// +/// - `CERN-LineMode/2.15 libwww/2.17b3` +pub const USER_AGENT_ORIGINAL: &str = "user_agent.original"; \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/trace.rs b/opentelemetry-semantic-conventions/src/trace.rs index 17eb2a1a4b..c363e2a4af 100644 --- a/opentelemetry-semantic-conventions/src/trace.rs +++ b/opentelemetry-semantic-conventions/src/trace.rs @@ -13,7 +13,24 @@ //! //! ## Usage //! +//! `tracing`: +//! +//! ``` +//! use opentelemetry_semantic_conventions as semconv; +//! use tracing::span; +//! +//! let span = span!( +//! LEVEL::INFO, +//! "handle_request", +//! { semconv::trace::NET_PEER_NAME = "example.org" }, +//! { semconv::trace::NET_PEER_PORT = 80 } +//! ); //! ``` +//! +//! OpenTelemetry SDK: +//! +//! ``` +//! use opentelemetry::KeyValue; //! use opentelemetry::{global, trace::Tracer as _}; //! use opentelemetry_semantic_conventions as semcov; //! @@ -21,14 +38,12 @@ //! let _span = tracer //! .span_builder("span-name") //! .with_attributes(vec![ -//! semcov::trace::NET_PEER_NAME.string("example.org"), -//! semcov::trace::NET_PEER_PORT.i64(80), +//! KeyValue::new(semcov::trace::NET_PEER_NAME, "example.org"), +//! KeyValue::new(semcov::trace::NET_PEER_PORT, 80i64), //! ]) //! .start(&tracer); //! ``` -use opentelemetry::Key; - /// Client address - unix domain socket name, IPv4 or IPv6 address. /// /// When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent client address behind any intermediaries (e.g. proxies) if it's available. @@ -37,7 +52,7 @@ use opentelemetry::Key; /// /// - `/tmp/my.sock` /// - `10.1.2.80` -pub const CLIENT_ADDRESS: Key = Key::from_static_str("client.address"); +pub const CLIENT_ADDRESS: &str = "client.address"; /// Client port number. /// @@ -46,7 +61,7 @@ pub const CLIENT_ADDRESS: Key = Key::from_static_str("client.address"); /// # Examples /// /// - `65123` -pub const CLIENT_PORT: Key = Key::from_static_str("client.port"); +pub const CLIENT_PORT: &str = "client.port"; /// Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. /// @@ -54,14 +69,14 @@ pub const CLIENT_PORT: Key = Key::from_static_str("client.port"); /// /// - `/tmp/my.sock` /// - `127.0.0.1` -pub const CLIENT_SOCKET_ADDRESS: Key = Key::from_static_str("client.socket.address"); +pub const CLIENT_SOCKET_ADDRESS: &str = "client.socket.address"; /// Immediate client peer port number. /// /// # Examples /// /// - `35555` -pub const CLIENT_SOCKET_PORT: Key = Key::from_static_str("client.socket.port"); +pub const CLIENT_SOCKET_PORT: &str = "client.socket.port"; /// Deprecated, use `http.request.method` instead. /// @@ -71,7 +86,7 @@ pub const CLIENT_SOCKET_PORT: Key = Key::from_static_str("client.socket.port"); /// - `POST` /// - `HEAD` #[deprecated] -pub const HTTP_METHOD: Key = Key::from_static_str("http.method"); +pub const HTTP_METHOD: &str = "http.method"; /// Deprecated, use `http.response.status_code` instead. /// @@ -79,7 +94,7 @@ pub const HTTP_METHOD: Key = Key::from_static_str("http.method"); /// /// - `200` #[deprecated] -pub const HTTP_STATUS_CODE: Key = Key::from_static_str("http.status_code"); +pub const HTTP_STATUS_CODE: &str = "http.status_code"; /// Deprecated, use `url.scheme` instead. /// @@ -88,7 +103,7 @@ pub const HTTP_STATUS_CODE: Key = Key::from_static_str("http.status_code"); /// - `http` /// - `https` #[deprecated] -pub const HTTP_SCHEME: Key = Key::from_static_str("http.scheme"); +pub const HTTP_SCHEME: &str = "http.scheme"; /// Deprecated, use `url.full` instead. /// @@ -96,7 +111,7 @@ pub const HTTP_SCHEME: Key = Key::from_static_str("http.scheme"); /// /// - `https://www.foo.bar/search?q=OpenTelemetry#SemConv` #[deprecated] -pub const HTTP_URL: Key = Key::from_static_str("http.url"); +pub const HTTP_URL: &str = "http.url"; /// Deprecated, use `url.path` and `url.query` instead. /// @@ -104,7 +119,7 @@ pub const HTTP_URL: Key = Key::from_static_str("http.url"); /// /// - `/search?q=OpenTelemetry#SemConv` #[deprecated] -pub const HTTP_TARGET: Key = Key::from_static_str("http.target"); +pub const HTTP_TARGET: &str = "http.target"; /// Deprecated, use `http.request.body.size` instead. /// @@ -112,7 +127,7 @@ pub const HTTP_TARGET: Key = Key::from_static_str("http.target"); /// /// - `3495` #[deprecated] -pub const HTTP_REQUEST_CONTENT_LENGTH: Key = Key::from_static_str("http.request_content_length"); +pub const HTTP_REQUEST_CONTENT_LENGTH: &str = "http.request_content_length"; /// Deprecated, use `http.response.body.size` instead. /// @@ -120,7 +135,7 @@ pub const HTTP_REQUEST_CONTENT_LENGTH: Key = Key::from_static_str("http.request_ /// /// - `3495` #[deprecated] -pub const HTTP_RESPONSE_CONTENT_LENGTH: Key = Key::from_static_str("http.response_content_length"); +pub const HTTP_RESPONSE_CONTENT_LENGTH: &str = "http.response_content_length"; /// Deprecated, use `server.socket.domain` on client spans. /// @@ -128,7 +143,7 @@ pub const HTTP_RESPONSE_CONTENT_LENGTH: Key = Key::from_static_str("http.respons /// /// - `/var/my.sock` #[deprecated] -pub const NET_SOCK_PEER_NAME: Key = Key::from_static_str("net.sock.peer.name"); +pub const NET_SOCK_PEER_NAME: &str = "net.sock.peer.name"; /// Deprecated, use `server.socket.address` on client spans and `client.socket.address` on server spans. /// @@ -136,7 +151,7 @@ pub const NET_SOCK_PEER_NAME: Key = Key::from_static_str("net.sock.peer.name"); /// /// - `192.168.0.1` #[deprecated] -pub const NET_SOCK_PEER_ADDR: Key = Key::from_static_str("net.sock.peer.addr"); +pub const NET_SOCK_PEER_ADDR: &str = "net.sock.peer.addr"; /// Deprecated, use `server.socket.port` on client spans and `client.socket.port` on server spans. /// @@ -144,7 +159,7 @@ pub const NET_SOCK_PEER_ADDR: Key = Key::from_static_str("net.sock.peer.addr"); /// /// - `65531` #[deprecated] -pub const NET_SOCK_PEER_PORT: Key = Key::from_static_str("net.sock.peer.port"); +pub const NET_SOCK_PEER_PORT: &str = "net.sock.peer.port"; /// Deprecated, use `server.address` on client spans and `client.address` on server spans. /// @@ -152,7 +167,7 @@ pub const NET_SOCK_PEER_PORT: Key = Key::from_static_str("net.sock.peer.port"); /// /// - `example.com` #[deprecated] -pub const NET_PEER_NAME: Key = Key::from_static_str("net.peer.name"); +pub const NET_PEER_NAME: &str = "net.peer.name"; /// Deprecated, use `server.port` on client spans and `client.port` on server spans. /// @@ -160,7 +175,7 @@ pub const NET_PEER_NAME: Key = Key::from_static_str("net.peer.name"); /// /// - `8080` #[deprecated] -pub const NET_PEER_PORT: Key = Key::from_static_str("net.peer.port"); +pub const NET_PEER_PORT: &str = "net.peer.port"; /// Deprecated, use `server.address`. /// @@ -168,7 +183,7 @@ pub const NET_PEER_PORT: Key = Key::from_static_str("net.peer.port"); /// /// - `example.com` #[deprecated] -pub const NET_HOST_NAME: Key = Key::from_static_str("net.host.name"); +pub const NET_HOST_NAME: &str = "net.host.name"; /// Deprecated, use `server.port`. /// @@ -176,7 +191,7 @@ pub const NET_HOST_NAME: Key = Key::from_static_str("net.host.name"); /// /// - `8080` #[deprecated] -pub const NET_HOST_PORT: Key = Key::from_static_str("net.host.port"); +pub const NET_HOST_PORT: &str = "net.host.port"; /// Deprecated, use `server.socket.address`. /// @@ -184,7 +199,7 @@ pub const NET_HOST_PORT: Key = Key::from_static_str("net.host.port"); /// /// - `/var/my.sock` #[deprecated] -pub const NET_SOCK_HOST_ADDR: Key = Key::from_static_str("net.sock.host.addr"); +pub const NET_SOCK_HOST_ADDR: &str = "net.sock.host.addr"; /// Deprecated, use `server.socket.port`. /// @@ -192,11 +207,11 @@ pub const NET_SOCK_HOST_ADDR: Key = Key::from_static_str("net.sock.host.addr"); /// /// - `8080` #[deprecated] -pub const NET_SOCK_HOST_PORT: Key = Key::from_static_str("net.sock.host.port"); +pub const NET_SOCK_HOST_PORT: &str = "net.sock.host.port"; /// Deprecated, use `network.transport`. #[deprecated] -pub const NET_TRANSPORT: Key = Key::from_static_str("net.transport"); +pub const NET_TRANSPORT: &str = "net.transport"; /// Deprecated, use `network.protocol.name`. /// @@ -206,7 +221,7 @@ pub const NET_TRANSPORT: Key = Key::from_static_str("net.transport"); /// - `http` /// - `mqtt` #[deprecated] -pub const NET_PROTOCOL_NAME: Key = Key::from_static_str("net.protocol.name"); +pub const NET_PROTOCOL_NAME: &str = "net.protocol.name"; /// Deprecated, use `network.protocol.version`. /// @@ -214,11 +229,11 @@ pub const NET_PROTOCOL_NAME: Key = Key::from_static_str("net.protocol.name"); /// /// - `3.1.1` #[deprecated] -pub const NET_PROTOCOL_VERSION: Key = Key::from_static_str("net.protocol.version"); +pub const NET_PROTOCOL_VERSION: &str = "net.protocol.version"; /// Deprecated, use `network.transport` and `network.type`. #[deprecated] -pub const NET_SOCK_FAMILY: Key = Key::from_static_str("net.sock.family"); +pub const NET_SOCK_FAMILY: &str = "net.sock.family"; /// The domain name of the destination system. /// @@ -227,14 +242,14 @@ pub const NET_SOCK_FAMILY: Key = Key::from_static_str("net.sock.family"); /// # Examples /// /// - `foo.example.com` -pub const DESTINATION_DOMAIN: Key = Key::from_static_str("destination.domain"); +pub const DESTINATION_DOMAIN: &str = "destination.domain"; /// Peer address, for example IP address or UNIX socket name. /// /// # Examples /// /// - `10.5.3.2` -pub const DESTINATION_ADDRESS: Key = Key::from_static_str("destination.address"); +pub const DESTINATION_ADDRESS: &str = "destination.address"; /// Peer port number. /// @@ -242,7 +257,7 @@ pub const DESTINATION_ADDRESS: Key = Key::from_static_str("destination.address") /// /// - `3389` /// - `2888` -pub const DESTINATION_PORT: Key = Key::from_static_str("destination.port"); +pub const DESTINATION_PORT: &str = "destination.port"; /// 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. /// @@ -250,7 +265,7 @@ pub const DESTINATION_PORT: Key = Key::from_static_str("destination.port"); /// /// - `java.net.ConnectException` /// - `OSError` -pub const EXCEPTION_TYPE: Key = Key::from_static_str("exception.type"); +pub const EXCEPTION_TYPE: &str = "exception.type"; /// The exception message. /// @@ -258,14 +273,14 @@ pub const EXCEPTION_TYPE: Key = Key::from_static_str("exception.type"); /// /// - `Division by zero` /// - `Can't convert 'int' object to str implicitly` -pub const EXCEPTION_MESSAGE: Key = Key::from_static_str("exception.message"); +pub const EXCEPTION_MESSAGE: &str = "exception.message"; /// A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. /// /// # Examples /// /// - `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` -pub const EXCEPTION_STACKTRACE: Key = Key::from_static_str("exception.stacktrace"); +pub const EXCEPTION_STACKTRACE: &str = "exception.stacktrace"; /// HTTP request method. /// @@ -290,14 +305,14 @@ pub const EXCEPTION_STACKTRACE: Key = Key::from_static_str("exception.stacktrace /// - `GET` /// - `POST` /// - `HEAD` -pub const HTTP_REQUEST_METHOD: Key = Key::from_static_str("http.request.method"); +pub const HTTP_REQUEST_METHOD: &str = "http.request.method"; /// [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). /// /// # Examples /// /// - `200` -pub const HTTP_RESPONSE_STATUS_CODE: Key = Key::from_static_str("http.response.status_code"); +pub const HTTP_RESPONSE_STATUS_CODE: &str = "http.response.status_code"; /// The matched route (path template in the format used by the respective server framework). See note below. /// @@ -308,7 +323,7 @@ pub const HTTP_RESPONSE_STATUS_CODE: Key = Key::from_static_str("http.response.s /// /// - `/users/:userID?` /// - `{controller}/{action}/{id?}` -pub const HTTP_ROUTE: Key = Key::from_static_str("http.route"); +pub const HTTP_ROUTE: &str = "http.route"; /// The name identifies the event. /// @@ -316,13 +331,13 @@ pub const HTTP_ROUTE: Key = Key::from_static_str("http.route"); /// /// - `click` /// - `exception` -pub const EVENT_NAME: Key = Key::from_static_str("event.name"); +pub const EVENT_NAME: &str = "event.name"; /// The domain identifies the business context for the events. /// /// Events across different domains may have same `event.name`, yet be /// unrelated events. -pub const EVENT_DOMAIN: Key = Key::from_static_str("event.domain"); +pub const EVENT_DOMAIN: &str = "event.domain"; /// A unique identifier for the Log Record. /// @@ -332,38 +347,38 @@ pub const EVENT_DOMAIN: Key = Key::from_static_str("event.domain"); /// # Examples /// /// - `01ARZ3NDEKTSV4RRFFQ69G5FAV` -pub const LOG_RECORD_UID: Key = Key::from_static_str("log.record.uid"); +pub const LOG_RECORD_UID: &str = "log.record.uid"; /// The stream associated with the log. See below for a list of well-known values. -pub const LOG_IOSTREAM: Key = Key::from_static_str("log.iostream"); +pub const LOG_IOSTREAM: &str = "log.iostream"; /// The basename of the file. /// /// # Examples /// /// - `audit.log` -pub const LOG_FILE_NAME: Key = Key::from_static_str("log.file.name"); +pub const LOG_FILE_NAME: &str = "log.file.name"; /// The full path to the file. /// /// # Examples /// /// - `/var/log/mysql/audit.log` -pub const LOG_FILE_PATH: Key = Key::from_static_str("log.file.path"); +pub const LOG_FILE_PATH: &str = "log.file.path"; /// The basename of the file, with symlinks resolved. /// /// # Examples /// /// - `uuid.log` -pub const LOG_FILE_NAME_RESOLVED: Key = Key::from_static_str("log.file.name_resolved"); +pub const LOG_FILE_NAME_RESOLVED: &str = "log.file.name_resolved"; /// The full path to the file, with symlinks resolved. /// /// # Examples /// /// - `/var/lib/docker/uuid.log` -pub const LOG_FILE_PATH_RESOLVED: Key = Key::from_static_str("log.file.path_resolved"); +pub const LOG_FILE_PATH_RESOLVED: &str = "log.file.path_resolved"; /// The type of memory. /// @@ -371,7 +386,7 @@ pub const LOG_FILE_PATH_RESOLVED: Key = Key::from_static_str("log.file.path_reso /// /// - `heap` /// - `non_heap` -pub const TYPE: Key = Key::from_static_str("type"); +pub const TYPE: &str = "type"; /// Name of the memory pool. /// @@ -382,14 +397,14 @@ pub const TYPE: Key = Key::from_static_str("type"); /// - `G1 Old Gen` /// - `G1 Eden space` /// - `G1 Survivor Space` -pub const POOL: Key = Key::from_static_str("pool"); +pub const POOL: &str = "pool"; /// Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is not known. /// /// # Examples /// /// - `example.com` -pub const SERVER_ADDRESS: Key = Key::from_static_str("server.address"); +pub const SERVER_ADDRESS: &str = "server.address"; /// Logical server port number. /// @@ -398,7 +413,7 @@ pub const SERVER_ADDRESS: Key = Key::from_static_str("server.address"); /// - `80` /// - `8080` /// - `443` -pub const SERVER_PORT: Key = Key::from_static_str("server.port"); +pub const SERVER_PORT: &str = "server.port"; /// The domain name of an immediate peer. /// @@ -407,21 +422,21 @@ pub const SERVER_PORT: Key = Key::from_static_str("server.port"); /// # Examples /// /// - `proxy.example.com` -pub const SERVER_SOCKET_DOMAIN: Key = Key::from_static_str("server.socket.domain"); +pub const SERVER_SOCKET_DOMAIN: &str = "server.socket.domain"; /// Physical server IP address or Unix socket address. If set from the client, should simply use the socket's peer address, and not attempt to find any actual server IP (i.e., if set from client, this may represent some proxy server instead of the logical server). /// /// # Examples /// /// - `10.5.3.2` -pub const SERVER_SOCKET_ADDRESS: Key = Key::from_static_str("server.socket.address"); +pub const SERVER_SOCKET_ADDRESS: &str = "server.socket.address"; /// Physical server port. /// /// # Examples /// /// - `16456` -pub const SERVER_SOCKET_PORT: Key = Key::from_static_str("server.socket.port"); +pub const SERVER_SOCKET_PORT: &str = "server.socket.port"; /// The domain name of the source system. /// @@ -430,14 +445,14 @@ pub const SERVER_SOCKET_PORT: Key = Key::from_static_str("server.socket.port"); /// # Examples /// /// - `foo.example.com` -pub const SOURCE_DOMAIN: Key = Key::from_static_str("source.domain"); +pub const SOURCE_DOMAIN: &str = "source.domain"; /// Source address, for example IP address or Unix socket name. /// /// # Examples /// /// - `10.5.3.2` -pub const SOURCE_ADDRESS: Key = Key::from_static_str("source.address"); +pub const SOURCE_ADDRESS: &str = "source.address"; /// Source port number. /// @@ -445,7 +460,7 @@ pub const SOURCE_ADDRESS: Key = Key::from_static_str("source.address"); /// /// - `3389` /// - `2888` -pub const SOURCE_PORT: Key = Key::from_static_str("source.port"); +pub const SOURCE_PORT: &str = "source.port"; /// 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). /// @@ -454,7 +469,7 @@ pub const SOURCE_PORT: Key = Key::from_static_str("source.port"); /// # Examples /// /// - `arn:aws:lambda:us-east-1:123456:function:myfunction:myalias` -pub const AWS_LAMBDA_INVOKED_ARN: Key = Key::from_static_str("aws.lambda.invoked_arn"); +pub const AWS_LAMBDA_INVOKED_ARN: &str = "aws.lambda.invoked_arn"; /// The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. /// @@ -462,7 +477,7 @@ pub const AWS_LAMBDA_INVOKED_ARN: Key = Key::from_static_str("aws.lambda.invoked /// /// - `123e4567-e89b-12d3-a456-426614174000` /// - `0001` -pub const CLOUDEVENTS_EVENT_ID: Key = Key::from_static_str("cloudevents.event_id"); +pub const CLOUDEVENTS_EVENT_ID: &str = "cloudevents.event_id"; /// The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. /// @@ -471,15 +486,14 @@ pub const CLOUDEVENTS_EVENT_ID: Key = Key::from_static_str("cloudevents.event_id /// - `https://github.com/cloudevents` /// - `/cloudevents/spec/pull/123` /// - `my-service` -pub const CLOUDEVENTS_EVENT_SOURCE: Key = Key::from_static_str("cloudevents.event_source"); +pub const CLOUDEVENTS_EVENT_SOURCE: &str = "cloudevents.event_source"; /// The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. /// /// # Examples /// /// - `1.0` -pub const CLOUDEVENTS_EVENT_SPEC_VERSION: Key = - Key::from_static_str("cloudevents.event_spec_version"); +pub const CLOUDEVENTS_EVENT_SPEC_VERSION: &str = "cloudevents.event_spec_version"; /// The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. /// @@ -487,29 +501,29 @@ pub const CLOUDEVENTS_EVENT_SPEC_VERSION: Key = /// /// - `com.github.pull_request.opened` /// - `com.example.object.deleted.v2` -pub const CLOUDEVENTS_EVENT_TYPE: Key = Key::from_static_str("cloudevents.event_type"); +pub const CLOUDEVENTS_EVENT_TYPE: &str = "cloudevents.event_type"; /// The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). /// /// # Examples /// /// - `mynewfile.jpg` -pub const CLOUDEVENTS_EVENT_SUBJECT: Key = Key::from_static_str("cloudevents.event_subject"); +pub const CLOUDEVENTS_EVENT_SUBJECT: &str = "cloudevents.event_subject"; /// Parent-child Reference type. /// /// The causal relationship between a child Span and a parent Span. -pub const OPENTRACING_REF_TYPE: Key = Key::from_static_str("opentracing.ref_type"); +pub const OPENTRACING_REF_TYPE: &str = "opentracing.ref_type"; /// An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. -pub const DB_SYSTEM: Key = Key::from_static_str("db.system"); +pub const DB_SYSTEM: &str = "db.system"; /// The connection string used to connect to the database. It is recommended to remove embedded credentials. /// /// # Examples /// /// - `Server=(localdb)\v11.0;Integrated Security=true;` -pub const DB_CONNECTION_STRING: Key = Key::from_static_str("db.connection_string"); +pub const DB_CONNECTION_STRING: &str = "db.connection_string"; /// Username for accessing the database. /// @@ -517,7 +531,7 @@ pub const DB_CONNECTION_STRING: Key = Key::from_static_str("db.connection_string /// /// - `readonly_user` /// - `reporting_user` -pub const DB_USER: Key = Key::from_static_str("db.user"); +pub const DB_USER: &str = "db.user"; /// The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. /// @@ -525,7 +539,7 @@ pub const DB_USER: Key = Key::from_static_str("db.user"); /// /// - `org.postgresql.Driver` /// - `com.microsoft.sqlserver.jdbc.SQLServerDriver` -pub const DB_JDBC_DRIVER_CLASSNAME: Key = Key::from_static_str("db.jdbc.driver_classname"); +pub const DB_JDBC_DRIVER_CLASSNAME: &str = "db.jdbc.driver_classname"; /// This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). /// @@ -535,7 +549,7 @@ pub const DB_JDBC_DRIVER_CLASSNAME: Key = Key::from_static_str("db.jdbc.driver_c /// /// - `customers` /// - `main` -pub const DB_NAME: Key = Key::from_static_str("db.name"); +pub const DB_NAME: &str = "db.name"; /// The database statement being executed. /// @@ -543,7 +557,7 @@ pub const DB_NAME: Key = Key::from_static_str("db.name"); /// /// - `SELECT * FROM wuser_table` /// - `SET mykey "WuValue"` -pub const DB_STATEMENT: Key = Key::from_static_str("db.statement"); +pub const DB_STATEMENT: &str = "db.statement"; /// The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. /// @@ -554,7 +568,7 @@ pub const DB_STATEMENT: Key = Key::from_static_str("db.statement"); /// - `findAndModify` /// - `HMSET` /// - `SELECT` -pub const DB_OPERATION: Key = Key::from_static_str("db.operation"); +pub const DB_OPERATION: &str = "db.operation"; /// The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. /// @@ -563,18 +577,17 @@ pub const DB_OPERATION: Key = Key::from_static_str("db.operation"); /// # Examples /// /// - `MSSQLSERVER` -pub const DB_MSSQL_INSTANCE_NAME: Key = Key::from_static_str("db.mssql.instance_name"); +pub const DB_MSSQL_INSTANCE_NAME: &str = "db.mssql.instance_name"; /// The fetch size used for paging, i.e. how many rows will be returned at once. /// /// # Examples /// /// - `5000` -pub const DB_CASSANDRA_PAGE_SIZE: Key = Key::from_static_str("db.cassandra.page_size"); +pub const DB_CASSANDRA_PAGE_SIZE: &str = "db.cassandra.page_size"; /// The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). -pub const DB_CASSANDRA_CONSISTENCY_LEVEL: Key = - Key::from_static_str("db.cassandra.consistency_level"); +pub const DB_CASSANDRA_CONSISTENCY_LEVEL: &str = "db.cassandra.consistency_level"; /// The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). /// @@ -583,10 +596,10 @@ pub const DB_CASSANDRA_CONSISTENCY_LEVEL: Key = /// # Examples /// /// - `mytable` -pub const DB_CASSANDRA_TABLE: Key = Key::from_static_str("db.cassandra.table"); +pub const DB_CASSANDRA_TABLE: &str = "db.cassandra.table"; /// Whether or not the query is idempotent. -pub const DB_CASSANDRA_IDEMPOTENCE: Key = Key::from_static_str("db.cassandra.idempotence"); +pub const DB_CASSANDRA_IDEMPOTENCE: &str = "db.cassandra.idempotence"; /// The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. /// @@ -594,22 +607,22 @@ pub const DB_CASSANDRA_IDEMPOTENCE: Key = Key::from_static_str("db.cassandra.ide /// /// - `0` /// - `2` -pub const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: Key = - Key::from_static_str("db.cassandra.speculative_execution_count"); +pub const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: &str = + "db.cassandra.speculative_execution_count"; /// The ID of the coordinating node for a query. /// /// # Examples /// /// - `be13faa2-8574-4d71-926d-27f16cf8a7af` -pub const DB_CASSANDRA_COORDINATOR_ID: Key = Key::from_static_str("db.cassandra.coordinator.id"); +pub const DB_CASSANDRA_COORDINATOR_ID: &str = "db.cassandra.coordinator.id"; /// The data center of the coordinating node for a query. /// /// # Examples /// /// - `us-west-2` -pub const DB_CASSANDRA_COORDINATOR_DC: Key = Key::from_static_str("db.cassandra.coordinator.dc"); +pub const DB_CASSANDRA_COORDINATOR_DC: &str = "db.cassandra.coordinator.dc"; /// The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. /// @@ -618,7 +631,7 @@ pub const DB_CASSANDRA_COORDINATOR_DC: Key = Key::from_static_str("db.cassandra. /// - `0` /// - `1` /// - `15` -pub const DB_REDIS_DATABASE_INDEX: Key = Key::from_static_str("db.redis.database_index"); +pub const DB_REDIS_DATABASE_INDEX: &str = "db.redis.database_index"; /// The collection being accessed within the database stated in `db.name`. /// @@ -626,7 +639,7 @@ pub const DB_REDIS_DATABASE_INDEX: Key = Key::from_static_str("db.redis.database /// /// - `customers` /// - `products` -pub const DB_MONGODB_COLLECTION: Key = Key::from_static_str("db.mongodb.collection"); +pub const DB_MONGODB_COLLECTION: &str = "db.mongodb.collection"; /// The name of the primary table that the operation is acting upon, including the database name (if applicable). /// @@ -636,31 +649,30 @@ pub const DB_MONGODB_COLLECTION: Key = Key::from_static_str("db.mongodb.collecti /// /// - `public.users` /// - `customers` -pub const DB_SQL_TABLE: Key = Key::from_static_str("db.sql.table"); +pub const DB_SQL_TABLE: &str = "db.sql.table"; /// Unique Cosmos client instance id. /// /// # Examples /// /// - `3ba4827d-4422-483f-b59f-85b74211c11d` -pub const DB_COSMOSDB_CLIENT_ID: Key = Key::from_static_str("db.cosmosdb.client_id"); +pub const DB_COSMOSDB_CLIENT_ID: &str = "db.cosmosdb.client_id"; /// CosmosDB Operation Type. -pub const DB_COSMOSDB_OPERATION_TYPE: Key = Key::from_static_str("db.cosmosdb.operation_type"); +pub const DB_COSMOSDB_OPERATION_TYPE: &str = "db.cosmosdb.operation_type"; /// Cosmos client connection mode. -pub const DB_COSMOSDB_CONNECTION_MODE: Key = Key::from_static_str("db.cosmosdb.connection_mode"); +pub const DB_COSMOSDB_CONNECTION_MODE: &str = "db.cosmosdb.connection_mode"; /// Cosmos DB container name. /// /// # Examples /// /// - `anystring` -pub const DB_COSMOSDB_CONTAINER: Key = Key::from_static_str("db.cosmosdb.container"); +pub const DB_COSMOSDB_CONTAINER: &str = "db.cosmosdb.container"; /// Request payload size in bytes. -pub const DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Key = - Key::from_static_str("db.cosmosdb.request_content_length"); +pub const DB_COSMOSDB_REQUEST_CONTENT_LENGTH: &str = "db.cosmosdb.request_content_length"; /// Cosmos DB status code. /// @@ -668,7 +680,7 @@ pub const DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Key = /// /// - `200` /// - `201` -pub const DB_COSMOSDB_STATUS_CODE: Key = Key::from_static_str("db.cosmosdb.status_code"); +pub const DB_COSMOSDB_STATUS_CODE: &str = "db.cosmosdb.status_code"; /// Cosmos DB sub status code. /// @@ -676,7 +688,7 @@ pub const DB_COSMOSDB_STATUS_CODE: Key = Key::from_static_str("db.cosmosdb.statu /// /// - `1000` /// - `1002` -pub const DB_COSMOSDB_SUB_STATUS_CODE: Key = Key::from_static_str("db.cosmosdb.sub_status_code"); +pub const DB_COSMOSDB_SUB_STATUS_CODE: &str = "db.cosmosdb.sub_status_code"; /// RU consumed for that operation. /// @@ -684,17 +696,17 @@ pub const DB_COSMOSDB_SUB_STATUS_CODE: Key = Key::from_static_str("db.cosmosdb.s /// /// - `46.18` /// - `1.0` -pub const DB_COSMOSDB_REQUEST_CHARGE: Key = Key::from_static_str("db.cosmosdb.request_charge"); +pub const DB_COSMOSDB_REQUEST_CHARGE: &str = "db.cosmosdb.request_charge"; /// Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. -pub const OTEL_STATUS_CODE: Key = Key::from_static_str("otel.status_code"); +pub const OTEL_STATUS_CODE: &str = "otel.status_code"; /// Description of the Status if it has a value, otherwise not set. /// /// # Examples /// /// - `resource not found` -pub const OTEL_STATUS_DESCRIPTION: Key = Key::from_static_str("otel.status_description"); +pub const OTEL_STATUS_DESCRIPTION: &str = "otel.status_description"; /// Type of the trigger which caused this function invocation. /// @@ -707,14 +719,14 @@ pub const OTEL_STATUS_DESCRIPTION: Key = Key::from_static_str("otel.status_descr /// trigger that corresponding incoming would have (i.e., this has /// nothing to do with the underlying transport used to make the API /// call to invoke the lambda, which is often HTTP). -pub const FAAS_TRIGGER: Key = Key::from_static_str("faas.trigger"); +pub const FAAS_TRIGGER: &str = "faas.trigger"; /// The invocation ID of the current function invocation. /// /// # Examples /// /// - `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` -pub const FAAS_INVOCATION_ID: Key = Key::from_static_str("faas.invocation_id"); +pub const FAAS_INVOCATION_ID: &str = "faas.invocation_id"; /// The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. /// @@ -722,17 +734,17 @@ pub const FAAS_INVOCATION_ID: Key = Key::from_static_str("faas.invocation_id"); /// /// - `myBucketName` /// - `myDbName` -pub const FAAS_DOCUMENT_COLLECTION: Key = Key::from_static_str("faas.document.collection"); +pub const FAAS_DOCUMENT_COLLECTION: &str = "faas.document.collection"; /// Describes the type of the operation that was performed on the data. -pub const FAAS_DOCUMENT_OPERATION: Key = Key::from_static_str("faas.document.operation"); +pub const FAAS_DOCUMENT_OPERATION: &str = "faas.document.operation"; /// A string containing the time when the data was accessed 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). /// /// # Examples /// /// - `2020-01-23T13:47:06Z` -pub const FAAS_DOCUMENT_TIME: Key = Key::from_static_str("faas.document.time"); +pub const FAAS_DOCUMENT_TIME: &str = "faas.document.time"; /// 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. /// @@ -740,24 +752,24 @@ pub const FAAS_DOCUMENT_TIME: Key = Key::from_static_str("faas.document.time"); /// /// - `myFile.txt` /// - `myTableName` -pub const FAAS_DOCUMENT_NAME: Key = Key::from_static_str("faas.document.name"); +pub const FAAS_DOCUMENT_NAME: &str = "faas.document.name"; /// 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). /// /// # Examples /// /// - `2020-01-23T13:47:06Z` -pub const FAAS_TIME: Key = Key::from_static_str("faas.time"); +pub const FAAS_TIME: &str = "faas.time"; /// A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). /// /// # Examples /// /// - `0/5 * * * ? *` -pub const FAAS_CRON: Key = Key::from_static_str("faas.cron"); +pub const FAAS_CRON: &str = "faas.cron"; /// A boolean that is true if the serverless function is executed for the first time (aka cold-start). -pub const FAAS_COLDSTART: Key = Key::from_static_str("faas.coldstart"); +pub const FAAS_COLDSTART: &str = "faas.coldstart"; /// The name of the invoked function. /// @@ -766,12 +778,12 @@ pub const FAAS_COLDSTART: Key = Key::from_static_str("faas.coldstart"); /// # Examples /// /// - `my-function` -pub const FAAS_INVOKED_NAME: Key = Key::from_static_str("faas.invoked_name"); +pub const FAAS_INVOKED_NAME: &str = "faas.invoked_name"; /// The cloud provider of the invoked function. /// /// SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. -pub const FAAS_INVOKED_PROVIDER: Key = Key::from_static_str("faas.invoked_provider"); +pub const FAAS_INVOKED_PROVIDER: &str = "faas.invoked_provider"; /// The cloud region of the invoked function. /// @@ -780,21 +792,21 @@ pub const FAAS_INVOKED_PROVIDER: Key = Key::from_static_str("faas.invoked_provid /// # Examples /// /// - `eu-central-1` -pub const FAAS_INVOKED_REGION: Key = Key::from_static_str("faas.invoked_region"); +pub const FAAS_INVOKED_REGION: &str = "faas.invoked_region"; /// The unique identifier of the feature flag. /// /// # Examples /// /// - `logo-color` -pub const FEATURE_FLAG_KEY: Key = Key::from_static_str("feature_flag.key"); +pub const FEATURE_FLAG_KEY: &str = "feature_flag.key"; /// The name of the service provider that performs the flag evaluation. /// /// # Examples /// /// - `Flag Manager` -pub const FEATURE_FLAG_PROVIDER_NAME: Key = Key::from_static_str("feature_flag.provider_name"); +pub const FEATURE_FLAG_PROVIDER_NAME: &str = "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. /// @@ -812,7 +824,7 @@ pub const FEATURE_FLAG_PROVIDER_NAME: Key = Key::from_static_str("feature_flag.p /// - `red` /// - `true` /// - `on` -pub const FEATURE_FLAG_VARIANT: Key = Key::from_static_str("feature_flag.variant"); +pub const FEATURE_FLAG_VARIANT: &str = "feature_flag.variant"; /// [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. /// @@ -820,7 +832,7 @@ pub const FEATURE_FLAG_VARIANT: Key = Key::from_static_str("feature_flag.variant /// /// - `tcp` /// - `udp` -pub const NETWORK_TRANSPORT: Key = Key::from_static_str("network.transport"); +pub const NETWORK_TRANSPORT: &str = "network.transport"; /// [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. /// @@ -828,7 +840,7 @@ pub const NETWORK_TRANSPORT: Key = Key::from_static_str("network.transport"); /// /// - `ipv4` /// - `ipv6` -pub const NETWORK_TYPE: Key = Key::from_static_str("network.type"); +pub const NETWORK_TYPE: &str = "network.type"; /// [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. /// @@ -837,7 +849,7 @@ pub const NETWORK_TYPE: Key = Key::from_static_str("network.type"); /// - `amqp` /// - `http` /// - `mqtt` -pub const NETWORK_PROTOCOL_NAME: Key = Key::from_static_str("network.protocol.name"); +pub const NETWORK_PROTOCOL_NAME: &str = "network.protocol.name"; /// Version of the application layer protocol used. See note below. /// @@ -846,126 +858,126 @@ pub const NETWORK_PROTOCOL_NAME: Key = Key::from_static_str("network.protocol.na /// # Examples /// /// - `3.1.1` -pub const NETWORK_PROTOCOL_VERSION: Key = Key::from_static_str("network.protocol.version"); +pub const NETWORK_PROTOCOL_VERSION: &str = "network.protocol.version"; /// The internet connection type. /// /// # Examples /// /// - `wifi` -pub const NETWORK_CONNECTION_TYPE: Key = Key::from_static_str("network.connection.type"); +pub const NETWORK_CONNECTION_TYPE: &str = "network.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. /// /// # Examples /// /// - `LTE` -pub const NETWORK_CONNECTION_SUBTYPE: Key = Key::from_static_str("network.connection.subtype"); +pub const NETWORK_CONNECTION_SUBTYPE: &str = "network.connection.subtype"; /// The name of the mobile carrier. /// /// # Examples /// /// - `sprint` -pub const NETWORK_CARRIER_NAME: Key = Key::from_static_str("network.carrier.name"); +pub const NETWORK_CARRIER_NAME: &str = "network.carrier.name"; /// The mobile carrier country code. /// /// # Examples /// /// - `310` -pub const NETWORK_CARRIER_MCC: Key = Key::from_static_str("network.carrier.mcc"); +pub const NETWORK_CARRIER_MCC: &str = "network.carrier.mcc"; /// The mobile carrier network code. /// /// # Examples /// /// - `001` -pub const NETWORK_CARRIER_MNC: Key = Key::from_static_str("network.carrier.mnc"); +pub const NETWORK_CARRIER_MNC: &str = "network.carrier.mnc"; /// The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. /// /// # Examples /// /// - `DE` -pub const NETWORK_CARRIER_ICC: Key = Key::from_static_str("network.carrier.icc"); +pub const NETWORK_CARRIER_ICC: &str = "network.carrier.icc"; /// The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. /// /// # Examples /// /// - `AuthTokenCache` -pub const PEER_SERVICE: Key = Key::from_static_str("peer.service"); +pub const PEER_SERVICE: &str = "peer.service"; /// Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. /// /// # Examples /// /// - `username` -pub const ENDUSER_ID: Key = Key::from_static_str("enduser.id"); +pub const ENDUSER_ID: &str = "enduser.id"; /// Actual/assumed role the client is making the request under extracted from token or application security context. /// /// # Examples /// /// - `admin` -pub const ENDUSER_ROLE: Key = Key::from_static_str("enduser.role"); +pub const ENDUSER_ROLE: &str = "enduser.role"; /// Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). /// /// # Examples /// /// - `read:message, write:files` -pub const ENDUSER_SCOPE: Key = Key::from_static_str("enduser.scope"); +pub const ENDUSER_SCOPE: &str = "enduser.scope"; /// Current "managed" thread ID (as opposed to OS thread ID). /// /// # Examples /// /// - `42` -pub const THREAD_ID: Key = Key::from_static_str("thread.id"); +pub const THREAD_ID: &str = "thread.id"; /// Current thread name. /// /// # Examples /// /// - `main` -pub const THREAD_NAME: Key = Key::from_static_str("thread.name"); +pub const THREAD_NAME: &str = "thread.name"; /// The method or function name, or equivalent (usually rightmost part of the code unit's name). /// /// # Examples /// /// - `serveRequest` -pub const CODE_FUNCTION: Key = Key::from_static_str("code.function"); +pub const CODE_FUNCTION: &str = "code.function"; /// The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. /// /// # Examples /// /// - `com.example.MyHttpService` -pub const CODE_NAMESPACE: Key = Key::from_static_str("code.namespace"); +pub const CODE_NAMESPACE: &str = "code.namespace"; /// The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). /// /// # Examples /// /// - `/usr/local/MyApplication/content_root/app/index.php` -pub const CODE_FILEPATH: Key = Key::from_static_str("code.filepath"); +pub const CODE_FILEPATH: &str = "code.filepath"; /// The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. /// /// # Examples /// /// - `42` -pub const CODE_LINENO: Key = Key::from_static_str("code.lineno"); +pub const CODE_LINENO: &str = "code.lineno"; /// The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. /// /// # Examples /// /// - `16` -pub const CODE_COLUMN: Key = Key::from_static_str("code.column"); +pub const CODE_COLUMN: &str = "code.column"; /// Original HTTP method sent by the client in the request line. /// @@ -974,21 +986,21 @@ pub const CODE_COLUMN: Key = Key::from_static_str("code.column"); /// - `GeT` /// - `ACL` /// - `foo` -pub const HTTP_REQUEST_METHOD_ORIGINAL: Key = Key::from_static_str("http.request.method_original"); +pub const HTTP_REQUEST_METHOD_ORIGINAL: &str = "http.request.method_original"; /// 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. /// /// # Examples /// /// - `3495` -pub const HTTP_REQUEST_BODY_SIZE: Key = Key::from_static_str("http.request.body.size"); +pub const HTTP_REQUEST_BODY_SIZE: &str = "http.request.body.size"; /// 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. /// /// # Examples /// /// - `3495` -pub const HTTP_RESPONSE_BODY_SIZE: Key = Key::from_static_str("http.response.body.size"); +pub const HTTP_RESPONSE_BODY_SIZE: &str = "http.response.body.size"; /// The ordinal number of request resending attempt (for any reason, including redirects). /// @@ -997,7 +1009,7 @@ pub const HTTP_RESPONSE_BODY_SIZE: Key = Key::from_static_str("http.response.bod /// # Examples /// /// - `3` -pub const HTTP_RESEND_COUNT: Key = Key::from_static_str("http.resend_count"); +pub const HTTP_RESEND_COUNT: &str = "http.resend_count"; /// The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. /// @@ -1005,7 +1017,7 @@ pub const HTTP_RESEND_COUNT: Key = Key::from_static_str("http.resend_count"); /// /// - `79b9da39-b7ae-508a-a6bc-864b2829c622` /// - `C9ER4AJX75574TDJ` -pub const AWS_REQUEST_ID: Key = Key::from_static_str("aws.request_id"); +pub const AWS_REQUEST_ID: &str = "aws.request_id"; /// The keys in the `RequestItems` object field. /// @@ -1013,23 +1025,21 @@ pub const AWS_REQUEST_ID: Key = Key::from_static_str("aws.request_id"); /// /// - `Users` /// - `Cats` -pub const AWS_DYNAMODB_TABLE_NAMES: Key = Key::from_static_str("aws.dynamodb.table_names"); +pub const AWS_DYNAMODB_TABLE_NAMES: &str = "aws.dynamodb.table_names"; /// The JSON-serialized value of each item in the `ConsumedCapacity` response field. /// /// # Examples /// /// - `{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number }` -pub const AWS_DYNAMODB_CONSUMED_CAPACITY: Key = - Key::from_static_str("aws.dynamodb.consumed_capacity"); +pub const AWS_DYNAMODB_CONSUMED_CAPACITY: &str = "aws.dynamodb.consumed_capacity"; /// The JSON-serialized value of the `ItemCollectionMetrics` response field. /// /// # Examples /// /// - `{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }` -pub const AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Key = - Key::from_static_str("aws.dynamodb.item_collection_metrics"); +pub const AWS_DYNAMODB_ITEM_COLLECTION_METRICS: &str = "aws.dynamodb.item_collection_metrics"; /// The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. /// @@ -1037,8 +1047,7 @@ pub const AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Key = /// /// - `1.0` /// - `2.0` -pub const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Key = - Key::from_static_str("aws.dynamodb.provisioned_read_capacity"); +pub const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: &str = "aws.dynamodb.provisioned_read_capacity"; /// The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. /// @@ -1046,11 +1055,10 @@ pub const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Key = /// /// - `1.0` /// - `2.0` -pub const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: Key = - Key::from_static_str("aws.dynamodb.provisioned_write_capacity"); +pub const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: &str = "aws.dynamodb.provisioned_write_capacity"; /// The value of the `ConsistentRead` request parameter. -pub const AWS_DYNAMODB_CONSISTENT_READ: Key = Key::from_static_str("aws.dynamodb.consistent_read"); +pub const AWS_DYNAMODB_CONSISTENT_READ: &str = "aws.dynamodb.consistent_read"; /// The value of the `ProjectionExpression` request parameter. /// @@ -1059,14 +1067,14 @@ pub const AWS_DYNAMODB_CONSISTENT_READ: Key = Key::from_static_str("aws.dynamodb /// - `Title` /// - `Title, Price, Color` /// - `Title, Description, RelatedItems, ProductReviews` -pub const AWS_DYNAMODB_PROJECTION: Key = Key::from_static_str("aws.dynamodb.projection"); +pub const AWS_DYNAMODB_PROJECTION: &str = "aws.dynamodb.projection"; /// The value of the `Limit` request parameter. /// /// # Examples /// /// - `10` -pub const AWS_DYNAMODB_LIMIT: Key = Key::from_static_str("aws.dynamodb.limit"); +pub const AWS_DYNAMODB_LIMIT: &str = "aws.dynamodb.limit"; /// The value of the `AttributesToGet` request parameter. /// @@ -1074,15 +1082,14 @@ pub const AWS_DYNAMODB_LIMIT: Key = Key::from_static_str("aws.dynamodb.limit"); /// /// - `lives` /// - `id` -pub const AWS_DYNAMODB_ATTRIBUTES_TO_GET: Key = - Key::from_static_str("aws.dynamodb.attributes_to_get"); +pub const AWS_DYNAMODB_ATTRIBUTES_TO_GET: &str = "aws.dynamodb.attributes_to_get"; /// The value of the `IndexName` request parameter. /// /// # Examples /// /// - `name_to_group` -pub const AWS_DYNAMODB_INDEX_NAME: Key = Key::from_static_str("aws.dynamodb.index_name"); +pub const AWS_DYNAMODB_INDEX_NAME: &str = "aws.dynamodb.index_name"; /// The value of the `Select` request parameter. /// @@ -1090,23 +1097,21 @@ pub const AWS_DYNAMODB_INDEX_NAME: Key = Key::from_static_str("aws.dynamodb.inde /// /// - `ALL_ATTRIBUTES` /// - `COUNT` -pub const AWS_DYNAMODB_SELECT: Key = Key::from_static_str("aws.dynamodb.select"); +pub const AWS_DYNAMODB_SELECT: &str = "aws.dynamodb.select"; /// The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. /// /// # Examples /// /// - `{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }` -pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: Key = - Key::from_static_str("aws.dynamodb.global_secondary_indexes"); +pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: &str = "aws.dynamodb.global_secondary_indexes"; /// The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. /// /// # Examples /// /// - `{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }` -pub const AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Key = - Key::from_static_str("aws.dynamodb.local_secondary_indexes"); +pub const AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: &str = "aws.dynamodb.local_secondary_indexes"; /// The value of the `ExclusiveStartTableName` request parameter. /// @@ -1114,62 +1119,60 @@ pub const AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Key = /// /// - `Users` /// - `CatsTable` -pub const AWS_DYNAMODB_EXCLUSIVE_START_TABLE: Key = - Key::from_static_str("aws.dynamodb.exclusive_start_table"); +pub const AWS_DYNAMODB_EXCLUSIVE_START_TABLE: &str = "aws.dynamodb.exclusive_start_table"; /// The the number of items in the `TableNames` response parameter. /// /// # Examples /// /// - `20` -pub const AWS_DYNAMODB_TABLE_COUNT: Key = Key::from_static_str("aws.dynamodb.table_count"); +pub const AWS_DYNAMODB_TABLE_COUNT: &str = "aws.dynamodb.table_count"; /// The value of the `ScanIndexForward` request parameter. -pub const AWS_DYNAMODB_SCAN_FORWARD: Key = Key::from_static_str("aws.dynamodb.scan_forward"); +pub const AWS_DYNAMODB_SCAN_FORWARD: &str = "aws.dynamodb.scan_forward"; /// The value of the `Segment` request parameter. /// /// # Examples /// /// - `10` -pub const AWS_DYNAMODB_SEGMENT: Key = Key::from_static_str("aws.dynamodb.segment"); +pub const AWS_DYNAMODB_SEGMENT: &str = "aws.dynamodb.segment"; /// The value of the `TotalSegments` request parameter. /// /// # Examples /// /// - `100` -pub const AWS_DYNAMODB_TOTAL_SEGMENTS: Key = Key::from_static_str("aws.dynamodb.total_segments"); +pub const AWS_DYNAMODB_TOTAL_SEGMENTS: &str = "aws.dynamodb.total_segments"; /// The value of the `Count` response parameter. /// /// # Examples /// /// - `10` -pub const AWS_DYNAMODB_COUNT: Key = Key::from_static_str("aws.dynamodb.count"); +pub const AWS_DYNAMODB_COUNT: &str = "aws.dynamodb.count"; /// The value of the `ScannedCount` response parameter. /// /// # Examples /// /// - `50` -pub const AWS_DYNAMODB_SCANNED_COUNT: Key = Key::from_static_str("aws.dynamodb.scanned_count"); +pub const AWS_DYNAMODB_SCANNED_COUNT: &str = "aws.dynamodb.scanned_count"; /// The JSON-serialized value of each item in the `AttributeDefinitions` request field. /// /// # Examples /// /// - `{ "AttributeName": "string", "AttributeType": "string" }` -pub const AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: Key = - Key::from_static_str("aws.dynamodb.attribute_definitions"); +pub const AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: &str = "aws.dynamodb.attribute_definitions"; /// The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. /// /// # Examples /// /// - `{ "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }` -pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Key = - Key::from_static_str("aws.dynamodb.global_secondary_index_updates"); +pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: &str = + "aws.dynamodb.global_secondary_index_updates"; /// The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. /// @@ -1179,7 +1182,7 @@ pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Key = /// # Examples /// /// - `some-bucket-name` -pub const AWS_S3_BUCKET: Key = Key::from_static_str("aws.s3.bucket"); +pub const AWS_S3_BUCKET: &str = "aws.s3.bucket"; /// The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. /// @@ -1203,7 +1206,7 @@ pub const AWS_S3_BUCKET: Key = Key::from_static_str("aws.s3.bucket"); /// # Examples /// /// - `someFile.yml` -pub const AWS_S3_KEY: Key = Key::from_static_str("aws.s3.key"); +pub const AWS_S3_KEY: &str = "aws.s3.key"; /// The source object (in the form `bucket`/`key`) for the copy operation. /// @@ -1217,7 +1220,7 @@ pub const AWS_S3_KEY: Key = Key::from_static_str("aws.s3.key"); /// # Examples /// /// - `someFile.yml` -pub const AWS_S3_COPY_SOURCE: Key = Key::from_static_str("aws.s3.copy_source"); +pub const AWS_S3_COPY_SOURCE: &str = "aws.s3.copy_source"; /// Upload ID that identifies the multipart upload. /// @@ -1234,7 +1237,7 @@ pub const AWS_S3_COPY_SOURCE: Key = Key::from_static_str("aws.s3.copy_source"); /// # Examples /// /// - `dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ` -pub const AWS_S3_UPLOAD_ID: Key = Key::from_static_str("aws.s3.upload_id"); +pub const AWS_S3_UPLOAD_ID: &str = "aws.s3.upload_id"; /// The delete request container that specifies the objects to be deleted. /// @@ -1245,7 +1248,7 @@ pub const AWS_S3_UPLOAD_ID: Key = Key::from_static_str("aws.s3.upload_id"); /// # Examples /// /// - `Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean` -pub const AWS_S3_DELETE: Key = Key::from_static_str("aws.s3.delete"); +pub const AWS_S3_DELETE: &str = "aws.s3.delete"; /// The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. /// @@ -1257,14 +1260,14 @@ pub const AWS_S3_DELETE: Key = Key::from_static_str("aws.s3.delete"); /// # Examples /// /// - `3456` -pub const AWS_S3_PART_NUMBER: Key = Key::from_static_str("aws.s3.part_number"); +pub const AWS_S3_PART_NUMBER: &str = "aws.s3.part_number"; /// The name of the operation being executed. /// /// # Examples /// /// - `findBookById` -pub const GRAPHQL_OPERATION_NAME: Key = Key::from_static_str("graphql.operation.name"); +pub const GRAPHQL_OPERATION_NAME: &str = "graphql.operation.name"; /// The type of the operation being executed. /// @@ -1273,7 +1276,7 @@ pub const GRAPHQL_OPERATION_NAME: Key = Key::from_static_str("graphql.operation. /// - `query` /// - `mutation` /// - `subscription` -pub const GRAPHQL_OPERATION_TYPE: Key = Key::from_static_str("graphql.operation.type"); +pub const GRAPHQL_OPERATION_TYPE: &str = "graphql.operation.type"; /// The GraphQL document being executed. /// @@ -1282,38 +1285,36 @@ pub const GRAPHQL_OPERATION_TYPE: Key = Key::from_static_str("graphql.operation. /// # Examples /// /// - `query findBookById { bookById(id: ?) { name } }` -pub const GRAPHQL_DOCUMENT: Key = Key::from_static_str("graphql.document"); +pub const GRAPHQL_DOCUMENT: &str = "graphql.document"; /// A value used by the messaging system as an identifier for the message, represented as a string. /// /// # Examples /// /// - `452a7c7c7c7048c2f887f61572b18fc2` -pub const MESSAGING_MESSAGE_ID: Key = Key::from_static_str("messaging.message.id"); +pub const MESSAGING_MESSAGE_ID: &str = "messaging.message.id"; /// The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". /// /// # Examples /// /// - `MyConversationId` -pub const MESSAGING_MESSAGE_CONVERSATION_ID: Key = - Key::from_static_str("messaging.message.conversation_id"); +pub const MESSAGING_MESSAGE_CONVERSATION_ID: &str = "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. /// /// # Examples /// /// - `2738` -pub const MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: Key = - Key::from_static_str("messaging.message.payload_size_bytes"); +pub const MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: &str = "messaging.message.payload_size_bytes"; /// The compressed size of the message payload in bytes. /// /// # Examples /// /// - `2048` -pub const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: Key = - Key::from_static_str("messaging.message.payload_compressed_size_bytes"); +pub const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: &str = + "messaging.message.payload_compressed_size_bytes"; /// The message destination name. /// @@ -1324,7 +1325,7 @@ pub const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: Key = /// /// - `MyQueue` /// - `MyTopic` -pub const MESSAGING_DESTINATION_NAME: Key = Key::from_static_str("messaging.destination.name"); +pub const MESSAGING_DESTINATION_NAME: &str = "messaging.destination.name"; /// Low cardinality representation of the messaging destination name. /// @@ -1333,16 +1334,13 @@ pub const MESSAGING_DESTINATION_NAME: Key = Key::from_static_str("messaging.dest /// # Examples /// /// - `/customers/{customerId}` -pub const MESSAGING_DESTINATION_TEMPLATE: Key = - Key::from_static_str("messaging.destination.template"); +pub const MESSAGING_DESTINATION_TEMPLATE: &str = "messaging.destination.template"; /// A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. -pub const MESSAGING_DESTINATION_TEMPORARY: Key = - Key::from_static_str("messaging.destination.temporary"); +pub const MESSAGING_DESTINATION_TEMPORARY: &str = "messaging.destination.temporary"; /// A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). -pub const MESSAGING_DESTINATION_ANONYMOUS: Key = - Key::from_static_str("messaging.destination.anonymous"); +pub const MESSAGING_DESTINATION_ANONYMOUS: &str = "messaging.destination.anonymous"; /// A string identifying the messaging system. /// @@ -1353,12 +1351,12 @@ pub const MESSAGING_DESTINATION_ANONYMOUS: Key = /// - `rocketmq` /// - `activemq` /// - `AmazonSQS` -pub const MESSAGING_SYSTEM: Key = Key::from_static_str("messaging.system"); +pub const MESSAGING_SYSTEM: &str = "messaging.system"; /// A string identifying the kind of messaging operation as defined in the [Operation names](#operation-names) section above. /// /// If a custom value is used, it MUST be of low cardinality. -pub const MESSAGING_OPERATION: Key = Key::from_static_str("messaging.operation"); +pub const MESSAGING_OPERATION: &str = "messaging.operation"; /// The number of messages sent, received, or processed in the scope of the batching operation. /// @@ -1369,8 +1367,7 @@ pub const MESSAGING_OPERATION: Key = Key::from_static_str("messaging.operation") /// - `0` /// - `1` /// - `2` -pub const MESSAGING_BATCH_MESSAGE_COUNT: Key = - Key::from_static_str("messaging.batch.message_count"); +pub const MESSAGING_BATCH_MESSAGE_COUNT: &str = "messaging.batch.message_count"; /// A unique identifier for the client that consumes or produces a message. /// @@ -1378,15 +1375,15 @@ pub const MESSAGING_BATCH_MESSAGE_COUNT: Key = /// /// - `client-5` /// - `myhost@8742@s8083jm` -pub const MESSAGING_CLIENT_ID: Key = Key::from_static_str("messaging.client_id"); +pub const MESSAGING_CLIENT_ID: &str = "messaging.client_id"; /// RabbitMQ message routing key. /// /// # Examples /// /// - `myKey` -pub const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: Key = - Key::from_static_str("messaging.rabbitmq.destination.routing_key"); +pub const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: &str = + "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 `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. /// @@ -1395,86 +1392,78 @@ pub const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: Key = /// # Examples /// /// - `myKey` -pub const MESSAGING_KAFKA_MESSAGE_KEY: Key = Key::from_static_str("messaging.kafka.message.key"); +pub const MESSAGING_KAFKA_MESSAGE_KEY: &str = "messaging.kafka.message.key"; /// Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. /// /// # Examples /// /// - `my-group` -pub const MESSAGING_KAFKA_CONSUMER_GROUP: Key = - Key::from_static_str("messaging.kafka.consumer.group"); +pub const MESSAGING_KAFKA_CONSUMER_GROUP: &str = "messaging.kafka.consumer.group"; /// Partition the message is sent to. /// /// # Examples /// /// - `2` -pub const MESSAGING_KAFKA_DESTINATION_PARTITION: Key = - Key::from_static_str("messaging.kafka.destination.partition"); +pub const MESSAGING_KAFKA_DESTINATION_PARTITION: &str = "messaging.kafka.destination.partition"; /// The offset of a record in the corresponding Kafka partition. /// /// # Examples /// /// - `42` -pub const MESSAGING_KAFKA_MESSAGE_OFFSET: Key = - Key::from_static_str("messaging.kafka.message.offset"); +pub const MESSAGING_KAFKA_MESSAGE_OFFSET: &str = "messaging.kafka.message.offset"; /// A boolean that is true if the message is a tombstone. -pub const MESSAGING_KAFKA_MESSAGE_TOMBSTONE: Key = - Key::from_static_str("messaging.kafka.message.tombstone"); +pub const MESSAGING_KAFKA_MESSAGE_TOMBSTONE: &str = "messaging.kafka.message.tombstone"; /// Namespace of RocketMQ resources, resources in different namespaces are individual. /// /// # Examples /// /// - `myNamespace` -pub const MESSAGING_ROCKETMQ_NAMESPACE: Key = Key::from_static_str("messaging.rocketmq.namespace"); +pub const MESSAGING_ROCKETMQ_NAMESPACE: &str = "messaging.rocketmq.namespace"; /// Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. /// /// # Examples /// /// - `myConsumerGroup` -pub const MESSAGING_ROCKETMQ_CLIENT_GROUP: Key = - Key::from_static_str("messaging.rocketmq.client_group"); +pub const MESSAGING_ROCKETMQ_CLIENT_GROUP: &str = "messaging.rocketmq.client_group"; /// The timestamp in milliseconds that the delay message is expected to be delivered to consumer. /// /// # Examples /// /// - `1665987217045` -pub const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: Key = - Key::from_static_str("messaging.rocketmq.message.delivery_timestamp"); +pub const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: &str = + "messaging.rocketmq.message.delivery_timestamp"; /// The delay time level for delay message, which determines the message delay time. /// /// # Examples /// /// - `3` -pub const MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: Key = - Key::from_static_str("messaging.rocketmq.message.delay_time_level"); +pub const MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: &str = + "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. /// /// # Examples /// /// - `myMessageGroup` -pub const MESSAGING_ROCKETMQ_MESSAGE_GROUP: Key = - Key::from_static_str("messaging.rocketmq.message.group"); +pub const MESSAGING_ROCKETMQ_MESSAGE_GROUP: &str = "messaging.rocketmq.message.group"; /// Type of message. -pub const MESSAGING_ROCKETMQ_MESSAGE_TYPE: Key = - Key::from_static_str("messaging.rocketmq.message.type"); +pub const MESSAGING_ROCKETMQ_MESSAGE_TYPE: &str = "messaging.rocketmq.message.type"; /// The secondary classifier of message besides topic. /// /// # Examples /// /// - `tagA` -pub const MESSAGING_ROCKETMQ_MESSAGE_TAG: Key = - Key::from_static_str("messaging.rocketmq.message.tag"); +pub const MESSAGING_ROCKETMQ_MESSAGE_TAG: &str = "messaging.rocketmq.message.tag"; /// Key(s) of message, another way to mark message besides message id. /// @@ -1482,15 +1471,13 @@ pub const MESSAGING_ROCKETMQ_MESSAGE_TAG: Key = /// /// - `keyA` /// - `keyB` -pub const MESSAGING_ROCKETMQ_MESSAGE_KEYS: Key = - Key::from_static_str("messaging.rocketmq.message.keys"); +pub const MESSAGING_ROCKETMQ_MESSAGE_KEYS: &str = "messaging.rocketmq.message.keys"; /// Model of message consumption. This only applies to consumer spans. -pub const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: Key = - Key::from_static_str("messaging.rocketmq.consumption_model"); +pub const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: &str = "messaging.rocketmq.consumption_model"; /// A string identifying the remoting system. See below for a list of well-known identifiers. -pub const RPC_SYSTEM: Key = Key::from_static_str("rpc.system"); +pub const RPC_SYSTEM: &str = "rpc.system"; /// The full (logical) name of the service being called, including its package name, if applicable. /// @@ -1499,7 +1486,7 @@ pub const RPC_SYSTEM: Key = Key::from_static_str("rpc.system"); /// # Examples /// /// - `myservice.EchoService` -pub const RPC_SERVICE: Key = Key::from_static_str("rpc.service"); +pub const RPC_SERVICE: &str = "rpc.service"; /// The name of the (logical) method being called, must be equal to the $method part in the span name. /// @@ -1508,10 +1495,10 @@ pub const RPC_SERVICE: Key = Key::from_static_str("rpc.service"); /// # Examples /// /// - `exampleMethod` -pub const RPC_METHOD: Key = Key::from_static_str("rpc.method"); +pub const RPC_METHOD: &str = "rpc.method"; /// The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. -pub const RPC_GRPC_STATUS_CODE: Key = Key::from_static_str("rpc.grpc.status_code"); +pub const RPC_GRPC_STATUS_CODE: &str = "rpc.grpc.status_code"; /// Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. /// @@ -1519,7 +1506,7 @@ pub const RPC_GRPC_STATUS_CODE: Key = Key::from_static_str("rpc.grpc.status_code /// /// - `2.0` /// - `1.0` -pub const RPC_JSONRPC_VERSION: Key = Key::from_static_str("rpc.jsonrpc.version"); +pub const RPC_JSONRPC_VERSION: &str = "rpc.jsonrpc.version"; /// `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. /// @@ -1528,7 +1515,7 @@ pub const RPC_JSONRPC_VERSION: Key = Key::from_static_str("rpc.jsonrpc.version") /// - `10` /// - `request-7` /// - `` -pub const RPC_JSONRPC_REQUEST_ID: Key = Key::from_static_str("rpc.jsonrpc.request_id"); +pub const RPC_JSONRPC_REQUEST_ID: &str = "rpc.jsonrpc.request_id"; /// `error.code` property of response if it is an error response. /// @@ -1536,7 +1523,7 @@ pub const RPC_JSONRPC_REQUEST_ID: Key = Key::from_static_str("rpc.jsonrpc.reques /// /// - `-32700` /// - `100` -pub const RPC_JSONRPC_ERROR_CODE: Key = Key::from_static_str("rpc.jsonrpc.error_code"); +pub const RPC_JSONRPC_ERROR_CODE: &str = "rpc.jsonrpc.error_code"; /// `error.message` property of response if it is an error response. /// @@ -1544,24 +1531,24 @@ pub const RPC_JSONRPC_ERROR_CODE: Key = Key::from_static_str("rpc.jsonrpc.error_ /// /// - `Parse error` /// - `User already exists` -pub const RPC_JSONRPC_ERROR_MESSAGE: Key = Key::from_static_str("rpc.jsonrpc.error_message"); +pub const RPC_JSONRPC_ERROR_MESSAGE: &str = "rpc.jsonrpc.error_message"; /// Whether this is a received or sent message. -pub const MESSAGE_TYPE: Key = Key::from_static_str("message.type"); +pub const MESSAGE_TYPE: &str = "message.type"; /// MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. /// /// This way we guarantee that the values will be consistent between different implementations. -pub const MESSAGE_ID: Key = Key::from_static_str("message.id"); +pub const MESSAGE_ID: &str = "message.id"; /// Compressed size of the message in bytes. -pub const MESSAGE_COMPRESSED_SIZE: Key = Key::from_static_str("message.compressed_size"); +pub const MESSAGE_COMPRESSED_SIZE: &str = "message.compressed_size"; /// Uncompressed size of the message in bytes. -pub const MESSAGE_UNCOMPRESSED_SIZE: Key = Key::from_static_str("message.uncompressed_size"); +pub const MESSAGE_UNCOMPRESSED_SIZE: &str = "message.uncompressed_size"; /// The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. -pub const RPC_CONNECT_RPC_ERROR_CODE: Key = Key::from_static_str("rpc.connect_rpc.error_code"); +pub const RPC_CONNECT_RPC_ERROR_CODE: &str = "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. /// @@ -1581,7 +1568,7 @@ pub const RPC_CONNECT_RPC_ERROR_CODE: Key = Key::from_static_str("rpc.connect_rp /// 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. -pub const EXCEPTION_ESCAPED: Key = Key::from_static_str("exception.escaped"); +pub const EXCEPTION_ESCAPED: &str = "exception.escaped"; /// The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. /// @@ -1590,7 +1577,7 @@ pub const EXCEPTION_ESCAPED: Key = Key::from_static_str("exception.escaped"); /// - `https` /// - `ftp` /// - `telnet` -pub const URL_SCHEME: Key = Key::from_static_str("url.scheme"); +pub const URL_SCHEME: &str = "url.scheme"; /// Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). /// @@ -1602,7 +1589,7 @@ pub const URL_SCHEME: Key = Key::from_static_str("url.scheme"); /// /// - `https://www.foo.bar/search?q=OpenTelemetry#SemConv` /// - `//localhost` -pub const URL_FULL: Key = Key::from_static_str("url.full"); +pub const URL_FULL: &str = "url.full"; /// The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. /// @@ -1611,7 +1598,7 @@ pub const URL_FULL: Key = Key::from_static_str("url.full"); /// # Examples /// /// - `/search` -pub const URL_PATH: Key = Key::from_static_str("url.path"); +pub const URL_PATH: &str = "url.path"; /// The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. /// @@ -1620,18 +1607,18 @@ pub const URL_PATH: Key = Key::from_static_str("url.path"); /// # Examples /// /// - `q=OpenTelemetry` -pub const URL_QUERY: Key = Key::from_static_str("url.query"); +pub const URL_QUERY: &str = "url.query"; /// The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. /// /// # Examples /// /// - `SemConv` -pub const URL_FRAGMENT: Key = Key::from_static_str("url.fragment"); +pub const URL_FRAGMENT: &str = "url.fragment"; /// Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. /// /// # Examples /// /// - `CERN-LineMode/2.15 libwww/2.17b3` -pub const USER_AGENT_ORIGINAL: Key = Key::from_static_str("user_agent.original"); +pub const USER_AGENT_ORIGINAL: &str = "user_agent.original"; diff --git a/opentelemetry-stackdriver/src/lib.rs b/opentelemetry-stackdriver/src/lib.rs index af75a78cb9..26fa1ded66 100644 --- a/opentelemetry-stackdriver/src/lib.rs +++ b/opentelemetry-stackdriver/src/lib.rs @@ -38,10 +38,7 @@ use opentelemetry_sdk::{ trace::EvictedQueue, Resource, }; -use opentelemetry_semantic_conventions::resource::SERVICE_NAME; -use opentelemetry_semantic_conventions::trace::{ - HTTP_METHOD, HTTP_ROUTE, HTTP_STATUS_CODE, HTTP_TARGET, HTTP_URL, -}; +use opentelemetry_semantic_conventions as semconv; use thiserror::Error; #[cfg(any(feature = "yup-authorizer", feature = "gcp_auth"))] use tonic::metadata::MetadataValue; @@ -55,8 +52,11 @@ use yup_oauth2::authenticator::Authenticator; #[allow(clippy::derive_partial_eq_without_eq)] // tonic doesn't derive Eq for generated types pub mod proto; -const HTTP_HOST: Key = Key::from_static_str("http.host"); -const HTTP_USER_AGENT: Key = Key::from_static_str("http.user_agent"); +const HTTP_HOST: &str = "http.host"; +const HTTP_PATH: &str = "http.path"; +const HTTP_USER_AGENT: &str = "http.user_agent"; + +const GCP_HTTP_PATH: &str = "/http/path"; use proto::devtools::cloudtrace::v2::span::time_event::Annotation; use proto::devtools::cloudtrace::v2::span::{ @@ -739,14 +739,14 @@ impl From<(Vec, &Resource)> for Attributes { return None; } - if k == SERVICE_NAME { + if k.as_str() == semconv::resource::SERVICE_NAME { return Some((GCP_SERVICE_NAME.to_owned(), v.into())); - } else if key == HTTP_PATH_ATTRIBUTE { + } else if key == HTTP_PATH { return Some((GCP_HTTP_PATH.to_owned(), v.into())); } for (otel_key, gcp_key) in KEY_MAP { - if otel_key == &k { + if otel_key == k.as_str() { return Some((gcp_key.to_owned(), v.into())); } } @@ -784,14 +784,15 @@ fn transform_links(links: &EvictedQueue) -> Option for SpanKind { @@ -823,8 +824,6 @@ fn status(value: opentelemetry::trace::Status) -> Option { } const TRACE_APPEND: &str = "https://www.googleapis.com/auth/trace.append"; const LOGGING_WRITE: &str = "https://www.googleapis.com/auth/logging.write"; -const HTTP_PATH_ATTRIBUTE: &str = "http.path"; -const GCP_HTTP_PATH: &str = "/http/path"; const GCP_SERVICE_NAME: &str = "g.co/gae/app/module"; const MAX_ATTRIBUTES_PER_SPAN: usize = 32; @@ -840,33 +839,40 @@ mod tests { let mut attributes = Vec::with_capacity(capacity); // hostAttribute = "http.host" - attributes.push(HTTP_HOST.string("example.com:8080")); + attributes.push(KeyValue::new(HTTP_HOST, "example.com:8080")); // methodAttribute = "http.method" - attributes.push(semcov::trace::HTTP_METHOD.string("POST")); + attributes.push(KeyValue::new(semcov::trace::HTTP_METHOD, "POST")); // pathAttribute = "http.path" - attributes.push(KeyValue::new( - "http.path", - Value::String("/path/12314/?q=ddds#123".into()), - )); + attributes.push(KeyValue::new(HTTP_PATH, "/path/12314/?q=ddds#123")); // urlAttribute = "http.url" - attributes.push( - semcov::trace::HTTP_URL.string("https://example.com:8080/webshop/articles/4?s=1"), - ); + attributes.push(KeyValue::new( + semcov::trace::HTTP_URL, + "https://example.com:8080/webshop/articles/4?s=1", + )); // userAgentAttribute = "http.user_agent" - attributes.push(HTTP_USER_AGENT.string("CERN-LineMode/2.15 libwww/2.17b3")); + attributes.push(KeyValue::new( + HTTP_USER_AGENT, + "CERN-LineMode/2.15 libwww/2.17b3", + )); // statusCodeAttribute = "http.status_code" - attributes.push(semcov::trace::HTTP_STATUS_CODE.i64(200)); + attributes.push(KeyValue::new(semcov::trace::HTTP_STATUS_CODE, 200i64)); // statusCodeAttribute = "http.route" - attributes.push(semcov::trace::HTTP_ROUTE.string("/webshop/articles/:article_id")); + attributes.push(KeyValue::new( + semcov::trace::HTTP_ROUTE, + "/webshop/articles/:article_id", + )); // serviceAttribute = "service.name" - let resources = Resource::new([semcov::resource::SERVICE_NAME.string("Test Service Name")]); + let resources = Resource::new([KeyValue::new( + semcov::resource::SERVICE_NAME, + "Test Service Name", + )]); let actual: Attributes = (attributes, &resources).into(); @@ -920,7 +926,10 @@ mod tests { #[test] fn test_too_many() { - let resources = Resource::new([semcov::resource::SERVICE_NAME.string("Test Service Name")]); + let resources = Resource::new([KeyValue::new( + semcov::resource::SERVICE_NAME, + "Test Service Name", + )]); let mut attributes = Vec::with_capacity(32); for i in 0..32 { attributes.push(KeyValue::new( @@ -943,7 +952,10 @@ mod tests { #[test] fn test_attributes_mapping_http_target() { - let attributes = vec![semcov::trace::HTTP_TARGET.string("/path/12314/?q=ddds#123")]; + let attributes = vec![KeyValue::new( + semcov::trace::HTTP_TARGET, + "/path/12314/?q=ddds#123", + )]; // hostAttribute = "http.target" diff --git a/opentelemetry-zipkin/src/exporter/mod.rs b/opentelemetry-zipkin/src/exporter/mod.rs index bc124593a5..5f40bda53d 100644 --- a/opentelemetry-zipkin/src/exporter/mod.rs +++ b/opentelemetry-zipkin/src/exporter/mod.rs @@ -120,7 +120,7 @@ impl ZipkinPipelineBuilder { cfg.resource = Cow::Owned(Resource::new( cfg.resource .iter() - .filter(|(k, _v)| **k != semcov::resource::SERVICE_NAME) + .filter(|(k, _v)| k.as_str() != semcov::resource::SERVICE_NAME) .map(|(k, v)| KeyValue::new(k.clone(), v.clone())) .collect::>(), )); @@ -135,7 +135,7 @@ impl ZipkinPipelineBuilder { } else { let service_name = SdkProvidedResourceDetector .detect(Duration::from_secs(0)) - .get(semcov::resource::SERVICE_NAME) + .get(semcov::resource::SERVICE_NAME.into()) .unwrap() .to_string(); ( From ccf1abdde61559dff0d3053f08a57d87a20a62f4 Mon Sep 17 00:00:00 2001 From: Kristopher Wuollett Date: Tue, 7 Nov 2023 14:01:05 -0600 Subject: [PATCH 2/5] fix: add tracing as a dev-dependency for doc examples --- opentelemetry-semantic-conventions/Cargo.toml | 1 + .../scripts/templates/header_resource.rs | 2 +- .../scripts/templates/header_trace.rs | 2 +- opentelemetry-semantic-conventions/src/resource.rs | 2 +- opentelemetry-semantic-conventions/src/trace.rs | 8 ++++---- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/opentelemetry-semantic-conventions/Cargo.toml b/opentelemetry-semantic-conventions/Cargo.toml index c235799548..74c2e51526 100644 --- a/opentelemetry-semantic-conventions/Cargo.toml +++ b/opentelemetry-semantic-conventions/Cargo.toml @@ -24,3 +24,4 @@ opentelemetry = { version = "0.21", default-features = false, path = "../opentel [dev-dependencies] opentelemetry_sdk = { features = ["trace"], path = "../opentelemetry-sdk" } +tracing = { version = "0.1.40", default-features = false } diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs index c46bfdad9b..c44e4044a5 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs @@ -7,7 +7,7 @@ //! //! ## Usage //! -//! `tracing`: +//! [`tracing`]: //! //! ``` //! use opentelemetry_semantic_conventions as semconv; diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs index 74d103a9c9..4e059e0dd6 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs @@ -7,7 +7,7 @@ //! //! ## Usage //! -//! `tracing`: +//! [`tracing`]: //! //! ``` //! use opentelemetry_semantic_conventions as semconv; diff --git a/opentelemetry-semantic-conventions/src/resource.rs b/opentelemetry-semantic-conventions/src/resource.rs index cf2e1bf586..a3cf2b4f6c 100644 --- a/opentelemetry-semantic-conventions/src/resource.rs +++ b/opentelemetry-semantic-conventions/src/resource.rs @@ -13,7 +13,7 @@ //! //! ## Usage //! -//! `tracing`: +//! [`tracing`]: //! //! ``` //! use opentelemetry_semantic_conventions as semconv; diff --git a/opentelemetry-semantic-conventions/src/trace.rs b/opentelemetry-semantic-conventions/src/trace.rs index c363e2a4af..76d0f71e95 100644 --- a/opentelemetry-semantic-conventions/src/trace.rs +++ b/opentelemetry-semantic-conventions/src/trace.rs @@ -13,7 +13,7 @@ //! //! ## Usage //! -//! `tracing`: +//! [`tracing`]: //! //! ``` //! use opentelemetry_semantic_conventions as semconv; @@ -32,14 +32,14 @@ //! ``` //! use opentelemetry::KeyValue; //! use opentelemetry::{global, trace::Tracer as _}; -//! use opentelemetry_semantic_conventions as semcov; +//! use opentelemetry_semantic_conventions as semconv; //! //! let tracer = global::tracer("my-component"); //! let _span = tracer //! .span_builder("span-name") //! .with_attributes(vec![ -//! KeyValue::new(semcov::trace::NET_PEER_NAME, "example.org"), -//! KeyValue::new(semcov::trace::NET_PEER_PORT, 80i64), +//! KeyValue::new(semconv::trace::NET_PEER_NAME, "example.org"), +//! KeyValue::new(semconv::trace::NET_PEER_PORT, 80i64), //! ]) //! .start(&tracer); //! ``` From 3e3f437cac5376bdbf9490b1660b75e63a7051d0 Mon Sep 17 00:00:00 2001 From: Kristopher Wuollett Date: Tue, 7 Nov 2023 14:01:53 -0600 Subject: [PATCH 3/5] fix: remove unused code --- .../src/semconv/mod.rs | 2 - .../src/semconv/resource.rs | 882 --------- .../src/semconv/trace.rs | 1599 ----------------- 3 files changed, 2483 deletions(-) delete mode 100644 opentelemetry-semantic-conventions/src/semconv/mod.rs delete mode 100644 opentelemetry-semantic-conventions/src/semconv/resource.rs delete mode 100644 opentelemetry-semantic-conventions/src/semconv/trace.rs diff --git a/opentelemetry-semantic-conventions/src/semconv/mod.rs b/opentelemetry-semantic-conventions/src/semconv/mod.rs deleted file mode 100644 index 15a9774c50..0000000000 --- a/opentelemetry-semantic-conventions/src/semconv/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod resource; -pub mod trace; diff --git a/opentelemetry-semantic-conventions/src/semconv/resource.rs b/opentelemetry-semantic-conventions/src/semconv/resource.rs deleted file mode 100644 index c405682c26..0000000000 --- a/opentelemetry-semantic-conventions/src/semconv/resource.rs +++ /dev/null @@ -1,882 +0,0 @@ -// DO NOT EDIT, this is an auto-generated file -// -// If you want to update the file: -// - Edit the template at scripts/templates/semconv_semantic_attributes.rs.j2 -// - Run the script at scripts/generate-consts-from-spec.sh - -//! # Resource Semantic Conventions -//! -//! The [resource semantic conventions] define a set of standardized attributes -//! to be used in `Resource`s. -//! -//! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource -//! -//! ## Usage -//! -//! ``` -//! use opentelemetry_semantic_conventions::semconv; -//! use tracing::span; -//! -//! let span = span!( -//! LEVEL::INFO, -//! "handle_request", -//! { semconv::resource::SERVICE_NAME = "my-service" }, -//! { semconv::resource::SERVICE_NAMESPACE = "my-namespace" } -//! ); -//! ``` - -/// Array of brand name and version separated by a space. -/// -/// This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). -/// -/// # Examples -/// -/// - ` Not A;Brand 99` -/// - `Chromium 99` -/// - `Chrome 99` -pub const BROWSER_BRANDS: &str = "browser.brands"; - -/// The platform on which the browser is running. -/// -/// 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. -/// -/// # Examples -/// -/// - `Windows` -/// - `macOS` -/// - `Android` -pub const BROWSER_PLATFORM: &str = "browser.platform"; - -/// A boolean that is true if the browser is running on a mobile device. -/// -/// 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. -pub const BROWSER_MOBILE: &str = "browser.mobile"; - -/// Preferred language of the user using the browser. -/// -/// This value is intended to be taken from the Navigator API `navigator.language`. -/// -/// # Examples -/// -/// - `en` -/// - `en-US` -/// - `fr` -/// - `fr-FR` -pub const BROWSER_LANGUAGE: &str = "browser.language"; - -/// Name of the cloud provider. -pub const CLOUD_PROVIDER: &str = "cloud.provider"; - -/// The cloud account ID the resource is assigned to. -/// -/// # Examples -/// -/// - `111111111111` -/// - `opentelemetry` -pub const CLOUD_ACCOUNT_ID: &str = "cloud.account.id"; - -/// The geographical region the resource is running. -/// -/// 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). -/// -/// # Examples -/// -/// - `us-central1` -/// - `us-east-1` -pub const CLOUD_REGION: &str = "cloud.region"; - -/// 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). -/// -/// 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/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`. -/// This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share -/// a TracerProvider. -/// -/// # Examples -/// -/// - `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function` -/// - `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID` -/// - `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/` -pub const CLOUD_RESOURCE_ID: &str = "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. -/// -/// Availability zones are called "zones" on Alibaba Cloud and Google Cloud. -/// -/// # Examples -/// -/// - `us-east-1c` -pub const CLOUD_AVAILABILITY_ZONE: &str = "cloud.availability_zone"; - -/// The cloud platform in use. -/// -/// The prefix of the service SHOULD match the one specified in `cloud.provider`. -pub const CLOUD_PLATFORM: &str = "cloud.platform"; - -/// The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). -/// -/// # Examples -/// -/// - `arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9` -pub const AWS_ECS_CONTAINER_ARN: &str = "aws.ecs.container.arn"; - -/// The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). -/// -/// # Examples -/// -/// - `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` -pub const AWS_ECS_CLUSTER_ARN: &str = "aws.ecs.cluster.arn"; - -/// The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. -pub const AWS_ECS_LAUNCHTYPE: &str = "aws.ecs.launchtype"; - -/// The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). -/// -/// # Examples -/// -/// - `arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b` -pub const AWS_ECS_TASK_ARN: &str = "aws.ecs.task.arn"; - -/// The task definition family this task definition is a member of. -/// -/// # Examples -/// -/// - `opentelemetry-family` -pub const AWS_ECS_TASK_FAMILY: &str = "aws.ecs.task.family"; - -/// The revision for this task definition. -/// -/// # Examples -/// -/// - `8` -/// - `26` -pub const AWS_ECS_TASK_REVISION: &str = "aws.ecs.task.revision"; - -/// The ARN of an EKS cluster. -/// -/// # Examples -/// -/// - `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` -pub const AWS_EKS_CLUSTER_ARN: &str = "aws.eks.cluster.arn"; - -/// The name(s) of the AWS log group(s) an application is writing to. -/// -/// Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. -/// -/// # Examples -/// -/// - `/aws/lambda/my-function` -/// - `opentelemetry-service` -pub const AWS_LOG_GROUP_NAMES: &str = "aws.log.group.names"; - -/// The Amazon Resource Name(s) (ARN) of the AWS log group(s). -/// -/// See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). -/// -/// # Examples -/// -/// - `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*` -pub const AWS_LOG_GROUP_ARNS: &str = "aws.log.group.arns"; - -/// The name(s) of the AWS log stream(s) an application is writing to. -/// -/// # Examples -/// -/// - `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` -pub const AWS_LOG_STREAM_NAMES: &str = "aws.log.stream.names"; - -/// The ARN(s) of the AWS log stream(s). -/// -/// 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. -/// -/// # Examples -/// -/// - `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` -pub const AWS_LOG_STREAM_ARNS: &str = "aws.log.stream.arns"; - -/// The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. -/// -/// # Examples -/// -/// - `job-name-xxxx` -/// - `sample-job-mdw84` -pub const GCP_CLOUD_RUN_JOB_EXECUTION: &str = "gcp.cloud_run.job.execution"; - -/// The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. -/// -/// # Examples -/// -/// - `0` -/// - `1` -pub const GCP_CLOUD_RUN_JOB_TASK_INDEX: &str = "gcp.cloud_run.job.task_index"; - -/// The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). -/// -/// # Examples -/// -/// - `instance-1` -/// - `my-vm-name` -pub const GCP_GCE_INSTANCE_NAME: &str = "gcp.gce.instance.name"; - -/// The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). -/// -/// # Examples -/// -/// - `my-host1234.example.com` -/// - `sample-vm.us-west1-b.c.my-project.internal` -pub const GCP_GCE_INSTANCE_HOSTNAME: &str = "gcp.gce.instance.hostname"; - -/// Time and date the release was created. -/// -/// # Examples -/// -/// - `2022-10-23T18:00:42Z` -pub const HEROKU_RELEASE_CREATION_TIMESTAMP: &str = "heroku.release.creation_timestamp"; - -/// Commit hash for the current release. -/// -/// # Examples -/// -/// - `e6134959463efd8966b20e75b913cafe3f5ec` -pub const HEROKU_RELEASE_COMMIT: &str = "heroku.release.commit"; - -/// Unique identifier for the application. -/// -/// # Examples -/// -/// - `2daa2797-e42b-4624-9322-ec3f968df4da` -pub const HEROKU_APP_ID: &str = "heroku.app.id"; - -/// Container name used by container runtime. -/// -/// # Examples -/// -/// - `opentelemetry-autoconf` -pub const CONTAINER_NAME: &str = "container.name"; - -/// Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. -/// -/// # Examples -/// -/// - `a3bf90e006b2` -pub const CONTAINER_ID: &str = "container.id"; - -/// The container runtime managing this container. -/// -/// # Examples -/// -/// - `docker` -/// - `containerd` -/// - `rkt` -pub const CONTAINER_RUNTIME: &str = "container.runtime"; - -/// Name of the image the container was built on. -/// -/// # Examples -/// -/// - `gcr.io/opentelemetry/operator` -pub const CONTAINER_IMAGE_NAME: &str = "container.image.name"; - -/// Container image tag. -/// -/// # Examples -/// -/// - `0.1` -pub const CONTAINER_IMAGE_TAG: &str = "container.image.tag"; - -/// Runtime specific image identifier. Usually a hash algorithm followed by a UUID. -/// -/// Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. -/// K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. -/// OCI defines a digest of manifest. -/// -/// # Examples -/// -/// - `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` -pub const CONTAINER_IMAGE_ID: &str = "container.image.id"; - -/// The command used to run the container (i.e. the command name). -/// -/// If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. -/// -/// # Examples -/// -/// - `otelcontribcol` -pub const CONTAINER_COMMAND: &str = "container.command"; - -/// The full command run by the container as a single string representing the full command. [2]. -/// -/// # Examples -/// -/// - `otelcontribcol --config config.yaml` -pub const CONTAINER_COMMAND_LINE: &str = "container.command_line"; - -/// All the command arguments (including the command/executable itself) run by the container. [2]. -/// -/// # Examples -/// -/// - `otelcontribcol, --config, config.yaml` -pub const CONTAINER_COMMAND_ARGS: &str = "container.command_args"; - -/// Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). -/// -/// # Examples -/// -/// - `staging` -/// - `production` -pub const DEPLOYMENT_ENVIRONMENT: &str = "deployment.environment"; - -/// A unique identifier representing the device. -/// -/// The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. -/// -/// # Examples -/// -/// - `2ab2916d-a51f-4ac8-80ee-45ac31a28092` -pub const DEVICE_ID: &str = "device.id"; - -/// The model identifier for the device. -/// -/// It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. -/// -/// # Examples -/// -/// - `iPhone3,4` -/// - `SM-G920F` -pub const DEVICE_MODEL_IDENTIFIER: &str = "device.model.identifier"; - -/// The marketing name for the device model. -/// -/// It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. -/// -/// # Examples -/// -/// - `iPhone 6s Plus` -/// - `Samsung Galaxy S6` -pub const DEVICE_MODEL_NAME: &str = "device.model.name"; - -/// The name of the device manufacturer. -/// -/// The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. -/// -/// # Examples -/// -/// - `Apple` -/// - `Samsung` -pub const DEVICE_MANUFACTURER: &str = "device.manufacturer"; - -/// The name of the single function that this runtime instance executes. -/// -/// 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`](/docs/general/general-attributes.md#source-code-attributes) -/// span attributes). -/// -/// 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: -/// -/// * **Azure:** The full name `<FUNCAPP>/<FUNC>`, 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). -/// -/// # Examples -/// -/// - `my-function` -/// - `myazurefunctionapp/some-function-name` -pub const FAAS_NAME: &str = "faas.name"; - -/// The immutable version of the function being executed. -/// -/// Depending on the cloud provider and platform, use: -/// -/// * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) -/// (an integer represented as a decimal string). -/// * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) -/// (i.e., the function name plus the revision suffix). -/// * **Google Cloud Functions:** The value of the -/// [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). -/// * **Azure Functions:** Not applicable. Do not set this attribute. -/// -/// # Examples -/// -/// - `26` -/// - `pinkfroid-00002` -pub const FAAS_VERSION: &str = "faas.version"; - -/// The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. -/// -/// * **AWS Lambda:** Use the (full) log stream name. -/// -/// # Examples -/// -/// - `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` -pub const FAAS_INSTANCE: &str = "faas.instance"; - -/// The amount of memory available to the serverless function converted to Bytes. -/// -/// 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). -/// -/// # Examples -/// -/// - `134217728` -pub const FAAS_MAX_MEMORY: &str = "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 `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. -/// -/// # Examples -/// -/// - `fdbf79e8af94cb7f9e8df36789187052` -pub const HOST_ID: &str = "host.id"; - -/// Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. -/// -/// # Examples -/// -/// - `opentelemetry-test` -pub const HOST_NAME: &str = "host.name"; - -/// Type of host. For Cloud, this must be the machine type. -/// -/// # Examples -/// -/// - `n1-standard-1` -pub const HOST_TYPE: &str = "host.type"; - -/// The CPU architecture the host system is running on. -pub const HOST_ARCH: &str = "host.arch"; - -/// Name of the VM image or OS install the host was instantiated from. -/// -/// # Examples -/// -/// - `infra-ami-eks-worker-node-7d4ec78312` -/// - `CentOS-8-x86_64-1905` -pub const HOST_IMAGE_NAME: &str = "host.image.name"; - -/// VM image ID or host OS image ID. For Cloud, this value is from the provider. -/// -/// # Examples -/// -/// - `ami-07b06b442921831e5` -pub const HOST_IMAGE_ID: &str = "host.image.id"; - -/// The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). -/// -/// # Examples -/// -/// - `0.1` -pub const HOST_IMAGE_VERSION: &str = "host.image.version"; - -/// The name of the cluster. -/// -/// # Examples -/// -/// - `opentelemetry-cluster` -pub const K8S_CLUSTER_NAME: &str = "k8s.cluster.name"; - -/// A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. -/// -/// K8s does not have support for obtaining a cluster ID. If this is ever -/// added, we will recommend collecting the `k8s.cluster.uid` through the -/// official APIs. In the meantime, we are able to use the `uid` of the -/// `kube-system` namespace as a proxy for cluster ID. Read on for the -/// rationale. -/// -/// Every object created in a K8s cluster is assigned a distinct UID. The -/// `kube-system` namespace is used by Kubernetes itself and will exist -/// for the lifetime of the cluster. Using the `uid` of the `kube-system` -/// namespace is a reasonable proxy for the K8s ClusterID as it will only -/// change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are -/// UUIDs as standardized by -/// [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). -/// Which states: -/// -/// > If generated according to one of the mechanisms defined in Rec. -/// ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be -/// different from all other UUIDs generated before 3603 A.D., or is -/// extremely likely to be different (depending on the mechanism chosen). -/// -/// Therefore, UIDs between clusters should be extremely unlikely to -/// conflict. -/// -/// # Examples -/// -/// - `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` -pub const K8S_CLUSTER_UID: &str = "k8s.cluster.uid"; - -/// The name of the Node. -/// -/// # Examples -/// -/// - `node-1` -pub const K8S_NODE_NAME: &str = "k8s.node.name"; - -/// The UID of the Node. -/// -/// # Examples -/// -/// - `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` -pub const K8S_NODE_UID: &str = "k8s.node.uid"; - -/// The name of the namespace that the pod is running in. -/// -/// # Examples -/// -/// - `default` -pub const K8S_NAMESPACE_NAME: &str = "k8s.namespace.name"; - -/// The UID of the Pod. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_POD_UID: &str = "k8s.pod.uid"; - -/// The name of the Pod. -/// -/// # Examples -/// -/// - `opentelemetry-pod-autoconf` -pub const K8S_POD_NAME: &str = "k8s.pod.name"; - -/// The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). -/// -/// # Examples -/// -/// - `redis` -pub const K8S_CONTAINER_NAME: &str = "k8s.container.name"; - -/// Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. -/// -/// # Examples -/// -/// - `0` -/// - `2` -pub const K8S_CONTAINER_RESTART_COUNT: &str = "k8s.container.restart_count"; - -/// The UID of the ReplicaSet. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_REPLICASET_UID: &str = "k8s.replicaset.uid"; - -/// The name of the ReplicaSet. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const K8S_REPLICASET_NAME: &str = "k8s.replicaset.name"; - -/// The UID of the Deployment. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_DEPLOYMENT_UID: &str = "k8s.deployment.uid"; - -/// The name of the Deployment. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const K8S_DEPLOYMENT_NAME: &str = "k8s.deployment.name"; - -/// The UID of the StatefulSet. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_STATEFULSET_UID: &str = "k8s.statefulset.uid"; - -/// The name of the StatefulSet. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const K8S_STATEFULSET_NAME: &str = "k8s.statefulset.name"; - -/// The UID of the DaemonSet. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_DAEMONSET_UID: &str = "k8s.daemonset.uid"; - -/// The name of the DaemonSet. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const K8S_DAEMONSET_NAME: &str = "k8s.daemonset.name"; - -/// The UID of the Job. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_JOB_UID: &str = "k8s.job.uid"; - -/// The name of the Job. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const K8S_JOB_NAME: &str = "k8s.job.name"; - -/// The UID of the CronJob. -/// -/// # Examples -/// -/// - `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` -pub const K8S_CRONJOB_UID: &str = "k8s.cronjob.uid"; - -/// The name of the CronJob. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const K8S_CRONJOB_NAME: &str = "k8s.cronjob.name"; - -/// The operating system type. -pub const OS_TYPE: &str = "os.type"; - -/// Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. -/// -/// # Examples -/// -/// - `Microsoft Windows [Version 10.0.18363.778]` -/// - `Ubuntu 18.04.1 LTS` -pub const OS_DESCRIPTION: &str = "os.description"; - -/// Human readable operating system name. -/// -/// # Examples -/// -/// - `iOS` -/// - `Android` -/// - `Ubuntu` -pub const OS_NAME: &str = "os.name"; - -/// The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). -/// -/// # Examples -/// -/// - `14.2.1` -/// - `18.04.1` -pub const OS_VERSION: &str = "os.version"; - -/// Process identifier (PID). -/// -/// # Examples -/// -/// - `1234` -pub const PROCESS_PID: &str = "process.pid"; - -/// Parent Process identifier (PID). -/// -/// # Examples -/// -/// - `111` -pub const PROCESS_PARENT_PID: &str = "process.parent_pid"; - -/// 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`. -/// -/// # Examples -/// -/// - `otelcol` -pub const PROCESS_EXECUTABLE_NAME: &str = "process.executable.name"; - -/// The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. -/// -/// # Examples -/// -/// - `/usr/bin/cmd/otelcol` -pub const PROCESS_EXECUTABLE_PATH: &str = "process.executable.path"; - -/// The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. -/// -/// # Examples -/// -/// - `cmd/otelcol` -pub const PROCESS_COMMAND: &str = "process.command"; - -/// The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. -/// -/// # Examples -/// -/// - `C:\cmd\otecol --config="my directory\config.yaml"` -pub const PROCESS_COMMAND_LINE: &str = "process.command_line"; - -/// All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. -/// -/// # Examples -/// -/// - `cmd/otecol` -/// - `--config=config.yaml` -pub const PROCESS_COMMAND_ARGS: &str = "process.command_args"; - -/// The username of the user that owns the process. -/// -/// # Examples -/// -/// - `root` -pub const PROCESS_OWNER: &str = "process.owner"; - -/// The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. -/// -/// # Examples -/// -/// - `OpenJDK Runtime Environment` -pub const PROCESS_RUNTIME_NAME: &str = "process.runtime.name"; - -/// The version of the runtime of this process, as returned by the runtime without modification. -/// -/// # Examples -/// -/// - `14.0.2` -pub const PROCESS_RUNTIME_VERSION: &str = "process.runtime.version"; - -/// An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. -/// -/// # Examples -/// -/// - `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` -pub const PROCESS_RUNTIME_DESCRIPTION: &str = "process.runtime.description"; - -/// Logical name of the service. -/// -/// MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. -/// -/// # Examples -/// -/// - `shoppingcart` -pub const SERVICE_NAME: &str = "service.name"; - -/// The version string of the service API or implementation. The format is not defined by these conventions. -/// -/// # Examples -/// -/// - `2.0.0` -/// - `a01dbef8a` -pub const SERVICE_VERSION: &str = "service.version"; - -/// A namespace for `service.name`. -/// -/// A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. -/// -/// # Examples -/// -/// - `Shop` -pub const SERVICE_NAMESPACE: &str = "service.namespace"; - -/// The string ID of the service instance. -/// -/// MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). -/// -/// # Examples -/// -/// - `my-k8s-pod-deployment-1` -/// - `627cc493-f310-47de-96bd-71410b7dec09` -pub const SERVICE_INSTANCE_ID: &str = "service.instance.id"; - -/// The name of the telemetry SDK as defined above. -/// -/// The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. -/// If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the -/// `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point -/// or another suitable identifier depending on the language. -/// The identifier `opentelemetry` is reserved and MUST NOT be used in this case. -/// All custom identifiers SHOULD be stable across different versions of an implementation. -/// -/// # Examples -/// -/// - `opentelemetry` -pub const TELEMETRY_SDK_NAME: &str = "telemetry.sdk.name"; - -/// The language of the telemetry SDK. -pub const TELEMETRY_SDK_LANGUAGE: &str = "telemetry.sdk.language"; - -/// The version string of the telemetry SDK. -/// -/// # Examples -/// -/// - `1.2.3` -pub const TELEMETRY_SDK_VERSION: &str = "telemetry.sdk.version"; - -/// The version string of the auto instrumentation agent, if used. -/// -/// # Examples -/// -/// - `1.2.3` -pub const TELEMETRY_AUTO_VERSION: &str = "telemetry.auto.version"; - -/// The name of the web engine. -/// -/// # Examples -/// -/// - `WildFly` -pub const WEBENGINE_NAME: &str = "webengine.name"; - -/// The version of the web engine. -/// -/// # Examples -/// -/// - `21.0.0` -pub const WEBENGINE_VERSION: &str = "webengine.version"; - -/// Additional description of the web engine (e.g. detailed version and edition information). -/// -/// # Examples -/// -/// - `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` -pub const WEBENGINE_DESCRIPTION: &str = "webengine.description"; - -/// The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). -/// -/// # Examples -/// -/// - `io.opentelemetry.contrib.mongodb` -pub const OTEL_SCOPE_NAME: &str = "otel.scope.name"; - -/// The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). -/// -/// # Examples -/// -/// - `1.0.0` -pub const OTEL_SCOPE_VERSION: &str = "otel.scope.version"; - -/// Deprecated, use the `otel.scope.name` attribute. -/// -/// # Examples -/// -/// - `io.opentelemetry.contrib.mongodb` -#[deprecated] -pub const OTEL_LIBRARY_NAME: &str = "otel.library.name"; - -/// Deprecated, use the `otel.scope.version` attribute. -/// -/// # Examples -/// -/// - `1.0.0` -#[deprecated] -pub const OTEL_LIBRARY_VERSION: &str = "otel.library.version"; \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/semconv/trace.rs b/opentelemetry-semantic-conventions/src/semconv/trace.rs deleted file mode 100644 index ae24542d7d..0000000000 --- a/opentelemetry-semantic-conventions/src/semconv/trace.rs +++ /dev/null @@ -1,1599 +0,0 @@ -// DO NOT EDIT, this is an auto-generated file -// -// If you want to update the file: -// - Edit the template at scripts/templates/semconv_semantic_attributes.rs.j2 -// - Run the script at scripts/generate-consts-from-spec.sh - -//! # Trace Semantic Conventions -//! -//! The [trace semantic conventions] define a set of standardized attributes to -//! be used in `Span`s. -//! -//! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace -//! -//! ## Usage -//! -//! ``` -//! use opentelemetry_semantic_conventions::semconv; -//! use tracing::span; -//! -//! let span = span!( -//! LEVEL::INFO, -//! "handle_request", -//! { semconv::trace::NET_PEER_NAME = "example.org" }, -//! { semconv::trace::NET_PEER_PORT = 80 } -//! ); -//! ``` - -/// Client address - unix domain socket name, IPv4 or IPv6 address. -/// -/// When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent client address behind any intermediaries (e.g. proxies) if it's available. -/// -/// # Examples -/// -/// - `/tmp/my.sock` -/// - `10.1.2.80` -pub const CLIENT_ADDRESS: &str = "client.address"; - -/// Client port number. -/// -/// When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent client port behind any intermediaries (e.g. proxies) if it's available. -/// -/// # Examples -/// -/// - `65123` -pub const CLIENT_PORT: &str = "client.port"; - -/// Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. -/// -/// # Examples -/// -/// - `/tmp/my.sock` -/// - `127.0.0.1` -pub const CLIENT_SOCKET_ADDRESS: &str = "client.socket.address"; - -/// Immediate client peer port number. -/// -/// # Examples -/// -/// - `35555` -pub const CLIENT_SOCKET_PORT: &str = "client.socket.port"; - -/// Deprecated, use `http.request.method` instead. -/// -/// # Examples -/// -/// - `GET` -/// - `POST` -/// - `HEAD` -#[deprecated] -pub const HTTP_METHOD: &str = "http.method"; - -/// Deprecated, use `http.response.status_code` instead. -/// -/// # Examples -/// -/// - `200` -#[deprecated] -pub const HTTP_STATUS_CODE: &str = "http.status_code"; - -/// Deprecated, use `url.scheme` instead. -/// -/// # Examples -/// -/// - `http` -/// - `https` -#[deprecated] -pub const HTTP_SCHEME: &str = "http.scheme"; - -/// Deprecated, use `url.full` instead. -/// -/// # Examples -/// -/// - `https://www.foo.bar/search?q=OpenTelemetry#SemConv` -#[deprecated] -pub const HTTP_URL: &str = "http.url"; - -/// Deprecated, use `url.path` and `url.query` instead. -/// -/// # Examples -/// -/// - `/search?q=OpenTelemetry#SemConv` -#[deprecated] -pub const HTTP_TARGET: &str = "http.target"; - -/// Deprecated, use `http.request.body.size` instead. -/// -/// # Examples -/// -/// - `3495` -#[deprecated] -pub const HTTP_REQUEST_CONTENT_LENGTH: &str = "http.request_content_length"; - -/// Deprecated, use `http.response.body.size` instead. -/// -/// # Examples -/// -/// - `3495` -#[deprecated] -pub const HTTP_RESPONSE_CONTENT_LENGTH: &str = "http.response_content_length"; - -/// Deprecated, use `server.socket.domain` on client spans. -/// -/// # Examples -/// -/// - `/var/my.sock` -#[deprecated] -pub const NET_SOCK_PEER_NAME: &str = "net.sock.peer.name"; - -/// Deprecated, use `server.socket.address` on client spans and `client.socket.address` on server spans. -/// -/// # Examples -/// -/// - `192.168.0.1` -#[deprecated] -pub const NET_SOCK_PEER_ADDR: &str = "net.sock.peer.addr"; - -/// Deprecated, use `server.socket.port` on client spans and `client.socket.port` on server spans. -/// -/// # Examples -/// -/// - `65531` -#[deprecated] -pub const NET_SOCK_PEER_PORT: &str = "net.sock.peer.port"; - -/// Deprecated, use `server.address` on client spans and `client.address` on server spans. -/// -/// # Examples -/// -/// - `example.com` -#[deprecated] -pub const NET_PEER_NAME: &str = "net.peer.name"; - -/// Deprecated, use `server.port` on client spans and `client.port` on server spans. -/// -/// # Examples -/// -/// - `8080` -#[deprecated] -pub const NET_PEER_PORT: &str = "net.peer.port"; - -/// Deprecated, use `server.address`. -/// -/// # Examples -/// -/// - `example.com` -#[deprecated] -pub const NET_HOST_NAME: &str = "net.host.name"; - -/// Deprecated, use `server.port`. -/// -/// # Examples -/// -/// - `8080` -#[deprecated] -pub const NET_HOST_PORT: &str = "net.host.port"; - -/// Deprecated, use `server.socket.address`. -/// -/// # Examples -/// -/// - `/var/my.sock` -#[deprecated] -pub const NET_SOCK_HOST_ADDR: &str = "net.sock.host.addr"; - -/// Deprecated, use `server.socket.port`. -/// -/// # Examples -/// -/// - `8080` -#[deprecated] -pub const NET_SOCK_HOST_PORT: &str = "net.sock.host.port"; - -/// Deprecated, use `network.transport`. -#[deprecated] -pub const NET_TRANSPORT: &str = "net.transport"; - -/// Deprecated, use `network.protocol.name`. -/// -/// # Examples -/// -/// - `amqp` -/// - `http` -/// - `mqtt` -#[deprecated] -pub const NET_PROTOCOL_NAME: &str = "net.protocol.name"; - -/// Deprecated, use `network.protocol.version`. -/// -/// # Examples -/// -/// - `3.1.1` -#[deprecated] -pub const NET_PROTOCOL_VERSION: &str = "net.protocol.version"; - -/// Deprecated, use `network.transport` and `network.type`. -#[deprecated] -pub const NET_SOCK_FAMILY: &str = "net.sock.family"; - -/// The domain name of the destination system. -/// -/// This value may be a host name, a fully qualified domain name, or another host naming format. -/// -/// # Examples -/// -/// - `foo.example.com` -pub const DESTINATION_DOMAIN: &str = "destination.domain"; - -/// Peer address, for example IP address or UNIX socket name. -/// -/// # Examples -/// -/// - `10.5.3.2` -pub const DESTINATION_ADDRESS: &str = "destination.address"; - -/// Peer port number. -/// -/// # Examples -/// -/// - `3389` -/// - `2888` -pub const DESTINATION_PORT: &str = "destination.port"; - -/// 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. -/// -/// # Examples -/// -/// - `java.net.ConnectException` -/// - `OSError` -pub const EXCEPTION_TYPE: &str = "exception.type"; - -/// The exception message. -/// -/// # Examples -/// -/// - `Division by zero` -/// - `Can't convert 'int' object to str implicitly` -pub const EXCEPTION_MESSAGE: &str = "exception.message"; - -/// A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. -/// -/// # Examples -/// -/// - `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` -pub const EXCEPTION_STACKTRACE: &str = "exception.stacktrace"; - -/// HTTP request method. -/// -/// HTTP request method value SHOULD be "known" to the instrumentation. -/// By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) -/// and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). -/// -/// If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER` and, except if reporting a metric, MUST -/// set the exact method received in the request line as value of the `http.request.method_original` attribute. -/// -/// If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override -/// the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named -/// OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods -/// (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). -/// -/// HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. -/// Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. -/// Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. -/// -/// # Examples -/// -/// - `GET` -/// - `POST` -/// - `HEAD` -pub const HTTP_REQUEST_METHOD: &str = "http.request.method"; - -/// [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). -/// -/// # Examples -/// -/// - `200` -pub const HTTP_RESPONSE_STATUS_CODE: &str = "http.response.status_code"; - -/// The matched route (path template in the format used by the respective server framework). See note below. -/// -/// 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](/docs/http/http-spans.md#http-server-definitions) if there is one. -/// -/// # Examples -/// -/// - `/users/:userID?` -/// - `{controller}/{action}/{id?}` -pub const HTTP_ROUTE: &str = "http.route"; - -/// The name identifies the event. -/// -/// # Examples -/// -/// - `click` -/// - `exception` -pub const EVENT_NAME: &str = "event.name"; - -/// The domain identifies the business context for the events. -/// -/// Events across different domains may have same `event.name`, yet be -/// unrelated events. -pub const EVENT_DOMAIN: &str = "event.domain"; - -/// A unique identifier for the Log Record. -/// -/// If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. -/// The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. -/// -/// # Examples -/// -/// - `01ARZ3NDEKTSV4RRFFQ69G5FAV` -pub const LOG_RECORD_UID: &str = "log.record.uid"; - -/// The stream associated with the log. See below for a list of well-known values. -pub const LOG_IOSTREAM: &str = "log.iostream"; - -/// The basename of the file. -/// -/// # Examples -/// -/// - `audit.log` -pub const LOG_FILE_NAME: &str = "log.file.name"; - -/// The full path to the file. -/// -/// # Examples -/// -/// - `/var/log/mysql/audit.log` -pub const LOG_FILE_PATH: &str = "log.file.path"; - -/// The basename of the file, with symlinks resolved. -/// -/// # Examples -/// -/// - `uuid.log` -pub const LOG_FILE_NAME_RESOLVED: &str = "log.file.name_resolved"; - -/// The full path to the file, with symlinks resolved. -/// -/// # Examples -/// -/// - `/var/lib/docker/uuid.log` -pub const LOG_FILE_PATH_RESOLVED: &str = "log.file.path_resolved"; - -/// The type of memory. -/// -/// # Examples -/// -/// - `heap` -/// - `non_heap` -pub const TYPE: &str = "type"; - -/// Name of the memory pool. -/// -/// Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). -/// -/// # Examples -/// -/// - `G1 Old Gen` -/// - `G1 Eden space` -/// - `G1 Survivor Space` -pub const POOL: &str = "pool"; - -/// Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is not known. -/// -/// # Examples -/// -/// - `example.com` -pub const SERVER_ADDRESS: &str = "server.address"; - -/// Logical server port number. -/// -/// # Examples -/// -/// - `80` -/// - `8080` -/// - `443` -pub const SERVER_PORT: &str = "server.port"; - -/// The domain name of an immediate peer. -/// -/// Typically observed from the client side, and represents a proxy or other intermediary domain name. -/// -/// # Examples -/// -/// - `proxy.example.com` -pub const SERVER_SOCKET_DOMAIN: &str = "server.socket.domain"; - -/// Physical server IP address or Unix socket address. If set from the client, should simply use the socket's peer address, and not attempt to find any actual server IP (i.e., if set from client, this may represent some proxy server instead of the logical server). -/// -/// # Examples -/// -/// - `10.5.3.2` -pub const SERVER_SOCKET_ADDRESS: &str = "server.socket.address"; - -/// Physical server port. -/// -/// # Examples -/// -/// - `16456` -pub const SERVER_SOCKET_PORT: &str = "server.socket.port"; - -/// The domain name of the source system. -/// -/// This value may be a host name, a fully qualified domain name, or another host naming format. -/// -/// # Examples -/// -/// - `foo.example.com` -pub const SOURCE_DOMAIN: &str = "source.domain"; - -/// Source address, for example IP address or Unix socket name. -/// -/// # Examples -/// -/// - `10.5.3.2` -pub const SOURCE_ADDRESS: &str = "source.address"; - -/// Source port number. -/// -/// # Examples -/// -/// - `3389` -/// - `2888` -pub const SOURCE_PORT: &str = "source.port"; - -/// 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). -/// -/// This may be different from `cloud.resource_id` if an alias is involved. -/// -/// # Examples -/// -/// - `arn:aws:lambda:us-east-1:123456:function:myfunction:myalias` -pub const AWS_LAMBDA_INVOKED_ARN: &str = "aws.lambda.invoked_arn"; - -/// The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. -/// -/// # Examples -/// -/// - `123e4567-e89b-12d3-a456-426614174000` -/// - `0001` -pub const CLOUDEVENTS_EVENT_ID: &str = "cloudevents.event_id"; - -/// The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. -/// -/// # Examples -/// -/// - `https://github.com/cloudevents` -/// - `/cloudevents/spec/pull/123` -/// - `my-service` -pub const CLOUDEVENTS_EVENT_SOURCE: &str = "cloudevents.event_source"; - -/// The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. -/// -/// # Examples -/// -/// - `1.0` -pub const CLOUDEVENTS_EVENT_SPEC_VERSION: &str = "cloudevents.event_spec_version"; - -/// The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. -/// -/// # Examples -/// -/// - `com.github.pull_request.opened` -/// - `com.example.object.deleted.v2` -pub const CLOUDEVENTS_EVENT_TYPE: &str = "cloudevents.event_type"; - -/// The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). -/// -/// # Examples -/// -/// - `mynewfile.jpg` -pub const CLOUDEVENTS_EVENT_SUBJECT: &str = "cloudevents.event_subject"; - -/// Parent-child Reference type. -/// -/// The causal relationship between a child Span and a parent Span. -pub const OPENTRACING_REF_TYPE: &str = "opentracing.ref_type"; - -/// An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. -pub const DB_SYSTEM: &str = "db.system"; - -/// The connection string used to connect to the database. It is recommended to remove embedded credentials. -/// -/// # Examples -/// -/// - `Server=(localdb)\v11.0;Integrated Security=true;` -pub const DB_CONNECTION_STRING: &str = "db.connection_string"; - -/// Username for accessing the database. -/// -/// # Examples -/// -/// - `readonly_user` -/// - `reporting_user` -pub const DB_USER: &str = "db.user"; - -/// The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. -/// -/// # Examples -/// -/// - `org.postgresql.Driver` -/// - `com.microsoft.sqlserver.jdbc.SQLServerDriver` -pub const DB_JDBC_DRIVER_CLASSNAME: &str = "db.jdbc.driver_classname"; - -/// This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). -/// -/// In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). -/// -/// # Examples -/// -/// - `customers` -/// - `main` -pub const DB_NAME: &str = "db.name"; - -/// The database statement being executed. -/// -/// # Examples -/// -/// - `SELECT * FROM wuser_table` -/// - `SET mykey "WuValue"` -pub const DB_STATEMENT: &str = "db.statement"; - -/// The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. -/// -/// 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. -/// -/// # Examples -/// -/// - `findAndModify` -/// - `HMSET` -/// - `SELECT` -pub const DB_OPERATION: &str = "db.operation"; - -/// The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. -/// -/// If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). -/// -/// # Examples -/// -/// - `MSSQLSERVER` -pub const DB_MSSQL_INSTANCE_NAME: &str = "db.mssql.instance_name"; - -/// The fetch size used for paging, i.e. how many rows will be returned at once. -/// -/// # Examples -/// -/// - `5000` -pub const DB_CASSANDRA_PAGE_SIZE: &str = "db.cassandra.page_size"; - -/// The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). -pub const DB_CASSANDRA_CONSISTENCY_LEVEL: &str = "db.cassandra.consistency_level"; - -/// The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). -/// -/// This mirrors the db.sql.table attribute but references cassandra rather than sql. 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. -/// -/// # Examples -/// -/// - `mytable` -pub const DB_CASSANDRA_TABLE: &str = "db.cassandra.table"; - -/// Whether or not the query is idempotent. -pub const DB_CASSANDRA_IDEMPOTENCE: &str = "db.cassandra.idempotence"; - -/// The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. -/// -/// # Examples -/// -/// - `0` -/// - `2` -pub const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: &str = "db.cassandra.speculative_execution_count"; - -/// The ID of the coordinating node for a query. -/// -/// # Examples -/// -/// - `be13faa2-8574-4d71-926d-27f16cf8a7af` -pub const DB_CASSANDRA_COORDINATOR_ID: &str = "db.cassandra.coordinator.id"; - -/// The data center of the coordinating node for a query. -/// -/// # Examples -/// -/// - `us-west-2` -pub const DB_CASSANDRA_COORDINATOR_DC: &str = "db.cassandra.coordinator.dc"; - -/// The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. -/// -/// # Examples -/// -/// - `0` -/// - `1` -/// - `15` -pub const DB_REDIS_DATABASE_INDEX: &str = "db.redis.database_index"; - -/// The collection being accessed within the database stated in `db.name`. -/// -/// # Examples -/// -/// - `customers` -/// - `products` -pub const DB_MONGODB_COLLECTION: &str = "db.mongodb.collection"; - -/// The name of the primary table that the operation is acting upon, including the database name (if applicable). -/// -/// 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. -/// -/// # Examples -/// -/// - `public.users` -/// - `customers` -pub const DB_SQL_TABLE: &str = "db.sql.table"; - -/// Unique Cosmos client instance id. -/// -/// # Examples -/// -/// - `3ba4827d-4422-483f-b59f-85b74211c11d` -pub const DB_COSMOSDB_CLIENT_ID: &str = "db.cosmosdb.client_id"; - -/// CosmosDB Operation Type. -pub const DB_COSMOSDB_OPERATION_TYPE: &str = "db.cosmosdb.operation_type"; - -/// Cosmos client connection mode. -pub const DB_COSMOSDB_CONNECTION_MODE: &str = "db.cosmosdb.connection_mode"; - -/// Cosmos DB container name. -/// -/// # Examples -/// -/// - `anystring` -pub const DB_COSMOSDB_CONTAINER: &str = "db.cosmosdb.container"; - -/// Request payload size in bytes. -pub const DB_COSMOSDB_REQUEST_CONTENT_LENGTH: &str = "db.cosmosdb.request_content_length"; - -/// Cosmos DB status code. -/// -/// # Examples -/// -/// - `200` -/// - `201` -pub const DB_COSMOSDB_STATUS_CODE: &str = "db.cosmosdb.status_code"; - -/// Cosmos DB sub status code. -/// -/// # Examples -/// -/// - `1000` -/// - `1002` -pub const DB_COSMOSDB_SUB_STATUS_CODE: &str = "db.cosmosdb.sub_status_code"; - -/// RU consumed for that operation. -/// -/// # Examples -/// -/// - `46.18` -/// - `1.0` -pub const DB_COSMOSDB_REQUEST_CHARGE: &str = "db.cosmosdb.request_charge"; - -/// Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. -pub const OTEL_STATUS_CODE: &str = "otel.status_code"; - -/// Description of the Status if it has a value, otherwise not set. -/// -/// # Examples -/// -/// - `resource not found` -pub const OTEL_STATUS_DESCRIPTION: &str = "otel.status_description"; - -/// Type of the trigger which caused this function invocation. -/// -/// For the server/consumer span on the incoming side, -/// `faas.trigger` MUST be set. -/// -/// Clients invoking FaaS instances usually cannot set `faas.trigger`, -/// since they would typically need to look in the payload to determine -/// the event type. If clients set it, it should be the same as the -/// trigger that corresponding incoming would have (i.e., this has -/// nothing to do with the underlying transport used to make the API -/// call to invoke the lambda, which is often HTTP). -pub const FAAS_TRIGGER: &str = "faas.trigger"; - -/// The invocation ID of the current function invocation. -/// -/// # Examples -/// -/// - `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` -pub const FAAS_INVOCATION_ID: &str = "faas.invocation_id"; - -/// The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. -/// -/// # Examples -/// -/// - `myBucketName` -/// - `myDbName` -pub const FAAS_DOCUMENT_COLLECTION: &str = "faas.document.collection"; - -/// Describes the type of the operation that was performed on the data. -pub const FAAS_DOCUMENT_OPERATION: &str = "faas.document.operation"; - -/// A string containing the time when the data was accessed 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). -/// -/// # Examples -/// -/// - `2020-01-23T13:47:06Z` -pub const FAAS_DOCUMENT_TIME: &str = "faas.document.time"; - -/// 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. -/// -/// # Examples -/// -/// - `myFile.txt` -/// - `myTableName` -pub const FAAS_DOCUMENT_NAME: &str = "faas.document.name"; - -/// 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). -/// -/// # Examples -/// -/// - `2020-01-23T13:47:06Z` -pub const FAAS_TIME: &str = "faas.time"; - -/// A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). -/// -/// # Examples -/// -/// - `0/5 * * * ? *` -pub const FAAS_CRON: &str = "faas.cron"; - -/// A boolean that is true if the serverless function is executed for the first time (aka cold-start). -pub const FAAS_COLDSTART: &str = "faas.coldstart"; - -/// The name of the invoked function. -/// -/// SHOULD be equal to the `faas.name` resource attribute of the invoked function. -/// -/// # Examples -/// -/// - `my-function` -pub const FAAS_INVOKED_NAME: &str = "faas.invoked_name"; - -/// The cloud provider of the invoked function. -/// -/// SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. -pub const FAAS_INVOKED_PROVIDER: &str = "faas.invoked_provider"; - -/// The cloud region of the invoked function. -/// -/// SHOULD be equal to the `cloud.region` resource attribute of the invoked function. -/// -/// # Examples -/// -/// - `eu-central-1` -pub const FAAS_INVOKED_REGION: &str = "faas.invoked_region"; - -/// The unique identifier of the feature flag. -/// -/// # Examples -/// -/// - `logo-color` -pub const FEATURE_FLAG_KEY: &str = "feature_flag.key"; - -/// The name of the service provider that performs the flag evaluation. -/// -/// # Examples -/// -/// - `Flag Manager` -pub const FEATURE_FLAG_PROVIDER_NAME: &str = "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. -/// -/// 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. -/// -/// # Examples -/// -/// - `red` -/// - `true` -/// - `on` -pub const FEATURE_FLAG_VARIANT: &str = "feature_flag.variant"; - -/// [OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase. -/// -/// # Examples -/// -/// - `tcp` -/// - `udp` -pub const NETWORK_TRANSPORT: &str = "network.transport"; - -/// [OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. -/// -/// # Examples -/// -/// - `ipv4` -/// - `ipv6` -pub const NETWORK_TYPE: &str = "network.type"; - -/// [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. -/// -/// # Examples -/// -/// - `amqp` -/// - `http` -/// - `mqtt` -pub const NETWORK_PROTOCOL_NAME: &str = "network.protocol.name"; - -/// Version of the application layer protocol used. See note below. -/// -/// `network.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`. -/// -/// # Examples -/// -/// - `3.1.1` -pub const NETWORK_PROTOCOL_VERSION: &str = "network.protocol.version"; - -/// The internet connection type. -/// -/// # Examples -/// -/// - `wifi` -pub const NETWORK_CONNECTION_TYPE: &str = "network.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. -/// -/// # Examples -/// -/// - `LTE` -pub const NETWORK_CONNECTION_SUBTYPE: &str = "network.connection.subtype"; - -/// The name of the mobile carrier. -/// -/// # Examples -/// -/// - `sprint` -pub const NETWORK_CARRIER_NAME: &str = "network.carrier.name"; - -/// The mobile carrier country code. -/// -/// # Examples -/// -/// - `310` -pub const NETWORK_CARRIER_MCC: &str = "network.carrier.mcc"; - -/// The mobile carrier network code. -/// -/// # Examples -/// -/// - `001` -pub const NETWORK_CARRIER_MNC: &str = "network.carrier.mnc"; - -/// The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. -/// -/// # Examples -/// -/// - `DE` -pub const NETWORK_CARRIER_ICC: &str = "network.carrier.icc"; - -/// The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. -/// -/// # Examples -/// -/// - `AuthTokenCache` -pub const PEER_SERVICE: &str = "peer.service"; - -/// Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. -/// -/// # Examples -/// -/// - `username` -pub const ENDUSER_ID: &str = "enduser.id"; - -/// Actual/assumed role the client is making the request under extracted from token or application security context. -/// -/// # Examples -/// -/// - `admin` -pub const ENDUSER_ROLE: &str = "enduser.role"; - -/// Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). -/// -/// # Examples -/// -/// - `read:message, write:files` -pub const ENDUSER_SCOPE: &str = "enduser.scope"; - -/// Current "managed" thread ID (as opposed to OS thread ID). -/// -/// # Examples -/// -/// - `42` -pub const THREAD_ID: &str = "thread.id"; - -/// Current thread name. -/// -/// # Examples -/// -/// - `main` -pub const THREAD_NAME: &str = "thread.name"; - -/// The method or function name, or equivalent (usually rightmost part of the code unit's name). -/// -/// # Examples -/// -/// - `serveRequest` -pub const CODE_FUNCTION: &str = "code.function"; - -/// The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. -/// -/// # Examples -/// -/// - `com.example.MyHttpService` -pub const CODE_NAMESPACE: &str = "code.namespace"; - -/// The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). -/// -/// # Examples -/// -/// - `/usr/local/MyApplication/content_root/app/index.php` -pub const CODE_FILEPATH: &str = "code.filepath"; - -/// The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. -/// -/// # Examples -/// -/// - `42` -pub const CODE_LINENO: &str = "code.lineno"; - -/// The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. -/// -/// # Examples -/// -/// - `16` -pub const CODE_COLUMN: &str = "code.column"; - -/// Original HTTP method sent by the client in the request line. -/// -/// # Examples -/// -/// - `GeT` -/// - `ACL` -/// - `foo` -pub const HTTP_REQUEST_METHOD_ORIGINAL: &str = "http.request.method_original"; - -/// 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. -/// -/// # Examples -/// -/// - `3495` -pub const HTTP_REQUEST_BODY_SIZE: &str = "http.request.body.size"; - -/// 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. -/// -/// # Examples -/// -/// - `3495` -pub const HTTP_RESPONSE_BODY_SIZE: &str = "http.response.body.size"; - -/// The ordinal number of request resending attempt (for any reason, including redirects). -/// -/// 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). -/// -/// # Examples -/// -/// - `3` -pub const HTTP_RESEND_COUNT: &str = "http.resend_count"; - -/// The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. -/// -/// # Examples -/// -/// - `79b9da39-b7ae-508a-a6bc-864b2829c622` -/// - `C9ER4AJX75574TDJ` -pub const AWS_REQUEST_ID: &str = "aws.request_id"; - -/// The keys in the `RequestItems` object field. -/// -/// # Examples -/// -/// - `Users` -/// - `Cats` -pub const AWS_DYNAMODB_TABLE_NAMES: &str = "aws.dynamodb.table_names"; - -/// The JSON-serialized value of each item in the `ConsumedCapacity` response field. -/// -/// # Examples -/// -/// - `{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number }` -pub const AWS_DYNAMODB_CONSUMED_CAPACITY: &str = "aws.dynamodb.consumed_capacity"; - -/// The JSON-serialized value of the `ItemCollectionMetrics` response field. -/// -/// # Examples -/// -/// - `{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }` -pub const AWS_DYNAMODB_ITEM_COLLECTION_METRICS: &str = "aws.dynamodb.item_collection_metrics"; - -/// The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. -/// -/// # Examples -/// -/// - `1.0` -/// - `2.0` -pub const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: &str = "aws.dynamodb.provisioned_read_capacity"; - -/// The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. -/// -/// # Examples -/// -/// - `1.0` -/// - `2.0` -pub const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: &str = "aws.dynamodb.provisioned_write_capacity"; - -/// The value of the `ConsistentRead` request parameter. -pub const AWS_DYNAMODB_CONSISTENT_READ: &str = "aws.dynamodb.consistent_read"; - -/// The value of the `ProjectionExpression` request parameter. -/// -/// # Examples -/// -/// - `Title` -/// - `Title, Price, Color` -/// - `Title, Description, RelatedItems, ProductReviews` -pub const AWS_DYNAMODB_PROJECTION: &str = "aws.dynamodb.projection"; - -/// The value of the `Limit` request parameter. -/// -/// # Examples -/// -/// - `10` -pub const AWS_DYNAMODB_LIMIT: &str = "aws.dynamodb.limit"; - -/// The value of the `AttributesToGet` request parameter. -/// -/// # Examples -/// -/// - `lives` -/// - `id` -pub const AWS_DYNAMODB_ATTRIBUTES_TO_GET: &str = "aws.dynamodb.attributes_to_get"; - -/// The value of the `IndexName` request parameter. -/// -/// # Examples -/// -/// - `name_to_group` -pub const AWS_DYNAMODB_INDEX_NAME: &str = "aws.dynamodb.index_name"; - -/// The value of the `Select` request parameter. -/// -/// # Examples -/// -/// - `ALL_ATTRIBUTES` -/// - `COUNT` -pub const AWS_DYNAMODB_SELECT: &str = "aws.dynamodb.select"; - -/// The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. -/// -/// # Examples -/// -/// - `{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }` -pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: &str = "aws.dynamodb.global_secondary_indexes"; - -/// The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. -/// -/// # Examples -/// -/// - `{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }` -pub const AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: &str = "aws.dynamodb.local_secondary_indexes"; - -/// The value of the `ExclusiveStartTableName` request parameter. -/// -/// # Examples -/// -/// - `Users` -/// - `CatsTable` -pub const AWS_DYNAMODB_EXCLUSIVE_START_TABLE: &str = "aws.dynamodb.exclusive_start_table"; - -/// The the number of items in the `TableNames` response parameter. -/// -/// # Examples -/// -/// - `20` -pub const AWS_DYNAMODB_TABLE_COUNT: &str = "aws.dynamodb.table_count"; - -/// The value of the `ScanIndexForward` request parameter. -pub const AWS_DYNAMODB_SCAN_FORWARD: &str = "aws.dynamodb.scan_forward"; - -/// The value of the `Segment` request parameter. -/// -/// # Examples -/// -/// - `10` -pub const AWS_DYNAMODB_SEGMENT: &str = "aws.dynamodb.segment"; - -/// The value of the `TotalSegments` request parameter. -/// -/// # Examples -/// -/// - `100` -pub const AWS_DYNAMODB_TOTAL_SEGMENTS: &str = "aws.dynamodb.total_segments"; - -/// The value of the `Count` response parameter. -/// -/// # Examples -/// -/// - `10` -pub const AWS_DYNAMODB_COUNT: &str = "aws.dynamodb.count"; - -/// The value of the `ScannedCount` response parameter. -/// -/// # Examples -/// -/// - `50` -pub const AWS_DYNAMODB_SCANNED_COUNT: &str = "aws.dynamodb.scanned_count"; - -/// The JSON-serialized value of each item in the `AttributeDefinitions` request field. -/// -/// # Examples -/// -/// - `{ "AttributeName": "string", "AttributeType": "string" }` -pub const AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: &str = "aws.dynamodb.attribute_definitions"; - -/// The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. -/// -/// # Examples -/// -/// - `{ "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }` -pub const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: &str = "aws.dynamodb.global_secondary_index_updates"; - -/// The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. -/// -/// The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. -/// This applies to almost all S3 operations except `list-buckets`. -/// -/// # Examples -/// -/// - `some-bucket-name` -pub const AWS_S3_BUCKET: &str = "aws.s3.bucket"; - -/// The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. -/// -/// The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. -/// This applies in particular to the following operations: -/// -/// - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) -/// - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) -/// - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) -/// - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) -/// - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) -/// - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) -/// - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) -/// - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) -/// - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) -/// - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) -/// - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) -/// - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) -/// - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) -/// -/// # Examples -/// -/// - `someFile.yml` -pub const AWS_S3_KEY: &str = "aws.s3.key"; - -/// The source object (in the form `bucket`/`key`) for the copy operation. -/// -/// The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter -/// of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). -/// This applies in particular to the following operations: -/// -/// - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) -/// - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) -/// -/// # Examples -/// -/// - `someFile.yml` -pub const AWS_S3_COPY_SOURCE: &str = "aws.s3.copy_source"; - -/// Upload ID that identifies the multipart upload. -/// -/// The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter -/// of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. -/// This applies in particular to the following operations: -/// -/// - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) -/// - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) -/// - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) -/// - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) -/// - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) -/// -/// # Examples -/// -/// - `dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ` -pub const AWS_S3_UPLOAD_ID: &str = "aws.s3.upload_id"; - -/// The delete request container that specifies the objects to be deleted. -/// -/// The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. -/// The `delete` attribute corresponds to the `--delete` parameter of the -/// [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). -/// -/// # Examples -/// -/// - `Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean` -pub const AWS_S3_DELETE: &str = "aws.s3.delete"; - -/// The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. -/// -/// The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) -/// and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. -/// The `part_number` attribute corresponds to the `--part-number` parameter of the -/// [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). -/// -/// # Examples -/// -/// - `3456` -pub const AWS_S3_PART_NUMBER: &str = "aws.s3.part_number"; - -/// The name of the operation being executed. -/// -/// # Examples -/// -/// - `findBookById` -pub const GRAPHQL_OPERATION_NAME: &str = "graphql.operation.name"; - -/// The type of the operation being executed. -/// -/// # Examples -/// -/// - `query` -/// - `mutation` -/// - `subscription` -pub const GRAPHQL_OPERATION_TYPE: &str = "graphql.operation.type"; - -/// The GraphQL document being executed. -/// -/// The value may be sanitized to exclude sensitive information. -/// -/// # Examples -/// -/// - `query findBookById { bookById(id: ?) { name } }` -pub const GRAPHQL_DOCUMENT: &str = "graphql.document"; - -/// A value used by the messaging system as an identifier for the message, represented as a string. -/// -/// # Examples -/// -/// - `452a7c7c7c7048c2f887f61572b18fc2` -pub const MESSAGING_MESSAGE_ID: &str = "messaging.message.id"; - -/// The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". -/// -/// # Examples -/// -/// - `MyConversationId` -pub const MESSAGING_MESSAGE_CONVERSATION_ID: &str = "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. -/// -/// # Examples -/// -/// - `2738` -pub const MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: &str = "messaging.message.payload_size_bytes"; - -/// The compressed size of the message payload in bytes. -/// -/// # Examples -/// -/// - `2048` -pub const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: &str = "messaging.message.payload_compressed_size_bytes"; - -/// The message destination name. -/// -/// 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. -/// -/// # Examples -/// -/// - `MyQueue` -/// - `MyTopic` -pub const MESSAGING_DESTINATION_NAME: &str = "messaging.destination.name"; - -/// Low cardinality representation of the messaging destination name. -/// -/// 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. -/// -/// # Examples -/// -/// - `/customers/{customerId}` -pub const MESSAGING_DESTINATION_TEMPLATE: &str = "messaging.destination.template"; - -/// A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. -pub const MESSAGING_DESTINATION_TEMPORARY: &str = "messaging.destination.temporary"; - -/// A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). -pub const MESSAGING_DESTINATION_ANONYMOUS: &str = "messaging.destination.anonymous"; - -/// A string identifying the messaging system. -/// -/// # Examples -/// -/// - `kafka` -/// - `rabbitmq` -/// - `rocketmq` -/// - `activemq` -/// - `AmazonSQS` -pub const MESSAGING_SYSTEM: &str = "messaging.system"; - -/// A string identifying the kind of messaging operation as defined in the [Operation names](#operation-names) section above. -/// -/// If a custom value is used, it MUST be of low cardinality. -pub const MESSAGING_OPERATION: &str = "messaging.operation"; - -/// The number of messages sent, received, or processed in the scope of the batching operation. -/// -/// 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. -/// -/// # Examples -/// -/// - `0` -/// - `1` -/// - `2` -pub const MESSAGING_BATCH_MESSAGE_COUNT: &str = "messaging.batch.message_count"; - -/// A unique identifier for the client that consumes or produces a message. -/// -/// # Examples -/// -/// - `client-5` -/// - `myhost@8742@s8083jm` -pub const MESSAGING_CLIENT_ID: &str = "messaging.client_id"; - -/// RabbitMQ message routing key. -/// -/// # Examples -/// -/// - `myKey` -pub const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: &str = "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 `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. -/// -/// 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. -/// -/// # Examples -/// -/// - `myKey` -pub const MESSAGING_KAFKA_MESSAGE_KEY: &str = "messaging.kafka.message.key"; - -/// Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. -/// -/// # Examples -/// -/// - `my-group` -pub const MESSAGING_KAFKA_CONSUMER_GROUP: &str = "messaging.kafka.consumer.group"; - -/// Partition the message is sent to. -/// -/// # Examples -/// -/// - `2` -pub const MESSAGING_KAFKA_DESTINATION_PARTITION: &str = "messaging.kafka.destination.partition"; - -/// The offset of a record in the corresponding Kafka partition. -/// -/// # Examples -/// -/// - `42` -pub const MESSAGING_KAFKA_MESSAGE_OFFSET: &str = "messaging.kafka.message.offset"; - -/// A boolean that is true if the message is a tombstone. -pub const MESSAGING_KAFKA_MESSAGE_TOMBSTONE: &str = "messaging.kafka.message.tombstone"; - -/// Namespace of RocketMQ resources, resources in different namespaces are individual. -/// -/// # Examples -/// -/// - `myNamespace` -pub const MESSAGING_ROCKETMQ_NAMESPACE: &str = "messaging.rocketmq.namespace"; - -/// Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. -/// -/// # Examples -/// -/// - `myConsumerGroup` -pub const MESSAGING_ROCKETMQ_CLIENT_GROUP: &str = "messaging.rocketmq.client_group"; - -/// The timestamp in milliseconds that the delay message is expected to be delivered to consumer. -/// -/// # Examples -/// -/// - `1665987217045` -pub const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: &str = "messaging.rocketmq.message.delivery_timestamp"; - -/// The delay time level for delay message, which determines the message delay time. -/// -/// # Examples -/// -/// - `3` -pub const MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: &str = "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. -/// -/// # Examples -/// -/// - `myMessageGroup` -pub const MESSAGING_ROCKETMQ_MESSAGE_GROUP: &str = "messaging.rocketmq.message.group"; - -/// Type of message. -pub const MESSAGING_ROCKETMQ_MESSAGE_TYPE: &str = "messaging.rocketmq.message.type"; - -/// The secondary classifier of message besides topic. -/// -/// # Examples -/// -/// - `tagA` -pub const MESSAGING_ROCKETMQ_MESSAGE_TAG: &str = "messaging.rocketmq.message.tag"; - -/// Key(s) of message, another way to mark message besides message id. -/// -/// # Examples -/// -/// - `keyA` -/// - `keyB` -pub const MESSAGING_ROCKETMQ_MESSAGE_KEYS: &str = "messaging.rocketmq.message.keys"; - -/// Model of message consumption. This only applies to consumer spans. -pub const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: &str = "messaging.rocketmq.consumption_model"; - -/// A string identifying the remoting system. See below for a list of well-known identifiers. -pub const RPC_SYSTEM: &str = "rpc.system"; - -/// The full (logical) name of the service being called, including its package name, if applicable. -/// -/// This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). -/// -/// # Examples -/// -/// - `myservice.EchoService` -pub const RPC_SERVICE: &str = "rpc.service"; - -/// The name of the (logical) method being called, must be equal to the $method part in the span name. -/// -/// This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). -/// -/// # Examples -/// -/// - `exampleMethod` -pub const RPC_METHOD: &str = "rpc.method"; - -/// The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. -pub const RPC_GRPC_STATUS_CODE: &str = "rpc.grpc.status_code"; - -/// Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. -/// -/// # Examples -/// -/// - `2.0` -/// - `1.0` -pub const RPC_JSONRPC_VERSION: &str = "rpc.jsonrpc.version"; - -/// `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. -/// -/// # Examples -/// -/// - `10` -/// - `request-7` -/// - `` -pub const RPC_JSONRPC_REQUEST_ID: &str = "rpc.jsonrpc.request_id"; - -/// `error.code` property of response if it is an error response. -/// -/// # Examples -/// -/// - `-32700` -/// - `100` -pub const RPC_JSONRPC_ERROR_CODE: &str = "rpc.jsonrpc.error_code"; - -/// `error.message` property of response if it is an error response. -/// -/// # Examples -/// -/// - `Parse error` -/// - `User already exists` -pub const RPC_JSONRPC_ERROR_MESSAGE: &str = "rpc.jsonrpc.error_message"; - -/// Whether this is a received or sent message. -pub const MESSAGE_TYPE: &str = "message.type"; - -/// MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. -/// -/// This way we guarantee that the values will be consistent between different implementations. -pub const MESSAGE_ID: &str = "message.id"; - -/// Compressed size of the message in bytes. -pub const MESSAGE_COMPRESSED_SIZE: &str = "message.compressed_size"; - -/// Uncompressed size of the message in bytes. -pub const MESSAGE_UNCOMPRESSED_SIZE: &str = "message.uncompressed_size"; - -/// The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. -pub const RPC_CONNECT_RPC_ERROR_CODE: &str = "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. -/// -/// 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. -pub const EXCEPTION_ESCAPED: &str = "exception.escaped"; - -/// The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. -/// -/// # Examples -/// -/// - `https` -/// - `ftp` -/// - `telnet` -pub const URL_SCHEME: &str = "url.scheme"; - -/// Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). -/// -/// For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. -/// `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:REDACTED@www.example.com/`. -/// `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. -/// -/// # Examples -/// -/// - `https://www.foo.bar/search?q=OpenTelemetry#SemConv` -/// - `//localhost` -pub const URL_FULL: &str = "url.full"; - -/// The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. -/// -/// When missing, the value is assumed to be `/` -/// -/// # Examples -/// -/// - `/search` -pub const URL_PATH: &str = "url.path"; - -/// The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. -/// -/// Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. -/// -/// # Examples -/// -/// - `q=OpenTelemetry` -pub const URL_QUERY: &str = "url.query"; - -/// The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. -/// -/// # Examples -/// -/// - `SemConv` -pub const URL_FRAGMENT: &str = "url.fragment"; - -/// Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. -/// -/// # Examples -/// -/// - `CERN-LineMode/2.15 libwww/2.17b3` -pub const USER_AGENT_ORIGINAL: &str = "user_agent.original"; \ No newline at end of file From 2f5cca92ee279349513cce4ea4021f2027c4fe91 Mon Sep 17 00:00:00 2001 From: Kristopher Wuollett Date: Fri, 10 Nov 2023 09:08:22 -0600 Subject: [PATCH 4/5] fix: remove tracing examples from semconv docs --- opentelemetry-semantic-conventions/Cargo.toml | 1 - .../scripts/templates/header_resource.rs | 16 ---------------- .../scripts/templates/header_trace.rs | 16 ---------------- .../src/resource.rs | 16 ---------------- opentelemetry-semantic-conventions/src/trace.rs | 16 ---------------- 5 files changed, 65 deletions(-) diff --git a/opentelemetry-semantic-conventions/Cargo.toml b/opentelemetry-semantic-conventions/Cargo.toml index 74c2e51526..c235799548 100644 --- a/opentelemetry-semantic-conventions/Cargo.toml +++ b/opentelemetry-semantic-conventions/Cargo.toml @@ -24,4 +24,3 @@ opentelemetry = { version = "0.21", default-features = false, path = "../opentel [dev-dependencies] opentelemetry_sdk = { features = ["trace"], path = "../opentelemetry-sdk" } -tracing = { version = "0.1.40", default-features = false } diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs index c44e4044a5..724c10e192 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs @@ -6,22 +6,6 @@ //! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource //! //! ## Usage -//! -//! [`tracing`]: -//! -//! ``` -//! use opentelemetry_semantic_conventions as semconv; -//! use tracing::span; -//! -//! let span = span!( -//! LEVEL::INFO, -//! "handle_request", -//! { semconv::resource::SERVICE_NAME = "my-service" }, -//! { semconv::resource::SERVICE_NAMESPACE = "my-namespace" } -//! ); -//! ``` -//! -//! OpenTelemetry SDK: //! //! ``` //! use opentelemetry::KeyValue; diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs index 4e059e0dd6..4a095df0ee 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs @@ -6,22 +6,6 @@ //! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace //! //! ## Usage -//! -//! [`tracing`]: -//! -//! ``` -//! use opentelemetry_semantic_conventions as semconv; -//! use tracing::span; -//! -//! let span = span!( -//! LEVEL::INFO, -//! "handle_request", -//! { semconv::trace::NET_PEER_NAME = "example.org" }, -//! { semconv::trace::NET_PEER_PORT = 80 } -//! ); -//! ``` -//! -//! OpenTelemetry SDK: //! //! ``` //! use opentelemetry::KeyValue; diff --git a/opentelemetry-semantic-conventions/src/resource.rs b/opentelemetry-semantic-conventions/src/resource.rs index a3cf2b4f6c..d84510b46d 100644 --- a/opentelemetry-semantic-conventions/src/resource.rs +++ b/opentelemetry-semantic-conventions/src/resource.rs @@ -13,22 +13,6 @@ //! //! ## Usage //! -//! [`tracing`]: -//! -//! ``` -//! use opentelemetry_semantic_conventions as semconv; -//! use tracing::span; -//! -//! let span = span!( -//! LEVEL::INFO, -//! "handle_request", -//! { semconv::resource::SERVICE_NAME = "my-service" }, -//! { semconv::resource::SERVICE_NAMESPACE = "my-namespace" } -//! ); -//! ``` -//! -//! OpenTelemetry SDK: -//! //! ``` //! use opentelemetry::KeyValue; //! use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource}; diff --git a/opentelemetry-semantic-conventions/src/trace.rs b/opentelemetry-semantic-conventions/src/trace.rs index 76d0f71e95..5612cd1a86 100644 --- a/opentelemetry-semantic-conventions/src/trace.rs +++ b/opentelemetry-semantic-conventions/src/trace.rs @@ -13,22 +13,6 @@ //! //! ## Usage //! -//! [`tracing`]: -//! -//! ``` -//! use opentelemetry_semantic_conventions as semconv; -//! use tracing::span; -//! -//! let span = span!( -//! LEVEL::INFO, -//! "handle_request", -//! { semconv::trace::NET_PEER_NAME = "example.org" }, -//! { semconv::trace::NET_PEER_PORT = 80 } -//! ); -//! ``` -//! -//! OpenTelemetry SDK: -//! //! ``` //! use opentelemetry::KeyValue; //! use opentelemetry::{global, trace::Tracer as _}; From 2af841a0a8da34f6f74163161d5f211263df9ac3 Mon Sep 17 00:00:00 2001 From: Kristopher Wuollett Date: Fri, 10 Nov 2023 09:14:01 -0600 Subject: [PATCH 5/5] docs: remove extra whitespace that was added previously --- .../scripts/templates/header_resource.rs | 2 +- .../scripts/templates/header_trace.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs index 724c10e192..f816eafc3a 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_resource.rs @@ -6,7 +6,7 @@ //! [resource semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/resource //! //! ## Usage -//! +//! //! ``` //! use opentelemetry::KeyValue; //! use opentelemetry_sdk::{trace::{config, TracerProvider}, Resource}; diff --git a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs index 4a095df0ee..ca8a1b2f12 100644 --- a/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs +++ b/opentelemetry-semantic-conventions/scripts/templates/header_trace.rs @@ -6,7 +6,7 @@ //! [trace semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/trace //! //! ## Usage -//! +//! //! ``` //! use opentelemetry::KeyValue; //! use opentelemetry::{global, trace::Tracer as _};