Skip to content

Commit

Permalink
Update the OpenTelemetry SDK version to 1.23.0 (#7800)
Browse files Browse the repository at this point in the history
Update the OpenTelemetry SDK version to `1.23.0`.

---------

Co-authored-by: Trask Stalnaker <[email protected]>
  • Loading branch information
opentelemetrybot and trask committed Feb 13, 2023
1 parent c61996f commit f074b93
Show file tree
Hide file tree
Showing 51 changed files with 422 additions and 365 deletions.
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

// this line is managed by .github/scripts/update-sdk-version.sh
val otelSdkVersion = "1.22.0"
val otelSdkVersion = "1.23.0"

// Need both BOM and groovy jars
val groovyVersion = "4.0.9"
Expand Down
136 changes: 69 additions & 67 deletions docs/semantic-conventions.md
Original file line number Diff line number Diff line change
@@ -1,97 +1,99 @@
# Semantic conventions

This document describes which [OpenTelemetry Semantic Conventions](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions)
This document describes
which [OpenTelemetry Semantic Conventions](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions)
are implemented by Java autoinstrumentation and which ones are not.

## Http Server

| Attribute | Required | Implemented? |
|---|:---:|:---:|
| `http.method` | Y | + |
| `http.url` | N | - [1] |
| `http.target` | N | + [1] |
| `http.host` | N | + [1] |
| `http.scheme` | N | + [1] |
| `http.status_code` | Y | + |
| `http.flavor` | N | + [2] |
| `http.user_agent` | N | + |
| `http.request_content_length` | N | - |
| `http.request_content_length_uncompressed` | N | - |
| `http.response_content_length` | N | - |
| `http.response_content_length_uncompressed` | N | - |
| `http.server_name` | N | - |
| `http.route` | N | - |
| `http.client_ip` | N | + |
| Attribute | Required | Implemented? |
|---------------------------------------------|:--------:|:------------:|
| `http.method` | Y | + |
| `http.url` | N | - [1] |
| `http.target` | N | + [1] |
| `http.host` | N | + [1] |
| `http.scheme` | N | + [1] |
| `http.status_code` | Y | + |
| `http.flavor` | N | + [2] |
| `http.user_agent` | N | + |
| `http.request_content_length` | N | - |
| `http.request_content_length_uncompressed` | N | - |
| `http.response_content_length` | N | - |
| `http.response_content_length_uncompressed` | N | - |
| `http.server_name` | N | - |
| `http.route` | N | - |
| `http.client_ip` | N | + |

**[1]:** Server instrumentations capture `http.scheme`, `http.host`, and `http.target` and do not
capture `http.url`.

**[2]:** In case of Armeria, return values are [SessionProtocol](https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java),
**[2]:** In case of Armeria, return values
are [SessionProtocol](https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java),
not values defined by spec.

## Http Client

| Attribute | Required | Implemented? |
|---|:---:|:---:|
| `http.method` | Y | + |
| `http.url` | N | + |
| `http.target` | N | - [1] |
| `http.host` | N | - [1] |
| `http.scheme` | N | - [1] |
| `http.status_code` | Y | + |
| `http.flavor` | N | + [2] |
| `http.user_agent` | N | + |
| `http.request_content_length` | N | - |
| `http.request_content_length_uncompressed` | N | - |
| `http.response_content_length` | N | - |
| `http.response_content_length_uncompressed` | N | - |
| Attribute | Required | Implemented? |
|---------------------------------------------|:--------:|:------------:|
| `http.method` | Y | + |
| `http.url` | N | + |
| `http.target` | N | - [1] |
| `http.host` | N | - [1] |
| `http.scheme` | N | - [1] |
| `http.status_code` | Y | + |
| `http.flavor` | N | + [2] |
| `http.user_agent` | N | + |
| `http.request_content_length` | N | - |
| `http.request_content_length_uncompressed` | N | - |
| `http.response_content_length` | N | - |
| `http.response_content_length_uncompressed` | N | - |

**[1]:** Client instrumentations capture `http.url` and do not capture `http.scheme`, `http.host`
and `http.target`.

**[2]:** In case of Armeria, return values are [SessionProtocol](https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java),
**[2]:** In case of Armeria, return values
are [SessionProtocol](https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java),
not values defined by spec.

## RPC

| Attribute | Required | Implemented? |
| -------------- | :---: | :---: |
| `rpc.system` | Y | + |
| `rpc.service` | N | + |
| `rpc.method` | N | + |
| Attribute | Required | Implemented? |
|---------------|:--------:|:------------:|
| `rpc.system` | Y | + |
| `rpc.service` | N | + |
| `rpc.method` | N | + |

## Database

| Attribute | Required | Implemented? |
| -------------- | :---: | :---: |
| `db.system` | Y | + |
| `db.connection_string` | N | only set for Redis, JDBC and MongoDB |
| `db.user` | N | only set for JDBC|
| `db.jdbc.driver_classname` | N | - |
| `db.mssql.instance_name` | N | - |
| `db.name` | N | only set of JDBC, Mongo, Geode and MongoDB |
| `db.statement` | N | +, except for ElasticSearch and Memcached, see `db.operation` |
| `db.operation` | N | only set for ElasticSearch, Memcached and JDBC |
| `db.cassandra.keyspace` | Y | + |
| `db.hbase` | Y | -, HBase is not supported |
| `db.redis.database_index` | N | only set for Lettuce driver, not for Jedis |
| `db.mongodb.collection` | Y | - |
| Attribute | Required | Implemented? |
|----------------------------|:--------:|:-------------------------------------------------------------:|
| `db.system` | Y | + |
| `db.connection_string` | N | only set for Redis, JDBC and MongoDB |
| `db.user` | N | only set for JDBC |
| `db.jdbc.driver_classname` | N | - |
| `db.mssql.instance_name` | N | - |
| `db.name` | N | only set of JDBC, Mongo, Geode and MongoDB |
| `db.statement` | N | +, except for ElasticSearch and Memcached, see `db.operation` |
| `db.operation` | N | only set for ElasticSearch, Memcached and JDBC |
| `db.cassandra.keyspace` | Y | + |
| `db.hbase` | Y | -, HBase is not supported |
| `db.redis.database_index` | N | only set for Lettuce driver, not for Jedis |
| `db.mongodb.collection` | Y | - |

## Messaging

Attribute name | Required? | Implemented? |
| -------------- | :-----: | :---: |
| `messaging.system` | Y | + |
| `messaging.destination` | Y | + |
| `messaging.destination_kind` | Y | + |
| `messaging.temp_destination` | N | - |
| `messaging.protocol` | N | - |
| `messaging.protocol_version` | N | - |
| `messaging.url` | N | - |
| `messaging.message_id` | N | only for JMS |
| `messaging.conversation_id` | N | only for JMS |
| `messaging.message_payload_size_bytes` | N | only for RabbitMQ and Kafka [1] |
| `messaging.message_payload_compressed_size_bytes` | N | - |
| `messaging.operation` | for consumers only | +
| Attribute name | Required? | Implemented? |
|---------------------------------------------------|:------------------:|:-------------------------------:|
| `messaging.system` | Y | + |
| `messaging.destination.name` | Y | + |
| `messaging.destination.kind` | Y | + |
| `messaging.destination.temporary` | N | - |
| `net.app.protocol.name` | N | - |
| `net.app.protocol.version` | N | - |
| `messaging.message.id` | N | only for JMS |
| `messaging.message.conversation_id` | N | only for JMS |
| `messaging.message.payload_size_bytes` | N | only for RabbitMQ and Kafka [1] |
| `messaging.message.payload_compressed_size_bytes` | N | - |
| `messaging.operation` | for consumers only | + |

**[1]:** Kafka consumer instrumentation sets this to the serialized size of the value
2 changes: 1 addition & 1 deletion examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subprojects {
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.22.0",
opentelemetrySdk : "1.23.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.23.0-SNAPSHOT",
Expand Down
2 changes: 1 addition & 1 deletion examples/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ version '1.0'
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.22.0",
opentelemetrySdk : "1.23.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.23.0-SNAPSHOT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@ public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST
getter.getDestinationKind(request));
boolean isTemporaryDestination = getter.isTemporaryDestination(request);
if (isTemporaryDestination) {
internalSet(attributes, SemanticAttributes.MESSAGING_TEMP_DESTINATION, true);
internalSet(attributes, SemanticAttributes.MESSAGING_DESTINATION, TEMP_DESTINATION_NAME);
internalSet(attributes, SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY, true);
internalSet(attributes, SemanticAttributes.MESSAGING_DESTINATION_NAME, TEMP_DESTINATION_NAME);
} else {
internalSet(
attributes, SemanticAttributes.MESSAGING_DESTINATION, getter.getDestination(request));
attributes,
SemanticAttributes.MESSAGING_DESTINATION_NAME,
getter.getDestination(request));
}
internalSet(attributes, SemanticAttributes.MESSAGING_PROTOCOL, getter.getProtocol(request));
internalSet(attributes, SemanticAttributes.NET_APP_PROTOCOL_NAME, getter.getProtocol(request));
internalSet(
attributes,
SemanticAttributes.MESSAGING_PROTOCOL_VERSION,
SemanticAttributes.NET_APP_PROTOCOL_VERSION,
getter.getProtocolVersion(request));
internalSet(attributes, SemanticAttributes.MESSAGING_URL, getter.getUrl(request));
internalSet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ void shouldExtractAllAvailableAttributes(
List<MapEntry<AttributeKey<?>, Object>> expectedEntries = new ArrayList<>();
expectedEntries.add(entry(SemanticAttributes.MESSAGING_SYSTEM, "myQueue"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION, expectedDestination));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_NAME, expectedDestination));
if (temporary) {
expectedEntries.add(entry(SemanticAttributes.MESSAGING_TEMP_DESTINATION, true));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY, true));
}
expectedEntries.add(entry(SemanticAttributes.MESSAGING_PROTOCOL, "AMQP"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_PROTOCOL_VERSION, "1.0.0"));
expectedEntries.add(entry(SemanticAttributes.NET_APP_PROTOCOL_NAME, "AMQP"));
expectedEntries.add(entry(SemanticAttributes.NET_APP_PROTOCOL_VERSION, "1.0.0"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_URL, "http:https://broker/topic"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_CONVERSATION_ID, "42"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, 100L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ public void pre(

Integer partition = exchange.getIn().getHeader(PARTITION, Integer.class);
if (partition != null) {
attributes.put(SemanticAttributes.MESSAGING_KAFKA_PARTITION, partition);
if (camelDirection == CamelDirection.OUTBOUND) {
attributes.put(SemanticAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, partition);
} else {
attributes.put(SemanticAttributes.MESSAGING_KAFKA_SOURCE_PARTITION, partition);
}
}

if (CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public void pre(
CamelDirection camelDirection) {
super.pre(attributes, exchange, endpoint, camelDirection);

attributes.put(SemanticAttributes.MESSAGING_DESTINATION, getDestination(exchange, endpoint));
attributes.put(
SemanticAttributes.MESSAGING_DESTINATION_NAME, getDestination(exchange, endpoint));

String messageId = getMessageId(exchange);
if (messageId != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.apachecamel.aws

import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes

import static io.opentelemetry.api.trace.SpanKind.INTERNAL

Expand Down Expand Up @@ -33,7 +34,7 @@ class CamelSpan {
}
attributes {
"apache-camel.uri" "aws-sqs:https://${queueName}?amazonSQSClient=%23sqsClient&delay=1000"
"messaging.destination" queueName
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" queueName
}
}
}
Expand All @@ -49,8 +50,8 @@ class CamelSpan {
}
attributes {
"apache-camel.uri" "aws-sqs:https://${queueName}?amazonSQSClient=%23sqsClient&delay=1000"
"messaging.destination" queueName
"messaging.message_id" String
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" queueName
"$SemanticAttributes.MESSAGING_MESSAGE_ID" String
}
}
}
Expand All @@ -62,7 +63,7 @@ class CamelSpan {
childOf parentSpan
attributes {
"apache-camel.uri" "aws-sns:https://${topicName}?amazonSNSClient=%23snsClient"
"messaging.destination" topicName
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" topicName
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void onStart(AttributesBuilder attributes, Context parentContext, SQSMess
attributes.put(SemanticAttributes.MESSAGING_SYSTEM, "AmazonSQS");
attributes.put(SemanticAttributes.MESSAGING_OPERATION, "process");
attributes.put(SemanticAttributes.MESSAGING_MESSAGE_ID, message.getMessageId());
attributes.put(SemanticAttributes.MESSAGING_DESTINATION, message.getEventSource());
attributes.put(SemanticAttributes.MESSAGING_DESTINATION_NAME, message.getEventSource());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ void processSpans() {
entry(SemanticAttributes.MESSAGING_SYSTEM, "AmazonSQS"),
entry(SemanticAttributes.MESSAGING_OPERATION, "process"),
entry(SemanticAttributes.MESSAGING_MESSAGE_ID, "message1"),
entry(SemanticAttributes.MESSAGING_DESTINATION, "queue1")))
entry(
SemanticAttributes.MESSAGING_DESTINATION_NAME,
"queue1")))
.hasLinks(
LinkData.create(
SpanContext.createFromRemoteParent(
Expand All @@ -136,7 +138,9 @@ void processSpans() {
entry(SemanticAttributes.MESSAGING_SYSTEM, "AmazonSQS"),
entry(SemanticAttributes.MESSAGING_OPERATION, "process"),
entry(SemanticAttributes.MESSAGING_MESSAGE_ID, "message2"),
entry(SemanticAttributes.MESSAGING_DESTINATION, "queue1")))
entry(
SemanticAttributes.MESSAGING_DESTINATION_NAME,
"queue1")))
.hasLinks(
LinkData.create(
SpanContext.createFromRemoteParent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ class Jms2Test extends AgentInstrumentationSpecification {
}
attributes {
"$SemanticAttributes.MESSAGING_SYSTEM" "jms"
"$SemanticAttributes.MESSAGING_DESTINATION" destinationName
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName
"$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType
if (destinationName == "(temporary)") {
"$SemanticAttributes.MESSAGING_TEMP_DESTINATION" true
"$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true
}
"$SemanticAttributes.MESSAGING_MESSAGE_ID" String
}
Expand All @@ -303,15 +303,15 @@ class Jms2Test extends AgentInstrumentationSpecification {
}
attributes {
"$SemanticAttributes.MESSAGING_SYSTEM" "jms"
"$SemanticAttributes.MESSAGING_DESTINATION" destinationName
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" destinationName
"$SemanticAttributes.MESSAGING_DESTINATION_KIND" destinationType
"$SemanticAttributes.MESSAGING_OPERATION" operation
if (messageId != null) {
//In some tests we don't know exact messageId, so we pass "" and verify just the existence of the attribute
"$SemanticAttributes.MESSAGING_MESSAGE_ID" { it == messageId || messageId == "" }
}
if (destinationName == "(temporary)") {
"$SemanticAttributes.MESSAGING_TEMP_DESTINATION" true
"$SemanticAttributes.MESSAGING_DESTINATION_TEMPORARY" true
}
}
}
Expand Down
Loading

0 comments on commit f074b93

Please sign in to comment.