Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbaucells authored Dec 13, 2023
2 parents 729219a + 50dc6a2 commit bd3036d
Show file tree
Hide file tree
Showing 61 changed files with 2,359 additions and 227 deletions.
4 changes: 4 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"matchPackagePrefixes": ["org.apache.maven:"],
"matchCurrentVersion": "3.5.0",
"enabled": false
},
{
"matchPackagePrefixes": ["com.diffplug.spotless"],
"groupName": "spotless packages"
}
]
}
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down Expand Up @@ -48,14 +48,14 @@ jobs:

- id: setup-test-java
name: Set up JDK ${{ matrix.test-java-version }} for running tests
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
# using zulu because new releases get published quickly
distribution: zulu
java-version: ${{ matrix.test-java-version }}

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand All @@ -78,7 +78,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-management-stale-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 7
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
fetch-depth: 0

- name: Set up JDK for running Gradle
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down Expand Up @@ -176,7 +176,6 @@ jobs:
gh release create --target $GITHUB_REF_NAME \
--title "Version $VERSION" \
--notes-file /tmp/release-notes.txt \
--discussion-category announcements \
v$VERSION \
opentelemetry-jmx-metrics.jar
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

## Unreleased

## Version 1.32.0 (2023-11-27)

### Disk buffering

- Using Android 21 as minimum supported for disk-buffering
([#1096](https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1096))

## Version 1.31.0 (2023-10-18)

### Consistent sampling

- Explicitly pass invalid p-value to root sampler
([#1053](https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1053))
- Consistent sampler prototypes using 56 bits of randomness
([#1063](https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1063))

### Runtime attach

- Rename runtime attach method from `attachJavaagentToCurrentJVM`
to `attachJavaagentToCurrentJvm`
([#1077](https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1077))

### Samplers

- Support `thread.name` attributes in RuleBasedRoutingSampler
([#1030](https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1030))

## Version 1.30.0 (2023-09-18)

### Disk buffering
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Triagers ([@open-telemetry/java-contrib-triagers](https://github.com/orgs/open-t

Approvers ([@open-telemetry/java-contrib-approvers](https://github.com/orgs/open-telemetry/teams/java-contrib-approvers)):

- [Jason Plumb](https://github.com/breedx-splk), Splunk
- [John Watson](https://github.com/jkwatson), Verta.ai
- [Lauri Tulmin](https://github.com/laurit), Splunk

Expand Down
9 changes: 8 additions & 1 deletion aws-xray/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")

implementation("com.squareup.okhttp3:okhttp")
implementation("io.opentelemetry.semconv:opentelemetry-semconv")
implementation("io.opentelemetry:opentelemetry-semconv")

annotationProcessor("com.google.auto.service:auto-service")
testImplementation("com.google.auto.service:auto-service")
Expand Down Expand Up @@ -45,3 +45,10 @@ testing {
}
}
}

configurations.all {
resolutionStrategy {
// TODO this module still needs to be updated to the latest semconv
force("io.opentelemetry:opentelemetry-semconv:1.28.0-alpha")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@
import static io.opentelemetry.contrib.awsxray.AwsAttributeKeys.AWS_SPAN_KIND;
import static io.opentelemetry.contrib.awsxray.AwsAttributeKeys.AWS_STREAM_NAME;
import static io.opentelemetry.contrib.awsxray.AwsAttributeKeys.AWS_TABLE_NAME;
import static io.opentelemetry.semconv.ResourceAttributes.SERVICE_NAME;
import static io.opentelemetry.semconv.SemanticAttributes.DB_OPERATION;
import static io.opentelemetry.semconv.SemanticAttributes.DB_SYSTEM;
import static io.opentelemetry.semconv.SemanticAttributes.FAAS_INVOKED_NAME;
import static io.opentelemetry.semconv.SemanticAttributes.FAAS_TRIGGER;
import static io.opentelemetry.semconv.SemanticAttributes.GRAPHQL_OPERATION_TYPE;
import static io.opentelemetry.semconv.SemanticAttributes.HTTP_REQUEST_METHOD;
import static io.opentelemetry.semconv.SemanticAttributes.MESSAGING_OPERATION;
import static io.opentelemetry.semconv.SemanticAttributes.MESSAGING_SYSTEM;
import static io.opentelemetry.semconv.SemanticAttributes.PEER_SERVICE;
import static io.opentelemetry.semconv.SemanticAttributes.RPC_METHOD;
import static io.opentelemetry.semconv.SemanticAttributes.RPC_SERVICE;
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_ADDRESS;
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_PORT;
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_ADDRESS;
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_PORT;
import static io.opentelemetry.semconv.SemanticAttributes.URL_FULL;
import static io.opentelemetry.semconv.SemanticAttributes.URL_PATH;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.SERVICE_NAME;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DB_OPERATION;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DB_SYSTEM;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.FAAS_INVOKED_NAME;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.FAAS_TRIGGER;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.GRAPHQL_OPERATION_TYPE;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_METHOD;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_TARGET;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_URL;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_OPERATION;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_SYSTEM;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_PEER_NAME;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_PEER_PORT;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_SOCK_PEER_ADDR;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_SOCK_PEER_PORT;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.PEER_SERVICE;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_METHOD;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.RPC_SERVICE;

import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.trace.data.SpanData;
import io.opentelemetry.semconv.ResourceAttributes;
import io.opentelemetry.semconv.SemanticAttributes;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Optional;
Expand Down Expand Up @@ -156,8 +156,8 @@ private static boolean isValidOperation(SpanData span) {
if (operation == null || operation.equals(UNKNOWN_OPERATION)) {
return false;
}
if (isKeyPresent(span, HTTP_REQUEST_METHOD)) {
String httpMethod = span.getAttributes().get(HTTP_REQUEST_METHOD);
if (isKeyPresent(span, HTTP_METHOD)) {
String httpMethod = span.getAttributes().get(HTTP_METHOD);
return !operation.equals(httpMethod);
}
return true;
Expand Down Expand Up @@ -260,15 +260,15 @@ private static void setRemoteServiceAndOperation(SpanData span, AttributesBuilde
*/
private static String generateIngressOperation(SpanData span) {
String operation = UNKNOWN_OPERATION;
if (isKeyPresent(span, URL_PATH)) {
String httpTarget = span.getAttributes().get(URL_PATH);
if (isKeyPresent(span, HTTP_TARGET)) {
String httpTarget = span.getAttributes().get(HTTP_TARGET);
// get the first part from API path string as operation value
// the more levels/parts we get from API path the higher chance for getting high cardinality
// data
if (httpTarget != null) {
operation = extractApiPathValue(httpTarget);
if (isKeyPresent(span, HTTP_REQUEST_METHOD)) {
String httpMethod = span.getAttributes().get(HTTP_REQUEST_METHOD);
if (isKeyPresent(span, HTTP_METHOD)) {
String httpMethod = span.getAttributes().get(HTTP_METHOD);
if (httpMethod != null) {
operation = httpMethod + " " + operation;
}
Expand All @@ -284,8 +284,8 @@ private static String generateIngressOperation(SpanData span) {
*/
private static String generateRemoteOperation(SpanData span) {
String remoteOperation = UNKNOWN_REMOTE_OPERATION;
if (isKeyPresent(span, URL_FULL)) {
String httpUrl = span.getAttributes().get(URL_FULL);
if (isKeyPresent(span, HTTP_URL)) {
String httpUrl = span.getAttributes().get(HTTP_URL);
try {
URL url;
if (httpUrl != null) {
Expand All @@ -296,8 +296,8 @@ private static String generateRemoteOperation(SpanData span) {
logger.log(Level.FINEST, "invalid http.url attribute: ", httpUrl);
}
}
if (isKeyPresent(span, HTTP_REQUEST_METHOD)) {
String httpMethod = span.getAttributes().get(HTTP_REQUEST_METHOD);
if (isKeyPresent(span, HTTP_METHOD)) {
String httpMethod = span.getAttributes().get(HTTP_METHOD);
remoteOperation = httpMethod + " " + remoteOperation;
}
if (remoteOperation.equals(UNKNOWN_REMOTE_OPERATION)) {
Expand Down Expand Up @@ -325,16 +325,16 @@ private static String extractApiPathValue(String httpTarget) {

private static String generateRemoteService(SpanData span) {
String remoteService = UNKNOWN_REMOTE_SERVICE;
if (isKeyPresent(span, SERVER_ADDRESS)) {
remoteService = getRemoteService(span, SERVER_ADDRESS);
if (isKeyPresent(span, SERVER_PORT)) {
Long port = span.getAttributes().get(SERVER_PORT);
if (isKeyPresent(span, NET_PEER_NAME)) {
remoteService = getRemoteService(span, NET_PEER_NAME);
if (isKeyPresent(span, NET_PEER_PORT)) {
Long port = span.getAttributes().get(NET_PEER_PORT);
remoteService += ":" + port;
}
} else if (isKeyPresent(span, SERVER_SOCKET_ADDRESS)) {
remoteService = getRemoteService(span, SERVER_SOCKET_ADDRESS);
if (isKeyPresent(span, SERVER_SOCKET_PORT)) {
Long port = span.getAttributes().get(SERVER_SOCKET_PORT);
} else if (isKeyPresent(span, NET_SOCK_PEER_ADDR)) {
remoteService = getRemoteService(span, NET_SOCK_PEER_ADDR);
if (isKeyPresent(span, NET_SOCK_PEER_PORT)) {
Long port = span.getAttributes().get(NET_SOCK_PEER_PORT);
remoteService += ":" + port;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package io.opentelemetry.contrib.awsxray;

import static io.opentelemetry.semconv.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE;
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.HTTP_STATUS_CODE;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.DoubleHistogram;
Expand Down Expand Up @@ -107,7 +107,7 @@ public boolean isEndRequired() {
}

private void recordErrorOrFault(SpanData spanData, Attributes attributes) {
Long httpStatusCode = spanData.getAttributes().get(HTTP_RESPONSE_STATUS_CODE);
Long httpStatusCode = spanData.getAttributes().get(HTTP_STATUS_CODE);
if (httpStatusCode == null) {
httpStatusCode = getAwsStatusCode(spanData);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.sdk.trace.samplers.SamplingDecision;
import io.opentelemetry.sdk.trace.samplers.SamplingResult;
import io.opentelemetry.semconv.ResourceAttributes;
import io.opentelemetry.semconv.SemanticAttributes;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.time.Duration;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -162,25 +162,13 @@ boolean matches(Attributes attributes, Resource resource) {
String host = null;

for (Map.Entry<AttributeKey<?>, Object> entry : attributes.asMap().entrySet()) {
if (entry.getKey().equals(SemanticAttributes.URL_PATH)) {
if (entry.getKey().equals(SemanticAttributes.HTTP_TARGET)) {
httpTarget = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.HTTP_TARGET)) {
// TODO remove support for deprecated http.target attribute
httpTarget = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.URL_FULL)) {
httpUrl = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.HTTP_URL)) {
// TODO remove support for deprecated http.url attribute
httpUrl = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.HTTP_REQUEST_METHOD)) {
httpMethod = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.HTTP_METHOD)) {
// TODO remove support for deprecated http.method attribute
httpMethod = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.SERVER_ADDRESS)) {
host = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.NET_HOST_NAME)) {
// TODO remove support for deprecated net.host.name attribute
host = (String) entry.getValue();
} else if (entry.getKey().equals(SemanticAttributes.HTTP_HOST)) {
// TODO (trask) remove support for deprecated http.host attribute
Expand Down
Loading

0 comments on commit bd3036d

Please sign in to comment.