update semconv to v1.8.0 (#3890)

* update semconv to v1.8.0

* add back 2 items that were removed from the spec

* tweak the deprecated items javadoc
This commit is contained in:
John Watson 2021-11-18 16:25:16 -08:00 committed by GitHub
parent 31d8840bf9
commit 47ccd6076b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 159 additions and 34 deletions

View File

@ -4,7 +4,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
SEMCONV_VERSION=1.7.0
SEMCONV_VERSION=1.8.0
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
GENERATOR_VERSION=0.7.0

View File

@ -106,6 +106,24 @@ public final class {{class}} {
* io.opentelemetry.api.trace.Span#recordException(Throwable)} should be used.
*/
public static final String EXCEPTION_EVENT_NAME = "exception";
/**
* The name of the keyspace being accessed.
*
* @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use {@link SemanticAttributes#DB_NAME} instead.
*/
@Deprecated
public static final AttributeKey<String> DB_CASSANDRA_KEYSPACE =
stringKey("db.cassandra.keyspace");
/**
* The <a href="https://hbase.apache.org/book.html#_namespace">HBase namespace</a> being accessed.
*
* @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use {@link SemanticAttributes#DB_NAME} instead.
*/
@Deprecated
public static final AttributeKey<String> DB_HBASE_NAMESPACE = stringKey("db.hbase.namespace");
{% endif %}
private {{class}}() {}

View File

@ -16,7 +16,7 @@ import java.util.List;
// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2
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.7.0";
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.8.0";
/** Name of the cloud provider. */
public static final AttributeKey<String> CLOUD_PROVIDER = stringKey("cloud.provider");
@ -25,12 +25,20 @@ public final class ResourceAttributes {
public static final AttributeKey<String> CLOUD_ACCOUNT_ID = stringKey("cloud.account.id");
/**
* The geographical region the resource is running. 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>,
* or <a href="https://cloud.google.com/about/locations">Google Cloud regions</a>.
* 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://intl.cloud.tencent.com/document/product/213/6091">Tencent Cloud
* regions</a>.
* </ul>
*/
public static final AttributeKey<String> CLOUD_REGION = stringKey("cloud.region");
@ -143,7 +151,7 @@ public final class ResourceAttributes {
public static final AttributeKey<List<String>> AWS_LOG_STREAM_ARNS =
stringArrayKey("aws.log.stream.arns");
/** Container name. */
/** Container name used by container runtime. */
public static final AttributeKey<String> CONTAINER_NAME = stringKey("container.name");
/**
@ -347,9 +355,19 @@ public final class ResourceAttributes {
/** The name of the Pod. */
public static final AttributeKey<String> K8S_POD_NAME = stringKey("k8s.pod.name");
/** The name of the Container in a Pod template. */
/**
* The name of the Container from Pod specification, must be unique within a Pod. Container
* runtime usually uses different globally unique name ({@code container.name}).
*/
public static final AttributeKey<String> K8S_CONTAINER_NAME = stringKey("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.
*/
public static final AttributeKey<Long> K8S_CONTAINER_RESTART_COUNT =
longKey("k8s.container.restart_count");
/** The UID of the ReplicaSet. */
public static final AttributeKey<String> K8S_REPLICASET_UID = stringKey("k8s.replicaset.uid");
@ -557,6 +575,8 @@ public final class ResourceAttributes {
public static final String AZURE = "azure";
/** Google Cloud Platform. */
public static final String GCP = "gcp";
/** Tencent Cloud. */
public static final String TENCENT_CLOUD = "tencent_cloud";
private CloudProviderValues() {}
}
@ -576,6 +596,8 @@ public final class ResourceAttributes {
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";
/** Azure Virtual Machines. */
public static final String AZURE_VM = "azure_vm";
/** Azure Container Instances. */
@ -596,6 +618,12 @@ public final class ResourceAttributes {
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";
/** 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() {}
}
@ -622,6 +650,8 @@ public final class ResourceAttributes {
public static final String PPC32 = "ppc32";
/** 64-bit PowerPC. */
public static final String PPC64 = "ppc64";
/** IBM z/Architecture. */
public static final String S390X = "s390x";
/** 32-bit x86. */
public static final String X86 = "x86";
@ -676,6 +706,8 @@ public final class ResourceAttributes {
public static final String RUBY = "ruby";
/** webjs. */
public static final String WEBJS = "webjs";
/** swift. */
public static final String SWIFT = "swift";
private TelemetrySdkLanguageValues() {}
}

View File

@ -18,7 +18,7 @@ import java.util.List;
// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2
public final class SemanticAttributes {
/** The URL of the OpenTelemetry schema for these keys and values. */
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.7.0";
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.8.0";
/**
* The full invoked ARN as provided on the {@code Context} passed to the function ({@code
@ -58,15 +58,16 @@ public final class SemanticAttributes {
stringKey("db.jdbc.driver_classname");
/**
* If no <a href="#call-level-attributes-for-specific-technologies">tech-specific attribute</a> is
* defined, 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).
* 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).
*
* <p>Notes:
*
* <ul>
* <li>In some SQL databases, the database name to be used is called &quot;schema name&quot;.
* <li>In some SQL databases, the database name to be used is called &quot;schema name&quot;. 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).
* </ul>
*/
public static final AttributeKey<String> DB_NAME = stringKey("db.name");
@ -113,13 +114,6 @@ public final class SemanticAttributes {
public static final AttributeKey<String> DB_MSSQL_INSTANCE_NAME =
stringKey("db.mssql.instance_name");
/**
* The name of the keyspace being accessed. To be used instead of the generic {@code db.name}
* attribute.
*/
public static final AttributeKey<String> DB_CASSANDRA_KEYSPACE =
stringKey("db.cassandra.keyspace");
/** The fetch size used for paging, i.e. how many rows will be returned at once. */
public static final AttributeKey<Long> DB_CASSANDRA_PAGE_SIZE = longKey("db.cassandra.page_size");
@ -131,8 +125,8 @@ public final class SemanticAttributes {
stringKey("db.cassandra.consistency_level");
/**
* The name of the primary table that the operation is acting upon, including the schema name (if
* applicable).
* The name of the primary table that the operation is acting upon, including the keyspace name
* (if applicable).
*
* <p>Notes:
*
@ -165,12 +159,6 @@ public final class SemanticAttributes {
public static final AttributeKey<String> DB_CASSANDRA_COORDINATOR_DC =
stringKey("db.cassandra.coordinator.dc");
/**
* The <a href="https://hbase.apache.org/book.html#_namespace">HBase namespace</a> being accessed.
* To be used instead of the generic {@code db.name} attribute.
*/
public static final AttributeKey<String> DB_HBASE_NAMESPACE = stringKey("db.hbase.namespace");
/**
* The index of the database being accessed as used in the <a
* href="https://redis.io/commands/select">{@code SELECT} command</a>, provided as an integer. To
@ -184,8 +172,8 @@ public final class SemanticAttributes {
stringKey("db.mongodb.collection");
/**
* The name of the primary table that the operation is acting upon, including the schema name (if
* applicable).
* The name of the primary table that the operation is acting upon, including the database name
* (if applicable).
*
* <p>Notes:
*
@ -236,7 +224,20 @@ public final class SemanticAttributes {
*/
public static final AttributeKey<Boolean> EXCEPTION_ESCAPED = booleanKey("exception.escaped");
/** Type of the trigger on which the function is executed. */
/**
* Type of the trigger which caused this function execution.
*
* <p>Notes:
*
* <ul>
* <li>For the server/consumer span on the incoming side, {@code faas.trigger} MUST be set.
* <li>Clients invoking FaaS instances usually cannot set {@code 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).
* </ul>
*/
public static final AttributeKey<String> FAAS_TRIGGER = stringKey("faas.trigger");
/** The execution ID of the current function execution. */
@ -751,6 +752,37 @@ public final class SemanticAttributes {
public static final AttributeKey<Boolean> MESSAGING_KAFKA_TOMBSTONE =
booleanKey("messaging.kafka.tombstone");
/** Namespace of RocketMQ resources, resources in different namespaces are individual. */
public static final AttributeKey<String> MESSAGING_ROCKETMQ_NAMESPACE =
stringKey("messaging.rocketmq.namespace");
/**
* Name of the RocketMQ producer/consumer group that is handling the message. The client type is
* identified by the SpanKind.
*/
public static final AttributeKey<String> MESSAGING_ROCKETMQ_CLIENT_GROUP =
stringKey("messaging.rocketmq.client_group");
/** The unique identifier for each client. */
public static final AttributeKey<String> MESSAGING_ROCKETMQ_CLIENT_ID =
stringKey("messaging.rocketmq.client_id");
/** Type of message. */
public static final AttributeKey<String> MESSAGING_ROCKETMQ_MESSAGE_TYPE =
stringKey("messaging.rocketmq.message_type");
/** The secondary classifier of message besides topic. */
public static final AttributeKey<String> MESSAGING_ROCKETMQ_MESSAGE_TAG =
stringKey("messaging.rocketmq.message_tag");
/** Key(s) of message, another way to mark message besides message id. */
public static final AttributeKey<List<String>> MESSAGING_ROCKETMQ_MESSAGE_KEYS =
stringArrayKey("messaging.rocketmq.message_keys");
/** Model of message consumption. This only applies to consumer spans. */
public static final AttributeKey<String> MESSAGING_ROCKETMQ_CONSUMPTION_MODEL =
stringKey("messaging.rocketmq.consumption_model");
/** A string identifying the remoting system. */
public static final AttributeKey<String> RPC_SYSTEM = stringKey("rpc.system");
@ -997,6 +1029,8 @@ public final class SemanticAttributes {
public static final String AZURE = "azure";
/** Google Cloud Platform. */
public static final String GCP = "gcp";
/** Tencent Cloud. */
public static final String TENCENT_CLOUD = "tencent_cloud";
private FaasInvokedProviderValues() {}
}
@ -1115,6 +1149,28 @@ public final class SemanticAttributes {
private MessagingOperationValues() {}
}
public static final class MessagingRocketmqMessageTypeValues {
/** Normal message. */
public static final String NORMAL = "normal";
/** FIFO message. */
public static final String FIFO = "fifo";
/** Delay message. */
public static final String DELAY = "delay";
/** Transaction message. */
public static final String TRANSACTION = "transaction";
private MessagingRocketmqMessageTypeValues() {}
}
public static final class MessagingRocketmqConsumptionModelValues {
/** Clustering consumption model. */
public static final String CLUSTERING = "clustering";
/** Broadcasting consumption model. */
public static final String BROADCASTING = "broadcasting";
private MessagingRocketmqConsumptionModelValues() {}
}
public static final class RpcGrpcStatusCodeValues {
/** OK. */
public static final long OK = 0;
@ -1172,5 +1228,24 @@ public final class SemanticAttributes {
*/
public static final String EXCEPTION_EVENT_NAME = "exception";
/**
* The name of the keyspace being accessed.
*
* @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use
* {@link SemanticAttributes#DB_NAME} instead.
*/
@Deprecated
public static final AttributeKey<String> DB_CASSANDRA_KEYSPACE =
stringKey("db.cassandra.keyspace");
/**
* The <a href="https://hbase.apache.org/book.html#_namespace">HBase namespace</a> being accessed.
*
* @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use
* {@link SemanticAttributes#DB_NAME} instead.
*/
@Deprecated
public static final AttributeKey<String> DB_HBASE_NAMESPACE = stringKey("db.hbase.namespace");
private SemanticAttributes() {}
}