diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 7ef24ad3cf..45b684fdd0 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -4,10 +4,10 @@ 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.6.1 +SEMCONV_VERSION=1.7.0 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION -GENERATOR_VERSION=0.4.1 +GENERATOR_VERSION=0.7.0 cd ${SCRIPT_DIR} diff --git a/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java index 869aae4015..9f5319ca51 100644 --- a/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java +++ b/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java @@ -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.6.1"; + public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.7.0"; /** Name of the cloud provider. */ public static final AttributeKey CLOUD_PROVIDER = stringKey("cloud.provider"); diff --git a/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java index 4842b89fc2..767adecc1e 100644 --- a/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java +++ b/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java @@ -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.6.1"; + public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.7.0"; /** * The full invoked ARN as provided on the {@code Context} passed to the function ({@code @@ -451,7 +451,16 @@ public final class SemanticAttributes { /** * The value of the HTTP host - * header. When the header is empty or not present, this attribute should be the same. + * header. An empty Host header should also be reported, see note. + * + *

Notes: + * + *

*/ public static final AttributeKey HTTP_HOST = stringKey("http.host"); @@ -539,6 +548,12 @@ public final class SemanticAttributes { * */ public static final AttributeKey HTTP_CLIENT_IP = stringKey("http.client_ip"); @@ -689,6 +704,15 @@ public final class SemanticAttributes { */ public static final AttributeKey MESSAGING_OPERATION = stringKey("messaging.operation"); + /** + * The identifier for the consumer receiving a message. For Kafka, set it to {@code + * {messaging.kafka.consumer_group} - {messaging.kafka.client_id}}, if both are present, or only + * {@code messaging.kafka.consumer_group}. For brokers, such as RabbitMQ and Artemis, set it to + * the {@code client_id} of the client consuming the message. + */ + public static final AttributeKey MESSAGING_CONSUMER_ID = + stringKey("messaging.consumer_id"); + /** RabbitMQ message routing key. */ public static final AttributeKey MESSAGING_RABBITMQ_ROUTING_KEY = stringKey("messaging.rabbitmq.routing_key"); @@ -787,6 +811,30 @@ public final class SemanticAttributes { public static final AttributeKey RPC_JSONRPC_ERROR_MESSAGE = stringKey("rpc.jsonrpc.error_message"); + /** Whether this is a received or sent message. */ + public static final AttributeKey MESSAGE_TYPE = stringKey("message.type"); + + /** + * MUST be calculated as two different counters starting from {@code 1} one for sent messages and + * one for received message. + * + *

Notes: + * + *

    + *
  • This way we guarantee that the values will be consistent between different + * implementations. + *
+ */ + public static final AttributeKey MESSAGE_ID = longKey("message.id"); + + /** Compressed size of the message in bytes. */ + public static final AttributeKey MESSAGE_COMPRESSED_SIZE = + longKey("message.compressed_size"); + + /** Uncompressed size of the message in bytes. */ + public static final AttributeKey MESSAGE_UNCOMPRESSED_SIZE = + longKey("message.uncompressed_size"); + // Enum definitions public static final class DbSystemValues { /** Some other SQL database. Fallback only. See notes. */ @@ -1106,6 +1154,15 @@ public final class SemanticAttributes { private RpcGrpcStatusCodeValues() {} } + public static final class MessageTypeValues { + /** sent. */ + public static final String SENT = "SENT"; + /** received. */ + public static final String RECEIVED = "RECEIVED"; + + private MessageTypeValues() {} + } + // Manually defined and not YET in the YAML /** * The name of an event describing an exception.