Skip to content

Commit

Permalink
Merge branch 'main' into renovate/byte-buddy-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Oct 9, 2023
2 parents 2bff83b + dec59cb commit 197ef22
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 142 deletions.
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

// this line is managed by .github/scripts/update-sdk-version.sh
val otelSdkVersion = "1.30.1"
val otelSdkVersion = "1.31.0"
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")

// Need both BOM and groovy jars
Expand Down
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.30.1",
opentelemetrySdk : "1.31.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.31.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.30.1",
opentelemetrySdk : "1.31.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.31.0-SNAPSHOT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ static void applyStableClientDurationAdvice(DoubleHistogramBuilder builder) {
return;
}
((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.SERVER_ADDRESS,
SemanticAttributes.SERVER_PORT,
SemanticAttributes.SERVER_SOCKET_ADDRESS)));
.setAttributesAdvice(
asList(
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.SERVER_ADDRESS,
SemanticAttributes.SERVER_PORT,
SemanticAttributes.SERVER_SOCKET_ADDRESS));
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand All @@ -41,17 +39,15 @@ static void applyOldClientDurationAdvice(DoubleHistogramBuilder builder) {
return;
}
((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_PEER_NAME,
SemanticAttributes.NET_PEER_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION,
SemanticAttributes.NET_SOCK_PEER_ADDR)));
.setAttributesAdvice(
asList(
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_PEER_NAME,
SemanticAttributes.NET_PEER_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION,
SemanticAttributes.NET_SOCK_PEER_ADDR));
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand All @@ -60,43 +56,39 @@ static void applyClientRequestSizeAdvice(LongHistogramBuilder builder) {
return;
}
((ExtendedLongHistogramBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
// stable attributes
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.SERVER_ADDRESS,
SemanticAttributes.SERVER_PORT,
SemanticAttributes.SERVER_SOCKET_ADDRESS,
// old attributes
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_PEER_NAME,
SemanticAttributes.NET_PEER_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION,
SemanticAttributes.NET_SOCK_PEER_ADDR)));
.setAttributesAdvice(
asList(
// stable attributes
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.SERVER_ADDRESS,
SemanticAttributes.SERVER_PORT,
SemanticAttributes.SERVER_SOCKET_ADDRESS,
// old attributes
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_PEER_NAME,
SemanticAttributes.NET_PEER_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION,
SemanticAttributes.NET_SOCK_PEER_ADDR));
}

static void applyStableServerDurationAdvice(DoubleHistogramBuilder builder) {
if (!(builder instanceof ExtendedDoubleHistogramBuilder)) {
return;
}
((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.URL_SCHEME)));
.setAttributesAdvice(
asList(
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.URL_SCHEME));
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand All @@ -105,18 +97,16 @@ static void applyOldServerDurationAdvice(DoubleHistogramBuilder builder) {
return;
}
((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
SemanticAttributes.HTTP_SCHEME,
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_HOST_NAME,
SemanticAttributes.NET_HOST_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION)));
.setAttributesAdvice(
asList(
SemanticAttributes.HTTP_SCHEME,
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_HOST_NAME,
SemanticAttributes.NET_HOST_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION));
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand All @@ -125,26 +115,24 @@ static void applyServerRequestSizeAdvice(LongHistogramBuilder builder) {
return;
}
((ExtendedLongHistogramBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
// stable attributes
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.URL_SCHEME,
// old attributes
SemanticAttributes.HTTP_SCHEME,
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_HOST_NAME,
SemanticAttributes.NET_HOST_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION)));
.setAttributesAdvice(
asList(
// stable attributes
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.URL_SCHEME,
// old attributes
SemanticAttributes.HTTP_SCHEME,
SemanticAttributes.HTTP_ROUTE,
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
SemanticAttributes.NET_HOST_NAME,
SemanticAttributes.NET_HOST_PORT,
SemanticAttributes.NET_PROTOCOL_NAME,
SemanticAttributes.NET_PROTOCOL_VERSION));
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand All @@ -153,18 +141,16 @@ static void applyServerActiveRequestsAdvice(LongUpDownCounterBuilder builder) {
return;
}
((ExtendedLongUpDownCounterBuilder) builder)
.setAdvice(
advice ->
advice.setAttributes(
asList(
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/metrics/semantic_conventions/http-metrics.md#metric-httpserveractive_requests
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_SCHEME,
SemanticAttributes.NET_HOST_NAME,
SemanticAttributes.NET_HOST_PORT,
// https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-metrics.md#metric-httpserveractive_requests
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.URL_SCHEME)));
.setAttributesAdvice(
asList(
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/metrics/semantic_conventions/http-metrics.md#metric-httpserveractive_requests
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_SCHEME,
SemanticAttributes.NET_HOST_NAME,
SemanticAttributes.NET_HOST_PORT,
// https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-metrics.md#metric-httpserveractive_requests
SemanticAttributes.HTTP_REQUEST_METHOD,
SemanticAttributes.URL_SCHEME));
}

private HttpMetricsAdvice() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static DoubleHistogramBuilder createStableDurationHistogramBuilder(
// don't set custom buckets if milliseconds are still used
if (durationBuilder instanceof ExtendedDoubleHistogramBuilder) {
((ExtendedDoubleHistogramBuilder) durationBuilder)
.setAdvice(advice -> advice.setExplicitBucketBoundaries(DURATION_SECONDS_BUCKETS));
.setExplicitBucketBoundariesAdvice(DURATION_SECONDS_BUCKETS);
}
return durationBuilder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ static void applyClientDurationAdvice(DoubleHistogramBuilder builder) {
attributes.add(SemanticAttributes.NET_TRANSPORT);
}

((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(advice -> advice.setAttributes(attributes));
((ExtendedDoubleHistogramBuilder) builder).setAttributesAdvice(attributes);
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand Down Expand Up @@ -75,8 +74,7 @@ static void applyServerDurationAdvice(DoubleHistogramBuilder builder) {
attributes.add(SemanticAttributes.NET_TRANSPORT);
}

((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(advice -> advice.setAttributes(attributes));
((ExtendedDoubleHistogramBuilder) builder).setAttributesAdvice(attributes);
}

private RpcMetricsAdvice() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ void observeMetrics() {
"kafka.consumer.last_rebalance_seconds_ago",
"kafka.consumer.partition_assigned_latency_avg",
"kafka.consumer.partition_assigned_latency_max",
"kafka.consumer.partition_lost_latency_avg",
"kafka.consumer.partition_lost_latency_max",
"kafka.consumer.partition_revoked_latency_avg",
"kafka.consumer.partition_revoked_latency_max",
"kafka.consumer.rebalance_latency_avg",
"kafka.consumer.rebalance_latency_max",
"kafka.consumer.rebalance_latency_total",
Expand Down Expand Up @@ -233,8 +229,6 @@ void observeMetrics() {
"kafka.consumer.outgoing_byte_rate",
"kafka.consumer.outgoing_byte_total",
"kafka.consumer.poll_idle_ratio_avg",
"kafka.consumer.reauthentication_latency_avg",
"kafka.consumer.reauthentication_latency_max",
"kafka.consumer.request_rate",
"kafka.consumer.request_size_avg",
"kafka.consumer.request_size_max",
Expand All @@ -250,8 +244,6 @@ void observeMetrics() {
"kafka.consumer.successful_reauthentication_total",
"kafka.consumer.time_between_poll_avg",
"kafka.consumer.time_between_poll_max",
"kafka.consumer.request_latency_avg",
"kafka.consumer.request_latency_max",
"kafka.producer.batch_size_avg",
"kafka.producer.batch_size_max",
"kafka.producer.batch_split_rate",
Expand Down Expand Up @@ -287,8 +279,6 @@ void observeMetrics() {
"kafka.producer.outgoing_byte_total",
"kafka.producer.produce_throttle_time_avg",
"kafka.producer.produce_throttle_time_max",
"kafka.producer.reauthentication_latency_avg",
"kafka.producer.reauthentication_latency_max",
"kafka.producer.record_error_rate",
"kafka.producer.record_error_total",
"kafka.producer.record_queue_time_avg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ static void setExplicitBucketsIfConfigured(
}
NavigableSet<Double> buckets = config.getHistogramBuckets(false);
ExtendedDoubleHistogramBuilder extendedBuilder = (ExtendedDoubleHistogramBuilder) builder;
extendedBuilder.setAdvice(
advice -> advice.setExplicitBucketBoundaries(computeBuckets(buckets, timeUnit)));
extendedBuilder.setExplicitBucketBoundariesAdvice(computeBuckets(buckets, timeUnit));
}

private static List<Double> computeBuckets(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ private static void setGcDurationBuckets(DoubleHistogramBuilder builder) {
// that shouldn't really happen
return;
}
((ExtendedDoubleHistogramBuilder) builder)
.setAdvice(advice -> advice.setExplicitBucketBoundaries(emptyList()));
((ExtendedDoubleHistogramBuilder) builder).setExplicitBucketBoundariesAdvice(emptyList());
}

private static final class GcNotificationListener implements NotificationListener {
Expand Down
Loading

0 comments on commit 197ef22

Please sign in to comment.