Skip to content

Semconv 1.23.0 #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ val snapshot = true
// end

// The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes
var semanticConventionsVersion = "1.22.0"
var semanticConventionsVersion = "1.23.0"

// Compute the artifact version, which includes the "-alpha" suffix and includes "-SNAPSHOT" suffix if not releasing
// Release example: version=1.21.0-alpha
Expand Down Expand Up @@ -70,7 +70,7 @@ dependencies {
}

// start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions
var generatorVersion = "0.22.0"
var generatorVersion = "0.23.0"
val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip"
val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion"

Expand Down Expand Up @@ -105,10 +105,9 @@ val generateSemanticAttributes by tasks.registering(Exec::class) {
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
"otel/semconvgen:$generatorVersion",
"--only", "span,event,attribute_group,scope",
"-f", "/source", "code",
"--yaml-root", "/source", "code",
"--template", "/templates/SemanticAttributes.java.j2",
"--output", "/output/SemanticAttributes.java",
"-Dsemconv=trace",
"-Dclass=SemanticAttributes",
"-DschemaUrl=$schemaUrl",
"-Dpkg=io.opentelemetry.semconv"))
Expand All @@ -127,7 +126,7 @@ val generateResourceAttributes by tasks.registering(Exec::class) {
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
"otel/semconvgen:$generatorVersion",
"--only", "resource",
"-f", "/source", "code",
"--yaml-root", "/source", "code",
"--template", "/templates/SemanticAttributes.java.j2",
"--output", "/output/ResourceAttributes.java",
"-Dclass=ResourceAttributes",
Expand Down
311 changes: 17 additions & 294 deletions src/main/java/io/opentelemetry/semconv/ResourceAttributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@SuppressWarnings("unused")
public final class ResourceAttributes {
/** The URL of the OpenTelemetry schema for these keys and values. */
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.22.0";
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.23.0";

/**
* Uniquely identifies the framework API revision offered by a version ({@code os.version}) of the
Expand Down Expand Up @@ -84,88 +84,6 @@ public final class ResourceAttributes {
*/
public static final AttributeKey<String> BROWSER_PLATFORM = stringKey("browser.platform");

/** The cloud account ID the resource is assigned to. */
public static final AttributeKey<String> CLOUD_ACCOUNT_ID = stringKey("cloud.account.id");

/**
* Cloud regions often have multiple, isolated locations known as zones to increase availability.
* Availability zone represents the zone where the resource is running.
*
* <p>Notes:
*
* <ul>
* <li>Availability zones are called &quot;zones&quot; on Alibaba Cloud and Google Cloud.
* </ul>
*/
public static final AttributeKey<String> CLOUD_AVAILABILITY_ZONE =
stringKey("cloud.availability_zone");

/**
* The cloud platform in use.
*
* <p>Notes:
*
* <ul>
* <li>The prefix of the service SHOULD match the one specified in {@code cloud.provider}.
* </ul>
*/
public static final AttributeKey<String> CLOUD_PLATFORM = stringKey("cloud.platform");

/** Name of the cloud provider. */
public static final AttributeKey<String> CLOUD_PROVIDER = stringKey("cloud.provider");

/**
* The geographical region the resource is running.
*
* <p>Notes:
*
* <ul>
* <li>Refer to your provider's docs to see the available regions, for example <a
* href="https://www.alibabacloud.com/help/doc-detail/40654.htm">Alibaba Cloud regions</a>,
* <a href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/">AWS
* regions</a>, <a
* href="https://azure.microsoft.com/en-us/global-infrastructure/geographies/">Azure
* regions</a>, <a href="https://cloud.google.com/about/locations">Google Cloud regions</a>,
* or <a href="https://www.tencentcloud.com/document/product/213/6091">Tencent Cloud
* regions</a>.
* </ul>
*/
public static final AttributeKey<String> CLOUD_REGION = stringKey("cloud.region");

/**
* Cloud provider-specific native identifier of the monitored cloud resource (e.g. an <a
* href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> on
* AWS, a <a href="https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id">fully
* qualified resource ID</a> on Azure, a <a
* href="https://cloud.google.com/apis/design/resource_names#full_resource_name">full resource
* name</a> on GCP)
*
* <p>Notes:
*
* <ul>
* <li>On some cloud providers, it may not be possible to determine the full ID at startup, so
* it may be necessary to set {@code cloud.resource_id} as a span attribute instead.
* <li>The exact value to use for {@code cloud.resource_id} depends on the cloud provider. The
* following well-known definitions MUST be used if you set this attribute and they apply:
* <li><strong>AWS Lambda:</strong> The function <a
* href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a>.
* Take care not to use the &quot;invoked ARN&quot; directly but replace any <a
* href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html">alias
* suffix</a> with the resolved function version, as the same runtime instance may be
* invokable with multiple different aliases.
* <li><strong>GCP:</strong> The <a
* href="https://cloud.google.com/iam/docs/full-resource-names">URI of the resource</a>
* <li><strong>Azure:</strong> The <a
* href="https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id">Fully
* Qualified Resource ID</a> of the invoked function, <em>not</em> the function app, having
* the form {@code
* /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.
* </ul>
*/
public static final AttributeKey<String> CLOUD_RESOURCE_ID = stringKey("cloud.resource_id");

/**
* The ARN of an <a
* href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html">ECS
Expand Down Expand Up @@ -298,89 +216,7 @@ public final class ResourceAttributes {
stringKey("heroku.release.creation_timestamp");

/**
* The command used to run the container (i.e. the command name).
*
* <p>Notes:
*
* <ul>
* <li>If using embedded credentials or sensitive data, it is recommended to remove them to
* prevent potential leakage.
* </ul>
*/
public static final AttributeKey<String> CONTAINER_COMMAND = stringKey("container.command");

/**
* All the command arguments (including the command/executable itself) run by the container. [2]
*/
public static final AttributeKey<List<String>> CONTAINER_COMMAND_ARGS =
stringArrayKey("container.command_args");

/** The full command run by the container as a single string representing the full command. [2] */
public static final AttributeKey<String> CONTAINER_COMMAND_LINE =
stringKey("container.command_line");

/**
* Container ID. Usually a UUID, as for example used to <a
* href="https://docs.docker.com/engine/reference/run/#container-identification">identify Docker
* containers</a>. The UUID might be abbreviated.
*/
public static final AttributeKey<String> CONTAINER_ID = stringKey("container.id");

/**
* Runtime specific image identifier. Usually a hash algorithm followed by a UUID.
*
* <p>Notes:
*
* <ul>
* <li>Docker defines a sha256 of the image id; {@code container.image.id} corresponds to the
* {@code Image} field from the Docker container inspect <a
* href="https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect">API</a>
* endpoint. K8s defines a link to the container registry repository with digest {@code
* "imageID": "registry.azurecr.io
* /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"}.
* The ID is assinged by the container runtime and can vary in different environments.
* Consider using {@code oci.manifest.digest} if it is important to identify the same image
* in different environments/runtimes.
* </ul>
*/
public static final AttributeKey<String> CONTAINER_IMAGE_ID = stringKey("container.image.id");

/** Name of the image the container was built on. */
public static final AttributeKey<String> CONTAINER_IMAGE_NAME = stringKey("container.image.name");

/**
* Repo digests of the container image as provided by the container runtime.
*
* <p>Notes:
*
* <ul>
* <li><a
* href="https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect">Docker</a>
* and <a
* href="https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238">CRI</a>
* report those under the {@code RepoDigests} field.
* </ul>
*/
public static final AttributeKey<List<String>> CONTAINER_IMAGE_REPO_DIGESTS =
stringArrayKey("container.image.repo_digests");

/**
* Container image tags. An example can be found in <a
* href="https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect">Docker Image
* Inspect</a>. Should be only the {@code <tag>} section of the full name for example from {@code
* registry.example.com/my-org/my-image:<tag>}.
*/
public static final AttributeKey<List<String>> CONTAINER_IMAGE_TAGS =
stringArrayKey("container.image.tags");

/** Container name used by container runtime. */
public static final AttributeKey<String> CONTAINER_NAME = stringKey("container.name");

/** The container runtime managing this container. */
public static final AttributeKey<String> CONTAINER_RUNTIME = stringKey("container.runtime");

/**
* Name of the <a href="https://en.wikipedia.org/wiki/Deployment_environment">deployment
* Name of the <a href="https://wikipedia.org/wiki/Deployment_environment">deployment
* environment</a> (aka deployment tier).
*/
public static final AttributeKey<String> DEPLOYMENT_ENVIRONMENT =
Expand Down Expand Up @@ -549,6 +385,20 @@ public final class ResourceAttributes {
*/
public static final AttributeKey<List<String>> HOST_IP = stringArrayKey("host.ip");

/**
* Available MAC addresses of the host, excluding loopback interfaces.
*
* <p>Notes:
*
* <ul>
* <li>MAC Addresses MUST be represented in <a
* href="https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf">IEEE
* RA hexadecimal form</a>: as hyphen-separated octets in uppercase hexadecimal form from
* most to least significant.
* </ul>
*/
public static final AttributeKey<List<String>> HOST_MAC = stringArrayKey("host.mac");

/**
* 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.
Expand Down Expand Up @@ -598,7 +448,7 @@ public final class ResourceAttributes {
* <p>Notes:
*
* <ul>
* <li>K8s does not have support for obtaining a cluster ID. If this is ever added, we will
* <li>K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will
* recommend collecting the {@code k8s.cluster.uid} through the official APIs. In the
* meantime, we are able to use the {@code uid} of the {@code kube-system} namespace as a
* proxy for cluster ID. Read on for the rationale.
Expand Down Expand Up @@ -681,23 +531,6 @@ public final class ResourceAttributes {
/** The UID of the CronJob. */
public static final AttributeKey<String> K8S_CRONJOB_UID = stringKey("k8s.cronjob.uid");

/**
* The digest of the OCI image manifest. For container images specifically is the digest by which
* the container image is known.
*
* <p>Notes:
*
* <ul>
* <li>Follows <a href="https://github.com/opencontainers/image-spec/blob/main/manifest.md">OCI
* Image Manifest Specification</a>, and specifically the <a
* href="https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests">Digest
* property</a>. An example can be found in <a
* href="https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest">Example
* Image Manifest</a>.
* </ul>
*/
public static final AttributeKey<String> OCI_MANIFEST_DIGEST = stringKey("oci.manifest.digest");

/** Unique identifier for a particular build or compilation of the operating system. */
public static final AttributeKey<String> OS_BUILD_ID = stringKey("os.build_id");

Expand Down Expand Up @@ -919,116 +752,6 @@ public final class ResourceAttributes {
public static final AttributeKey<String> OTEL_LIBRARY_VERSION = stringKey("otel.library.version");

// Enum definitions
public static final class CloudPlatformValues {
/** Alibaba Cloud Elastic Compute Service. */
public static final String ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs";

/** Alibaba Cloud Function Compute. */
public static final String ALIBABA_CLOUD_FC = "alibaba_cloud_fc";

/** Red Hat OpenShift on Alibaba Cloud. */
public static final String ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift";

/** AWS Elastic Compute Cloud. */
public static final String AWS_EC2 = "aws_ec2";

/** AWS Elastic Container Service. */
public static final String AWS_ECS = "aws_ecs";

/** AWS Elastic Kubernetes Service. */
public static final String AWS_EKS = "aws_eks";

/** AWS Lambda. */
public static final String AWS_LAMBDA = "aws_lambda";

/** AWS Elastic Beanstalk. */
public static final String AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk";

/** AWS App Runner. */
public static final String AWS_APP_RUNNER = "aws_app_runner";

/** Red Hat OpenShift on AWS (ROSA). */
public static final String AWS_OPENSHIFT = "aws_openshift";

/** Azure Virtual Machines. */
public static final String AZURE_VM = "azure_vm";

/** Azure Container Instances. */
public static final String AZURE_CONTAINER_INSTANCES = "azure_container_instances";

/** Azure Kubernetes Service. */
public static final String AZURE_AKS = "azure_aks";

/** Azure Functions. */
public static final String AZURE_FUNCTIONS = "azure_functions";

/** Azure App Service. */
public static final String AZURE_APP_SERVICE = "azure_app_service";

/** Azure Red Hat OpenShift. */
public static final String AZURE_OPENSHIFT = "azure_openshift";

/** Google Bare Metal Solution (BMS). */
public static final String GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution";

/** Google Cloud Compute Engine (GCE). */
public static final String GCP_COMPUTE_ENGINE = "gcp_compute_engine";

/** Google Cloud Run. */
public static final String GCP_CLOUD_RUN = "gcp_cloud_run";

/** Google Cloud Kubernetes Engine (GKE). */
public static final String GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine";

/** Google Cloud Functions (GCF). */
public static final String GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions";

/** Google Cloud App Engine (GAE). */
public static final String GCP_APP_ENGINE = "gcp_app_engine";

/** Red Hat OpenShift on Google Cloud. */
public static final String GCP_OPENSHIFT = "gcp_openshift";

/** Red Hat OpenShift on IBM Cloud. */
public static final String IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift";

/** Tencent Cloud Cloud Virtual Machine (CVM). */
public static final String TENCENT_CLOUD_CVM = "tencent_cloud_cvm";

/** Tencent Cloud Elastic Kubernetes Service (EKS). */
public static final String TENCENT_CLOUD_EKS = "tencent_cloud_eks";

/** Tencent Cloud Serverless Cloud Function (SCF). */
public static final String TENCENT_CLOUD_SCF = "tencent_cloud_scf";

private CloudPlatformValues() {}
}

public static final class CloudProviderValues {
/** Alibaba Cloud. */
public static final String ALIBABA_CLOUD = "alibaba_cloud";

/** Amazon Web Services. */
public static final String AWS = "aws";

/** Microsoft Azure. */
public static final String AZURE = "azure";

/** Google Cloud Platform. */
public static final String GCP = "gcp";

/** Heroku Platform as a Service. */
public static final String HEROKU = "heroku";

/** IBM Cloud. */
public static final String IBM_CLOUD = "ibm_cloud";

/** Tencent Cloud. */
public static final String TENCENT_CLOUD = "tencent_cloud";

private CloudProviderValues() {}
}

public static final class AwsEcsLaunchtypeValues {
/** ec2. */
public static final String EC2 = "ec2";
Expand Down
Loading