diff --git a/build.gradle.kts b/build.gradle.kts index d5b04c3..3016b7d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,8 +11,11 @@ val snapshot = true // end // The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes -var semanticConventionsVersion = "1.23.1" -val schemaUrlVersions = listOf(semanticConventionsVersion, "1.22.0") +var semanticConventionsVersion = "1.24.0" +val schemaUrlVersions = listOf( + semanticConventionsVersion, + "1.23.1", + "1.22.0") // Compute the artifact version, which includes the "-alpha" suffix and includes "-SNAPSHOT" suffix if not releasing // Release example: version=1.21.0-alpha @@ -48,8 +51,6 @@ nexusPublishing { } // start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions -// Using image built from feature branch: https://github.com/open-telemetry/build-tools/tree/feature/codegen-by-namespace -// TODO: upgrade to official release when features are incorporated into main var generatorVersion = "0.24.0" val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip" val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion" @@ -99,7 +100,7 @@ fun generateTask(taskName: String, incubating: Boolean) { "--output", "/output/{{pascal_prefix}}${classPrefix}Attributes.java", "--file-per-group", "root_namespace", // Space delimited list of root namespaces to excluded (i.e. "foo bar") - "-Dexcluded_namespaces=\"ios\"", + "-Dexcluded_namespaces=\"ios aspnetcore signalr\"", "-Dfilter=${filter}", "-DclassPrefix=${classPrefix}", "-Dpkg=$packageNameArg", diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/CodeIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/CodeIncubatingAttributes.java index 1347997..fb8d6da 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/CodeIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/CodeIncubatingAttributes.java @@ -45,5 +45,11 @@ public final class CodeIncubatingAttributes { */ public static final AttributeKey CODE_NAMESPACE = stringKey("code.namespace"); + /** + * 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. + */ + public static final AttributeKey CODE_STACKTRACE = stringKey("code.stacktrace"); + private CodeIncubatingAttributes() {} } diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DbIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DbIncubatingAttributes.java index e2b2c23..cecba43 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DbIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DbIncubatingAttributes.java @@ -49,8 +49,8 @@ public final class DbIncubatingAttributes { longKey("db.cassandra.speculative_execution_count"); /** - * The name of the primary table that the operation is acting upon, including the keyspace name - * (if applicable). + * The name of the primary Cassandra table that the operation is acting upon, including the + * keyspace name (if applicable). * *

Notes: * @@ -128,6 +128,15 @@ public final class DbIncubatingAttributes { public static final AttributeKeyTemplate DB_ELASTICSEARCH_PATH_PARTS = stringKeyTemplate("db.elasticsearch.path_parts"); + /** + * An identifier (address, unique name, or any other identifier) of the database instance that is + * executing queries or mutations on the current connection. This is useful in cases where the + * database is running in a clustered environment and the instrumentation is able to record the + * node executing the query. The client may obtain this value in databases like MySQL using + * queries like {@code select @@hostname}. + */ + public static final AttributeKey DB_INSTANCE_ID = stringKey("db.instance.id"); + /** * The fully-qualified class name of the Java Database Connectivity @@ -136,7 +145,7 @@ public final class DbIncubatingAttributes { public static final AttributeKey DB_JDBC_DRIVER_CLASSNAME = stringKey("db.jdbc.driver_classname"); - /** The collection being accessed within the database stated in {@code db.name}. */ + /** The MongoDB collection being accessed within the database stated in {@code db.name}. */ public static final AttributeKey DB_MONGODB_COLLECTION = stringKey("db.mongodb.collection"); diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeploymentIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeploymentIncubatingAttributes.java index 9dae6bc..d30b8a4 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeploymentIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeploymentIncubatingAttributes.java @@ -17,6 +17,17 @@ public final class DeploymentIncubatingAttributes { /** * Name of the deployment * environment (aka deployment tier). + * + *

Notes: + * + *

*/ public static final AttributeKey DEPLOYMENT_ENVIRONMENT = stringKey("deployment.environment"); diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeviceIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeviceIncubatingAttributes.java index f0f235d..3718a51 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeviceIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeviceIncubatingAttributes.java @@ -54,7 +54,7 @@ public final class DeviceIncubatingAttributes { *

Notes: * *

    - *
  • It's recommended this value represents a machine readable version of the model identifier + *
  • 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. *
*/ @@ -67,8 +67,8 @@ public final class DeviceIncubatingAttributes { *

Notes: * *

    - *
  • It's recommended this value represents a human readable version of the device model - * rather than a machine readable alternative. + *
  • It's recommended this value represents a human-readable version of the device model + * rather than a machine-readable alternative. *
*/ public static final AttributeKey DEVICE_MODEL_NAME = stringKey("device.model.name"); diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DiskIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DiskIncubatingAttributes.java new file mode 100644 index 0000000..fc49fd4 --- /dev/null +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DiskIncubatingAttributes.java @@ -0,0 +1,33 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class DiskIncubatingAttributes { + + /** The disk IO operation direction. */ + public static final AttributeKey DISK_IO_DIRECTION = stringKey("disk.io.direction"); + + // Enum definitions + /** Values for {@link #DISK_IO_DIRECTION}. */ + public static final class DiskIoDirectionValues { + /** read. */ + public static final String READ = "read"; + + /** write. */ + public static final String WRITE = "write"; + + private DiskIoDirectionValues() {} + } + + private DiskIncubatingAttributes() {} +} diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DnsIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DnsIncubatingAttributes.java new file mode 100644 index 0000000..92f7e62 --- /dev/null +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DnsIncubatingAttributes.java @@ -0,0 +1,32 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class DnsIncubatingAttributes { + + /** + * The name being queried. + * + *

Notes: + * + *

    + *
  • The name being queried. If the name field contains non-printable characters (below 32 or + * above 126), those characters should be represented as escaped base 10 integers (\DDD). + * Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should + * be converted to \t, \r, and \n respectively. + *
+ */ + public static final AttributeKey DNS_QUESTION_NAME = stringKey("dns.question.name"); + + private DnsIncubatingAttributes() {} +} diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/EventIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/EventIncubatingAttributes.java index 104b08b..93cb128 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/EventIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/EventIncubatingAttributes.java @@ -15,34 +15,19 @@ public final class EventIncubatingAttributes { /** - * The domain identifies the business context for the events. + * Identifies the class / type of event. * *

Notes: * *

    - *
  • Events across different domains may have same {@code event.name}, yet be unrelated - * events. + *
  • Event names are subject to the same rules as attribute + * names. Notably, event names are namespaced to avoid collisions and provide a clean + * separation of semantics for events in separate domains like browser, mobile, and + * kubernetes. *
*/ - public static final AttributeKey EVENT_DOMAIN = stringKey("event.domain"); - - /** The name identifies the event. */ public static final AttributeKey EVENT_NAME = stringKey("event.name"); - // Enum definitions - /** Values for {@link #EVENT_DOMAIN}. */ - public static final class EventDomainValues { - /** Events from browser apps. */ - public static final String BROWSER = "browser"; - - /** Events from mobile apps. */ - public static final String DEVICE = "device"; - - /** Events from Kubernetes. */ - public static final String K8S = "k8s"; - - private EventDomainValues() {} - } - private EventIncubatingAttributes() {} } diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java index bf08afa..96f6693 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java @@ -30,7 +30,7 @@ public final class ExceptionIncubatingAttributes { *
  • 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. + * example for recording span exceptions. *
  • It follows that an exception may still escape the scope of the span even if the {@code * 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. diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HostIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HostIncubatingAttributes.java index 302d07b..8be0f7c 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HostIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HostIncubatingAttributes.java @@ -23,14 +23,14 @@ public final class HostIncubatingAttributes { /** The amount of level 2 memory cache available to the processor (in Bytes). */ public static final AttributeKey HOST_CPU_CACHE_L2_SIZE = longKey("host.cpu.cache.l2.size"); - /** Numeric value specifying the family or generation of the CPU. */ - public static final AttributeKey HOST_CPU_FAMILY = longKey("host.cpu.family"); + /** Family or generation of the CPU. */ + public static final AttributeKey HOST_CPU_FAMILY = stringKey("host.cpu.family"); /** * Model identifier. It provides more granular information about the CPU, distinguishing it from * other CPUs within the same family. */ - public static final AttributeKey HOST_CPU_MODEL_ID = longKey("host.cpu.model.id"); + public static final AttributeKey HOST_CPU_MODEL_ID = stringKey("host.cpu.model.id"); /** Model designation of the processor. */ public static final AttributeKey HOST_CPU_MODEL_NAME = stringKey("host.cpu.model.name"); @@ -66,7 +66,7 @@ public final class HostIncubatingAttributes { /** * The version string of the VM image or host OS as defined in Version Attributes. + * href="/docs/resource/README.md#version-attributes">Version Attributes. */ public static final AttributeKey HOST_IMAGE_VERSION = stringKey("host.image.version"); diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HttpIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HttpIncubatingAttributes.java index 073c71d..7305bdb 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HttpIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HttpIncubatingAttributes.java @@ -18,8 +18,23 @@ @SuppressWarnings("unused") public final class HttpIncubatingAttributes { - /** Deprecated, use {@code http.request.method} instead. */ - public static final AttributeKey HTTP_METHOD = stringKey("http.method"); + /** State of the HTTP connection in the HTTP connection pool. */ + public static final AttributeKey HTTP_CONNECTION_STATE = + stringKey("http.connection.state"); + + /** + * Deprecated, use {@code network.protocol.name} instead. + * + * @deprecated Deprecated, use `network.protocol.name` instead. + */ + @Deprecated public static final AttributeKey HTTP_FLAVOR = stringKey("http.flavor"); + + /** + * Deprecated, use {@code http.request.method} instead. + * + * @deprecated Deprecated, use `http.request.method` instead. + */ + @Deprecated public static final AttributeKey HTTP_METHOD = stringKey("http.method"); /** * The size of the request payload body in bytes. This is the number of bytes transferred @@ -112,7 +127,12 @@ public final class HttpIncubatingAttributes { public static final AttributeKey HTTP_REQUEST_RESEND_COUNT = longKey("http.request.resend_count"); - /** Deprecated, use {@code http.request.header.content-length} instead. */ + /** + * Deprecated, use {@code http.request.header.content-length} instead. + * + * @deprecated Deprecated, use `http.request.header.content-length` instead. + */ + @Deprecated public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH = longKey("http.request_content_length"); @@ -158,7 +178,12 @@ public final class HttpIncubatingAttributes { public static final AttributeKey HTTP_RESPONSE_STATUS_CODE = longKey("http.response.status_code"); - /** Deprecated, use {@code http.response.header.content-length} instead. */ + /** + * Deprecated, use {@code http.response.header.content-length} instead. + * + * @deprecated Deprecated, use `http.response.header.content-length` instead. + */ + @Deprecated public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH = longKey("http.response_content_length"); @@ -180,19 +205,82 @@ public final class HttpIncubatingAttributes { */ @Deprecated public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); - /** Deprecated, use {@code url.scheme} instead. */ - public static final AttributeKey HTTP_SCHEME = stringKey("http.scheme"); + /** + * Deprecated, use {@code url.scheme} instead. + * + * @deprecated Deprecated, use `url.scheme` instead. + */ + @Deprecated public static final AttributeKey HTTP_SCHEME = stringKey("http.scheme"); - /** Deprecated, use {@code http.response.status_code} instead. */ - public static final AttributeKey HTTP_STATUS_CODE = longKey("http.status_code"); + /** + * Deprecated, use {@code http.response.status_code} instead. + * + * @deprecated Deprecated, use `http.response.status_code` instead. + */ + @Deprecated public static final AttributeKey HTTP_STATUS_CODE = longKey("http.status_code"); - /** Deprecated, use {@code url.path} and {@code url.query} instead. */ - public static final AttributeKey HTTP_TARGET = stringKey("http.target"); + /** + * Deprecated, use {@code url.path} and {@code url.query} instead. + * + * @deprecated Deprecated, use `url.path` and `url.query` instead. + */ + @Deprecated public static final AttributeKey HTTP_TARGET = stringKey("http.target"); - /** Deprecated, use {@code url.full} instead. */ - public static final AttributeKey HTTP_URL = stringKey("http.url"); + /** + * Deprecated, use {@code url.full} instead. + * + * @deprecated Deprecated, use `url.full` instead. + */ + @Deprecated public static final AttributeKey HTTP_URL = stringKey("http.url"); + + /** + * Deprecated, use {@code user_agent.original} instead. + * + * @deprecated Deprecated, use `user_agent.original` instead. + */ + @Deprecated + public static final AttributeKey HTTP_USER_AGENT = stringKey("http.user_agent"); // Enum definitions + /** Values for {@link #HTTP_CONNECTION_STATE}. */ + public static final class HttpConnectionStateValues { + /** active state. */ + public static final String ACTIVE = "active"; + + /** idle state. */ + public static final String IDLE = "idle"; + + private HttpConnectionStateValues() {} + } + + /** + * Values for {@link #HTTP_FLAVOR}. + * + * @deprecated Deprecated, use `network.protocol.name` instead. + */ + @Deprecated + public static final class HttpFlavorValues { + /** HTTP/1.0. */ + public static final String HTTP_1_0 = "1.0"; + + /** HTTP/1.1. */ + public static final String HTTP_1_1 = "1.1"; + + /** HTTP/2. */ + public static final String HTTP_2_0 = "2.0"; + + /** HTTP/3. */ + public static final String HTTP_3_0 = "3.0"; + + /** SPDY protocol. */ + public static final String SPDY = "SPDY"; + + /** QUIC protocol. */ + public static final String QUIC = "QUIC"; + + private HttpFlavorValues() {} + } + /** * Values for {@link #HTTP_REQUEST_METHOD}. * diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/JvmIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/JvmIncubatingAttributes.java index 1f370ae..b42d5f2 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/JvmIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/JvmIncubatingAttributes.java @@ -36,8 +36,11 @@ public final class JvmIncubatingAttributes { *
  • Garbage collector action is generally obtained via GarbageCollectionNotificationInfo#getGcAction(). * + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes#JVM_GC_ACTION} attribute. */ - public static final AttributeKey JVM_GC_ACTION = stringKey("jvm.gc.action"); + @Deprecated public static final AttributeKey JVM_GC_ACTION = stringKey("jvm.gc.action"); /** * Name of the garbage collector. @@ -48,8 +51,11 @@ public final class JvmIncubatingAttributes { *
  • Garbage collector name is generally obtained via GarbageCollectionNotificationInfo#getGcName(). * + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes#JVM_GC_NAME} attribute. */ - public static final AttributeKey JVM_GC_NAME = stringKey("jvm.gc.name"); + @Deprecated public static final AttributeKey JVM_GC_NAME = stringKey("jvm.gc.name"); /** * Name of the memory pool. @@ -60,20 +66,48 @@ public final class JvmIncubatingAttributes { *
  • Pool names are generally obtained via MemoryPoolMXBean#getName(). * + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes#JVM_MEMORY_POOL_NAME} attribute. */ + @Deprecated public static final AttributeKey JVM_MEMORY_POOL_NAME = stringKey("jvm.memory.pool.name"); - /** The type of memory. */ + /** + * The type of memory. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes#JVM_MEMORY_TYPE} attribute. + */ + @Deprecated public static final AttributeKey JVM_MEMORY_TYPE = stringKey("jvm.memory.type"); - /** Whether the thread is daemon or not. */ + /** + * Whether the thread is daemon or not. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes#JVM_THREAD_DAEMON} attribute. + */ + @Deprecated public static final AttributeKey JVM_THREAD_DAEMON = booleanKey("jvm.thread.daemon"); - /** State of the thread. */ + /** + * State of the thread. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes#JVM_THREAD_STATE} attribute. + */ + @Deprecated public static final AttributeKey JVM_THREAD_STATE = stringKey("jvm.thread.state"); // Enum definitions - /** Values for {@link #JVM_MEMORY_TYPE}. */ + /** + * Values for {@link #JVM_MEMORY_TYPE}. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes.JvmMemoryTypeValues} attribute. + */ + @Deprecated public static final class JvmMemoryTypeValues { /** Heap memory. */ public static final String HEAP = "heap"; @@ -84,7 +118,13 @@ public static final class JvmMemoryTypeValues { private JvmMemoryTypeValues() {} } - /** Values for {@link #JVM_THREAD_STATE}. */ + /** + * Values for {@link #JVM_THREAD_STATE}. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.JvmAttributes.JvmThreadStateValues} attribute. + */ + @Deprecated public static final class JvmThreadStateValues { /** A thread that has not yet started is in this state. */ public static final String NEW = "new"; diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/K8sIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/K8sIncubatingAttributes.java index f551d0b..52c67a8 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/K8sIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/K8sIncubatingAttributes.java @@ -7,8 +7,10 @@ import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; +import static io.opentelemetry.semconv.AttributeKeyTemplate.stringKeyTemplate; import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.semconv.AttributeKeyTemplate; // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/SemanticAttributes.java.j2 @@ -89,6 +91,20 @@ public final class K8sIncubatingAttributes { /** The UID of the Node. */ public static final AttributeKey K8S_NODE_UID = stringKey("k8s.node.uid"); + /** + * The annotation key-value pairs placed on the Pod, the {@code } being the annotation name, + * the value being the annotation value. + */ + public static final AttributeKeyTemplate K8S_POD_ANNOTATION = + stringKeyTemplate("k8s.pod.annotation"); + + /** + * The labels placed on the Pod, the {@code } being the label name, the value being the label + * value. + */ + public static final AttributeKeyTemplate K8S_POD_LABELS = + stringKeyTemplate("k8s.pod.labels"); + /** The name of the Pod. */ public static final AttributeKey K8S_POD_NAME = stringKey("k8s.pod.name"); diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/MessagingIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/MessagingIncubatingAttributes.java index ea0531c..b0c13d4 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/MessagingIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/MessagingIncubatingAttributes.java @@ -101,6 +101,13 @@ public final class MessagingIncubatingAttributes { public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_NAME = stringKey("messaging.destination_publish.name"); + /** + * The ordering key for a given message. If the attribute is not present, the message does not + * have an ordering key. + */ + public static final AttributeKey MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = + stringKey("messaging.gcp_pubsub.message.ordering_key"); + /** * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not * producers. @@ -232,7 +239,10 @@ public final class MessagingIncubatingAttributes { public static final AttributeKey MESSAGING_ROCKETMQ_NAMESPACE = stringKey("messaging.rocketmq.namespace"); - /** A string identifying the messaging system. */ + /** + * An identifier for the messaging system being used. See below for a list of well-known + * identifiers. + */ public static final AttributeKey MESSAGING_SYSTEM = stringKey("messaging.system"); // Enum definitions @@ -294,5 +304,40 @@ public static final class MessagingRocketmqMessageTypeValues { private MessagingRocketmqMessageTypeValues() {} } + /** Values for {@link #MESSAGING_SYSTEM}. */ + public static final class MessagingSystemValues { + /** Apache ActiveMQ. */ + public static final String ACTIVEMQ = "activemq"; + + /** Amazon Simple Queue Service (SQS). */ + public static final String AWS_SQS = "aws_sqs"; + + /** Azure Event Grid. */ + public static final String AZURE_EVENTGRID = "azure_eventgrid"; + + /** Azure Event Hubs. */ + public static final String AZURE_EVENTHUBS = "azure_eventhubs"; + + /** Azure Service Bus. */ + public static final String AZURE_SERVICEBUS = "azure_servicebus"; + + /** Google Cloud Pub/Sub. */ + public static final String GCP_PUBSUB = "gcp_pubsub"; + + /** Java Message Service. */ + public static final String JMS = "jms"; + + /** Apache Kafka. */ + public static final String KAFKA = "kafka"; + + /** RabbitMQ. */ + public static final String RABBITMQ = "rabbitmq"; + + /** Apache RocketMQ. */ + public static final String ROCKETMQ = "rocketmq"; + + private MessagingSystemValues() {} + } + private MessagingIncubatingAttributes() {} } diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetIncubatingAttributes.java index aa9240d..dacd566 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetIncubatingAttributes.java @@ -15,52 +15,114 @@ @SuppressWarnings("unused") public final class NetIncubatingAttributes { - /** Deprecated, use {@code server.address}. */ - public static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); + /** + * Deprecated, use {@code server.address}. + * + * @deprecated Deprecated, use `server.address`. + */ + @Deprecated public static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); - /** Deprecated, use {@code server.port}. */ - public static final AttributeKey NET_HOST_PORT = longKey("net.host.port"); + /** + * Deprecated, use {@code server.port}. + * + * @deprecated Deprecated, use `server.port`. + */ + @Deprecated public static final AttributeKey NET_HOST_PORT = longKey("net.host.port"); /** * Deprecated, use {@code server.address} on client spans and {@code client.address} on server * spans. + * + * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server + * spans. */ - public static final AttributeKey NET_PEER_NAME = stringKey("net.peer.name"); + @Deprecated public static final AttributeKey NET_PEER_NAME = stringKey("net.peer.name"); /** * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans. + * + * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans. */ - public static final AttributeKey NET_PEER_PORT = longKey("net.peer.port"); + @Deprecated public static final AttributeKey NET_PEER_PORT = longKey("net.peer.port"); - /** Deprecated, use {@code network.protocol.name}. */ + /** + * Deprecated, use {@code network.protocol.name}. + * + * @deprecated Deprecated, use `network.protocol.name`. + */ + @Deprecated public static final AttributeKey NET_PROTOCOL_NAME = stringKey("net.protocol.name"); - /** Deprecated, use {@code network.protocol.version}. */ + /** + * Deprecated, use {@code network.protocol.version}. + * + * @deprecated Deprecated, use `network.protocol.version`. + */ + @Deprecated public static final AttributeKey NET_PROTOCOL_VERSION = stringKey("net.protocol.version"); - /** Deprecated, use {@code network.transport} and {@code network.type}. */ + /** + * Deprecated, use {@code network.transport} and {@code network.type}. + * + * @deprecated Deprecated, use `network.transport` and `network.type`. + */ + @Deprecated public static final AttributeKey NET_SOCK_FAMILY = stringKey("net.sock.family"); - /** Deprecated, use {@code network.local.address}. */ + /** + * Deprecated, use {@code network.local.address}. + * + * @deprecated Deprecated, use `network.local.address`. + */ + @Deprecated public static final AttributeKey NET_SOCK_HOST_ADDR = stringKey("net.sock.host.addr"); - /** Deprecated, use {@code network.local.port}. */ + /** + * Deprecated, use {@code network.local.port}. + * + * @deprecated Deprecated, use `network.local.port`. + */ + @Deprecated public static final AttributeKey NET_SOCK_HOST_PORT = longKey("net.sock.host.port"); - /** Deprecated, use {@code network.peer.address}. */ + /** + * Deprecated, use {@code network.peer.address}. + * + * @deprecated Deprecated, use `network.peer.address`. + */ + @Deprecated public static final AttributeKey NET_SOCK_PEER_ADDR = stringKey("net.sock.peer.addr"); - /** Deprecated, no replacement at this time. */ + /** + * Deprecated, no replacement at this time. + * + * @deprecated Deprecated, no replacement at this time. + */ + @Deprecated public static final AttributeKey NET_SOCK_PEER_NAME = stringKey("net.sock.peer.name"); - /** Deprecated, use {@code network.peer.port}. */ + /** + * Deprecated, use {@code network.peer.port}. + * + * @deprecated Deprecated, use `network.peer.port`. + */ + @Deprecated public static final AttributeKey NET_SOCK_PEER_PORT = longKey("net.sock.peer.port"); - /** Deprecated, use {@code network.transport}. */ - public static final AttributeKey NET_TRANSPORT = stringKey("net.transport"); + /** + * Deprecated, use {@code network.transport}. + * + * @deprecated Deprecated, use `network.transport`. + */ + @Deprecated public static final AttributeKey NET_TRANSPORT = stringKey("net.transport"); // Enum definitions - /** Values for {@link #NET_SOCK_FAMILY}. */ + /** + * Values for {@link #NET_SOCK_FAMILY}. + * + * @deprecated Deprecated, use `network.transport` and `network.type`. + */ + @Deprecated public static final class NetSockFamilyValues { /** IPv4 address. */ public static final String INET = "inet"; @@ -74,7 +136,12 @@ public static final class NetSockFamilyValues { private NetSockFamilyValues() {} } - /** Values for {@link #NET_TRANSPORT}. */ + /** + * Values for {@link #NET_TRANSPORT}. + * + * @deprecated Deprecated, use `network.transport`. + */ + @Deprecated public static final class NetTransportValues { /** ip_tcp. */ public static final String IP_TCP = "ip_tcp"; diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetworkIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetworkIncubatingAttributes.java index 27967e1..910c03f 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetworkIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/NetworkIncubatingAttributes.java @@ -38,6 +38,9 @@ public final class NetworkIncubatingAttributes { public static final AttributeKey NETWORK_CONNECTION_TYPE = stringKey("network.connection.type"); + /** The network IO operation direction. */ + public static final AttributeKey NETWORK_IO_DIRECTION = stringKey("network.io.direction"); + /** * Local address of the network connection - IP address or Unix domain socket name. * @@ -233,6 +236,17 @@ public static final class NetworkConnectionTypeValues { private NetworkConnectionTypeValues() {} } + /** Values for {@link #NETWORK_IO_DIRECTION}. */ + public static final class NetworkIoDirectionValues { + /** transmit. */ + public static final String TRANSMIT = "transmit"; + + /** receive. */ + public static final String RECEIVE = "receive"; + + private NetworkIoDirectionValues() {} + } + /** * Values for {@link #NETWORK_TRANSPORT}. * diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ProcessIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ProcessIncubatingAttributes.java index 404e8cf..b00263c 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ProcessIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ProcessIncubatingAttributes.java @@ -59,7 +59,7 @@ public final class ProcessIncubatingAttributes { /** The username of the user that owns the process. */ public static final AttributeKey PROCESS_OWNER = stringKey("process.owner"); - /** Parent Process identifier (PID). */ + /** Parent Process identifier (PPID). */ public static final AttributeKey PROCESS_PARENT_PID = longKey("process.parent_pid"); /** Process identifier (PID). */ diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/SystemIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/SystemIncubatingAttributes.java index 38ce286..d75f41c 100644 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/SystemIncubatingAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/SystemIncubatingAttributes.java @@ -25,10 +25,6 @@ public final class SystemIncubatingAttributes { /** The device identifier */ public static final AttributeKey SYSTEM_DEVICE = stringKey("system.device"); - /** The disk operation direction */ - public static final AttributeKey SYSTEM_DISK_DIRECTION = - stringKey("system.disk.direction"); - /** The filesystem mode */ public static final AttributeKey SYSTEM_FILESYSTEM_MODE = stringKey("system.filesystem.mode"); @@ -48,10 +44,6 @@ public final class SystemIncubatingAttributes { /** The memory state */ public static final AttributeKey SYSTEM_MEMORY_STATE = stringKey("system.memory.state"); - /** */ - public static final AttributeKey SYSTEM_NETWORK_DIRECTION = - stringKey("system.network.direction"); - /** A stateless protocol MUST NOT set this attribute */ public static final AttributeKey SYSTEM_NETWORK_STATE = stringKey("system.network.state"); @@ -100,17 +92,6 @@ public static final class SystemCpuStateValues { private SystemCpuStateValues() {} } - /** Values for {@link #SYSTEM_DISK_DIRECTION}. */ - public static final class SystemDiskDirectionValues { - /** read. */ - public static final String READ = "read"; - - /** write. */ - public static final String WRITE = "write"; - - private SystemDiskDirectionValues() {} - } - /** Values for {@link #SYSTEM_FILESYSTEM_STATE}. */ public static final class SystemFilesystemStateValues { /** used. */ @@ -168,17 +149,6 @@ public static final class SystemMemoryStateValues { private SystemMemoryStateValues() {} } - /** Values for {@link #SYSTEM_NETWORK_DIRECTION}. */ - public static final class SystemNetworkDirectionValues { - /** transmit. */ - public static final String TRANSMIT = "transmit"; - - /** receive. */ - public static final String RECEIVE = "receive"; - - private SystemNetworkDirectionValues() {} - } - /** Values for {@link #SYSTEM_NETWORK_STATE}. */ public static final class SystemNetworkStateValues { /** close. */ diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/TlsIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/TlsIncubatingAttributes.java new file mode 100644 index 0000000..6bcc40c --- /dev/null +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/TlsIncubatingAttributes.java @@ -0,0 +1,209 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.booleanKey; +import static io.opentelemetry.api.common.AttributeKey.stringArrayKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; +import java.util.List; + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class TlsIncubatingAttributes { + + /** + * String indicating the cipher used during the + * current connection. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey TLS_CIPHER = stringKey("tls.cipher"); + + /** + * PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive + * of {@code client.certificate_chain} since this value also exists in that list. + */ + public static final AttributeKey TLS_CLIENT_CERTIFICATE = + stringKey("tls.client.certificate"); + + /** + * Array of PEM-encoded certificates that make up the certificate chain offered by the client. + * This is usually mutually-exclusive of {@code client.certificate} since that value should be the + * first certificate in the chain. + */ + public static final AttributeKey> TLS_CLIENT_CERTIFICATE_CHAIN = + stringArrayKey("tls.client.certificate_chain"); + + /** + * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by + * the client. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ + public static final AttributeKey TLS_CLIENT_HASH_MD5 = stringKey("tls.client.hash.md5"); + + /** + * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by + * the client. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ + public static final AttributeKey TLS_CLIENT_HASH_SHA1 = stringKey("tls.client.hash.sha1"); + + /** + * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered + * by the client. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ + public static final AttributeKey TLS_CLIENT_HASH_SHA256 = + stringKey("tls.client.hash.sha256"); + + /** + * Distinguished name of subject of the issuer + * of the x.509 certificate presented by the client. + */ + public static final AttributeKey TLS_CLIENT_ISSUER = stringKey("tls.client.issuer"); + + /** A hash that identifies clients based on how they perform an SSL/TLS handshake. */ + public static final AttributeKey TLS_CLIENT_JA3 = stringKey("tls.client.ja3"); + + /** Date/Time indicating when client certificate is no longer considered valid. */ + public static final AttributeKey TLS_CLIENT_NOT_AFTER = stringKey("tls.client.not_after"); + + /** Date/Time indicating when client certificate is first considered valid. */ + public static final AttributeKey TLS_CLIENT_NOT_BEFORE = + stringKey("tls.client.not_before"); + + /** + * Also called an SNI, this tells the server which hostname to which the client is attempting to + * connect to. + */ + public static final AttributeKey TLS_CLIENT_SERVER_NAME = + stringKey("tls.client.server_name"); + + /** Distinguished name of subject of the x.509 certificate presented by the client. */ + public static final AttributeKey TLS_CLIENT_SUBJECT = stringKey("tls.client.subject"); + + /** Array of ciphers offered by the client during the client hello. */ + public static final AttributeKey> TLS_CLIENT_SUPPORTED_CIPHERS = + stringArrayKey("tls.client.supported_ciphers"); + + /** String indicating the curve used for the given cipher, when applicable */ + public static final AttributeKey TLS_CURVE = stringKey("tls.curve"); + + /** + * Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted + * tunnel. + */ + public static final AttributeKey TLS_ESTABLISHED = booleanKey("tls.established"); + + /** + * String indicating the protocol being tunneled. Per the values in the IANA + * registry, this string should be lower case. + */ + public static final AttributeKey TLS_NEXT_PROTOCOL = stringKey("tls.next_protocol"); + + /** + * Normalized lowercase protocol name parsed from original string of the negotiated SSL/TLS + * protocol version + */ + public static final AttributeKey TLS_PROTOCOL_NAME = stringKey("tls.protocol.name"); + + /** + * Numeric part of the version parsed from the original string of the negotiated SSL/TLS + * protocol version + */ + public static final AttributeKey TLS_PROTOCOL_VERSION = stringKey("tls.protocol.version"); + + /** + * Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. + */ + public static final AttributeKey TLS_RESUMED = booleanKey("tls.resumed"); + + /** + * PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive + * of {@code server.certificate_chain} since this value also exists in that list. + */ + public static final AttributeKey TLS_SERVER_CERTIFICATE = + stringKey("tls.server.certificate"); + + /** + * Array of PEM-encoded certificates that make up the certificate chain offered by the server. + * This is usually mutually-exclusive of {@code server.certificate} since that value should be the + * first certificate in the chain. + */ + public static final AttributeKey> TLS_SERVER_CERTIFICATE_CHAIN = + stringArrayKey("tls.server.certificate_chain"); + + /** + * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by + * the server. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ + public static final AttributeKey TLS_SERVER_HASH_MD5 = stringKey("tls.server.hash.md5"); + + /** + * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by + * the server. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ + public static final AttributeKey TLS_SERVER_HASH_SHA1 = stringKey("tls.server.hash.sha1"); + + /** + * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered + * by the server. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ + public static final AttributeKey TLS_SERVER_HASH_SHA256 = + stringKey("tls.server.hash.sha256"); + + /** + * Distinguished name of subject of the issuer + * of the x.509 certificate presented by the client. + */ + public static final AttributeKey TLS_SERVER_ISSUER = stringKey("tls.server.issuer"); + + /** A hash that identifies servers based on how they perform an SSL/TLS handshake. */ + public static final AttributeKey TLS_SERVER_JA3S = stringKey("tls.server.ja3s"); + + /** Date/Time indicating when server certificate is no longer considered valid. */ + public static final AttributeKey TLS_SERVER_NOT_AFTER = stringKey("tls.server.not_after"); + + /** Date/Time indicating when server certificate is first considered valid. */ + public static final AttributeKey TLS_SERVER_NOT_BEFORE = + stringKey("tls.server.not_before"); + + /** Distinguished name of subject of the x.509 certificate presented by the server. */ + public static final AttributeKey TLS_SERVER_SUBJECT = stringKey("tls.server.subject"); + + // Enum definitions + /** Values for {@link #TLS_PROTOCOL_NAME}. */ + public static final class TlsProtocolNameValues { + /** ssl. */ + public static final String SSL = "ssl"; + + /** tls. */ + public static final String TLS = "tls"; + + private TlsProtocolNameValues() {} + } + + private TlsIncubatingAttributes() {} +} diff --git a/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java b/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java index 18c103a..ebf889d 100644 --- a/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java +++ b/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java @@ -26,6 +26,8 @@ void available() { isValidClass("io.opentelemetry.semconv.incubating.DeploymentIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.DestinationIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.DeviceIncubatingAttributes"); + isValidClass("io.opentelemetry.semconv.incubating.DiskIncubatingAttributes"); + isValidClass("io.opentelemetry.semconv.incubating.DnsIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.EnduserIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.EventIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.ExceptionIncubatingAttributes"); @@ -58,6 +60,7 @@ void available() { isValidClass("io.opentelemetry.semconv.incubating.SystemIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.ThreadIncubatingAttributes"); + isValidClass("io.opentelemetry.semconv.incubating.TlsIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.incubating.WebengineIncubatingAttributes"); isValidClass("io.opentelemetry.semconv.SchemaUrls"); } diff --git a/semconv/src/main/java/io/opentelemetry/semconv/JvmAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/JvmAttributes.java new file mode 100644 index 0000000..f9bc571 --- /dev/null +++ b/semconv/src/main/java/io/opentelemetry/semconv/JvmAttributes.java @@ -0,0 +1,105 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv; + +import static io.opentelemetry.api.common.AttributeKey.booleanKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class JvmAttributes { + + /** + * Name of the garbage collector action. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey JVM_GC_ACTION = stringKey("jvm.gc.action"); + + /** + * Name of the garbage collector. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey JVM_GC_NAME = stringKey("jvm.gc.name"); + + /** + * Name of the memory pool. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey JVM_MEMORY_POOL_NAME = stringKey("jvm.memory.pool.name"); + + /** The type of memory. */ + public static final AttributeKey JVM_MEMORY_TYPE = stringKey("jvm.memory.type"); + + /** Whether the thread is daemon or not. */ + public static final AttributeKey JVM_THREAD_DAEMON = booleanKey("jvm.thread.daemon"); + + /** State of the thread. */ + public static final AttributeKey JVM_THREAD_STATE = stringKey("jvm.thread.state"); + + // Enum definitions + /** Values for {@link #JVM_MEMORY_TYPE}. */ + public static final class JvmMemoryTypeValues { + /** Heap memory. */ + public static final String HEAP = "heap"; + + /** Non-heap memory. */ + public static final String NON_HEAP = "non_heap"; + + private JvmMemoryTypeValues() {} + } + + /** Values for {@link #JVM_THREAD_STATE}. */ + public static final class JvmThreadStateValues { + /** A thread that has not yet started is in this state. */ + public static final String NEW = "new"; + + /** A thread executing in the Java virtual machine is in this state. */ + public static final String RUNNABLE = "runnable"; + + /** A thread that is blocked waiting for a monitor lock is in this state. */ + public static final String BLOCKED = "blocked"; + + /** + * A thread that is waiting indefinitely for another thread to perform a particular action is in + * this state. + */ + public static final String WAITING = "waiting"; + + /** + * A thread that is waiting for another thread to perform an action for up to a specified + * waiting time is in this state. + */ + public static final String TIMED_WAITING = "timed_waiting"; + + /** A thread that has exited is in this state. */ + public static final String TERMINATED = "terminated"; + + private JvmThreadStateValues() {} + } + + private JvmAttributes() {} +} diff --git a/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java b/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java index fba1709..e200e0b 100644 --- a/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java +++ b/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java @@ -7,6 +7,7 @@ public final class SchemaUrls { + public static final String V1_24_0 = "https://opentelemetry.io/schemas/1.24.0"; public static final String V1_23_1 = "https://opentelemetry.io/schemas/1.23.1"; public static final String V1_22_0 = "https://opentelemetry.io/schemas/1.22.0"; diff --git a/semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java b/semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java index b5e832b..3114690 100644 --- a/semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java +++ b/semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java @@ -19,6 +19,7 @@ void available() { isValidClass("io.opentelemetry.semconv.ClientAttributes"); isValidClass("io.opentelemetry.semconv.ErrorAttributes"); isValidClass("io.opentelemetry.semconv.HttpAttributes"); + isValidClass("io.opentelemetry.semconv.JvmAttributes"); isValidClass("io.opentelemetry.semconv.NetworkAttributes"); isValidClass("io.opentelemetry.semconv.ServerAttributes"); isValidClass("io.opentelemetry.semconv.UrlAttributes");