Update the semantic convention classes for spec v1.3.0 (#3202)

This commit is contained in:
John Watson 2021-05-05 18:25:28 -07:00 committed by GitHub
parent cc4720de13
commit aba088b135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 60 deletions

View File

@ -4,7 +4,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../" ROOT_DIR="${SCRIPT_DIR}/../../"
# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
SPEC_VERSION=v1.2.0 SPEC_VERSION=v1.3.0
GENERATOR_VERSION=0.3.1 GENERATOR_VERSION=0.3.1
cd ${SCRIPT_DIR} cd ${SCRIPT_DIR}

View File

@ -82,7 +82,7 @@ public final class OsResource {
} else if (os.startsWith("solaris")) { } else if (os.startsWith("solaris")) {
return ResourceAttributes.OsTypeValues.SOLARIS; return ResourceAttributes.OsTypeValues.SOLARIS;
} else if (os.startsWith("z/os")) { } else if (os.startsWith("z/os")) {
return ResourceAttributes.OsTypeValues.ZOS; return ResourceAttributes.OsTypeValues.Z_OS;
} }
return null; return null;
} }

View File

@ -22,7 +22,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "Linux 4.11") @SetSystemProperty(key = "os.name", value = "Linux 4.11")
void linux() { void linux() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("LINUX"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.LINUX);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -30,7 +31,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "MacOS X 11") @SetSystemProperty(key = "os.name", value = "MacOS X 11")
void macos() { void macos() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("DARWIN"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.DARWIN);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -38,7 +40,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "Windows 10") @SetSystemProperty(key = "os.name", value = "Windows 10")
void windows() { void windows() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("WINDOWS"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.WINDOWS);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -46,7 +49,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "FreeBSD 10") @SetSystemProperty(key = "os.name", value = "FreeBSD 10")
void freebsd() { void freebsd() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("FREEBSD"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.FREEBSD);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -54,7 +58,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "NetBSD 10") @SetSystemProperty(key = "os.name", value = "NetBSD 10")
void netbsd() { void netbsd() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("NETBSD"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.NETBSD);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -62,7 +67,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "OpenBSD 10") @SetSystemProperty(key = "os.name", value = "OpenBSD 10")
void openbsd() { void openbsd() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("OPENBSD"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.OPENBSD);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -70,7 +76,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "DragonFlyBSD 10") @SetSystemProperty(key = "os.name", value = "DragonFlyBSD 10")
void dragonflybsd() { void dragonflybsd() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("DRAGONFLYBSD"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.DRAGONFLYBSD);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -78,7 +85,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "HP-UX 10") @SetSystemProperty(key = "os.name", value = "HP-UX 10")
void hpux() { void hpux() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("HPUX"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.HPUX);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -86,7 +94,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "AIX 10") @SetSystemProperty(key = "os.name", value = "AIX 10")
void aix() { void aix() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("AIX"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.AIX);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -94,7 +103,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "Solaris 10") @SetSystemProperty(key = "os.name", value = "Solaris 10")
void solaris() { void solaris() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("SOLARIS"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.SOLARIS);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }
@ -102,7 +112,8 @@ class OsResourceTest {
@SetSystemProperty(key = "os.name", value = "Z/OS 10") @SetSystemProperty(key = "os.name", value = "Z/OS 10")
void zos() { void zos() {
Attributes attributes = OsResource.buildResource().getAttributes(); Attributes attributes = OsResource.buildResource().getAttributes();
assertThat(attributes.get(ResourceAttributes.OS_TYPE)).isEqualTo("ZOS"); assertThat(attributes.get(ResourceAttributes.OS_TYPE))
.isEqualTo(ResourceAttributes.OsTypeValues.Z_OS);
assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty(); assertThat(attributes.get(ResourceAttributes.OS_DESCRIPTION)).isNotEmpty();
} }

View File

@ -416,27 +416,27 @@ public final class ResourceAttributes {
/** AWS Lambda. */ /** AWS Lambda. */
public static final String AWS_LAMBDA = "aws_lambda"; public static final String AWS_LAMBDA = "aws_lambda";
/** AWS Elastic Beanstalk. */ /** AWS Elastic Beanstalk. */
public static final String AWS_ELASTICBEANSTALK = "aws_elastic_beanstalk"; public static final String AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk";
/** Azure Virtual Machines. */ /** Azure Virtual Machines. */
public static final String AZURE_VM = "azure_vm"; public static final String AZURE_VM = "azure_vm";
/** Azure Container Instances. */ /** Azure Container Instances. */
public static final String AZURE_CONTAINERINSTANCES = "azure_container_instances"; public static final String AZURE_CONTAINER_INSTANCES = "azure_container_instances";
/** Azure Kubernetes Service. */ /** Azure Kubernetes Service. */
public static final String AZURE_AKS = "azure_aks"; public static final String AZURE_AKS = "azure_aks";
/** Azure Functions. */ /** Azure Functions. */
public static final String AZURE_FUNCTIONS = "azure_functions"; public static final String AZURE_FUNCTIONS = "azure_functions";
/** Azure App Service. */ /** Azure App Service. */
public static final String AZURE_APPSERVICE = "azure_app_service"; public static final String AZURE_APP_SERVICE = "azure_app_service";
/** Google Cloud Compute Engine (GCE). */ /** Google Cloud Compute Engine (GCE). */
public static final String GCP_COMPUTEENGINE = "gcp_compute_engine"; public static final String GCP_COMPUTE_ENGINE = "gcp_compute_engine";
/** Google Cloud Run. */ /** Google Cloud Run. */
public static final String GCP_CLOUDRUN = "gcp_cloud_run"; public static final String GCP_CLOUD_RUN = "gcp_cloud_run";
/** Google Cloud Kubernetes Engine (GKE). */ /** Google Cloud Kubernetes Engine (GKE). */
public static final String GCP_KUBERNETESENGINE = "gcp_kubernetes_engine"; public static final String GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine";
/** Google Cloud Functions (GCF). */ /** Google Cloud Functions (GCF). */
public static final String GCP_CLOUDFUNCTIONS = "gcp_cloud_functions"; public static final String GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions";
/** Google Cloud App Engine (GAE). */ /** Google Cloud App Engine (GAE). */
public static final String GCP_APPENGINE = "gcp_app_engine"; public static final String GCP_APP_ENGINE = "gcp_app_engine";
private CloudPlatformValues() {} private CloudPlatformValues() {}
} }
@ -471,27 +471,27 @@ public final class ResourceAttributes {
public static final class OsTypeValues { public static final class OsTypeValues {
/** Microsoft Windows. */ /** Microsoft Windows. */
public static final String WINDOWS = "WINDOWS"; public static final String WINDOWS = "windows";
/** Linux. */ /** Linux. */
public static final String LINUX = "LINUX"; public static final String LINUX = "linux";
/** Apple Darwin. */ /** Apple Darwin. */
public static final String DARWIN = "DARWIN"; public static final String DARWIN = "darwin";
/** FreeBSD. */ /** FreeBSD. */
public static final String FREEBSD = "FREEBSD"; public static final String FREEBSD = "freebsd";
/** NetBSD. */ /** NetBSD. */
public static final String NETBSD = "NETBSD"; public static final String NETBSD = "netbsd";
/** OpenBSD. */ /** OpenBSD. */
public static final String OPENBSD = "OPENBSD"; public static final String OPENBSD = "openbsd";
/** DragonFly BSD. */ /** DragonFly BSD. */
public static final String DRAGONFLYBSD = "DRAGONFLYBSD"; public static final String DRAGONFLYBSD = "dragonflybsd";
/** HP-UX (Hewlett Packard Unix). */ /** HP-UX (Hewlett Packard Unix). */
public static final String HPUX = "HPUX"; public static final String HPUX = "hpux";
/** AIX (Advanced Interactive eXecutive). */ /** AIX (Advanced Interactive eXecutive). */
public static final String AIX = "AIX"; public static final String AIX = "aix";
/** Oracle Solaris. */ /** Oracle Solaris. */
public static final String SOLARIS = "SOLARIS"; public static final String SOLARIS = "solaris";
/** IBM z/OS. */ /** IBM z/OS. */
public static final String ZOS = "ZOS"; public static final String Z_OS = "z_os";
private OsTypeValues() {} private OsTypeValues() {}
} }

View File

@ -588,6 +588,10 @@ public final class SemanticAttributes {
*/ */
public static final AttributeKey<String> MESSAGING_OPERATION = stringKey("messaging.operation"); public static final AttributeKey<String> MESSAGING_OPERATION = stringKey("messaging.operation");
/** RabbitMQ message routing key. */
public static final AttributeKey<String> MESSAGING_RABBITMQ_ROUTING_KEY =
stringKey("messaging.rabbitmq.routing_key");
/** /**
* Message keys in Kafka are used for grouping alike messages to ensure they&#39;re processed on * Message keys in Kafka are used for grouping alike messages to ensure they&#39;re processed on
* the same partition. They differ from `messaging.message_id` in that they&#39;re not unique. If * the same partition. They differ from `messaging.message_id` in that they&#39;re not unique. If
@ -731,28 +735,28 @@ public final class SemanticAttributes {
} }
public static final class DbCassandraConsistencyLevelValues { public static final class DbCassandraConsistencyLevelValues {
/** ALL. */ /** all. */
public static final String ALL = "ALL"; public static final String ALL = "all";
/** EACH_QUORUM. */ /** each_quorum. */
public static final String EACH_QUORUM = "EACH_QUORUM"; public static final String EACH_QUORUM = "each_quorum";
/** QUORUM. */ /** quorum. */
public static final String QUORUM = "QUORUM"; public static final String QUORUM = "quorum";
/** LOCAL_QUORUM. */ /** local_quorum. */
public static final String LOCAL_QUORUM = "LOCAL_QUORUM"; public static final String LOCAL_QUORUM = "local_quorum";
/** ONE. */ /** one. */
public static final String ONE = "ONE"; public static final String ONE = "one";
/** TWO. */ /** two. */
public static final String TWO = "TWO"; public static final String TWO = "two";
/** THREE. */ /** three. */
public static final String THREE = "THREE"; public static final String THREE = "three";
/** LOCAL_ONE. */ /** local_one. */
public static final String LOCAL_ONE = "LOCAL_ONE"; public static final String LOCAL_ONE = "local_one";
/** ANY. */ /** any. */
public static final String ANY = "ANY"; public static final String ANY = "any";
/** SERIAL. */ /** serial. */
public static final String SERIAL = "SERIAL"; public static final String SERIAL = "serial";
/** LOCAL_SERIAL. */ /** local_serial. */
public static final String LOCAL_SERIAL = "LOCAL_SERIAL"; public static final String LOCAL_SERIAL = "local_serial";
private DbCassandraConsistencyLevelValues() {} private DbCassandraConsistencyLevelValues() {}
} }
@ -795,14 +799,14 @@ public final class SemanticAttributes {
} }
public static final class NetTransportValues { public static final class NetTransportValues {
/** IP.TCP. */ /** ip_tcp. */
public static final String IP_TCP = "IP.TCP"; public static final String IP_TCP = "ip_tcp";
/** IP.UDP. */ /** ip_udp. */
public static final String IP_UDP = "IP.UDP"; public static final String IP_UDP = "ip_udp";
/** Another IP-based protocol. */ /** Another IP-based protocol. */
public static final String IP = "IP"; public static final String IP = "ip";
/** Unix Domain socket. See below. */ /** Unix Domain socket. See below. */
public static final String UNIX = "Unix"; public static final String UNIX = "unix";
/** Named or anonymous pipe. See note below. */ /** Named or anonymous pipe. See note below. */
public static final String PIPE = "pipe"; public static final String PIPE = "pipe";
/** In-process communication. */ /** In-process communication. */