Skip to content

Commit d20153d

Browse files
Merge branch 'main' into main
2 parents dd17633 + 5e73de2 commit d20153d

File tree

12 files changed

+48
-37
lines changed

12 files changed

+48
-37
lines changed

.github/repository-settings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ private admin repo.
2929
### Organization variables
3030

3131
- `OTELBOT_APP_ID`
32+
- `OTELBOT_JAVA_INSTRUMENTATION_APP_ID` (scoped only to this repo)

.github/workflows/auto-license-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
if: steps.check-patch.outputs.exists == 'true'
7272
id: otelbot-token
7373
with:
74-
app-id: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
74+
app-id: ${{ vars.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
7575
private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_PRIVATE_KEY }}
7676

7777
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

.github/workflows/auto-update-otel-sdk.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ jobs:
7575
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
7676

7777
- name: Update license report
78-
run: ./gradlew generateLicenseReport
78+
# with the build cache enabled occasionally produces outdated results
79+
run: ./gradlew generateLicenseReport --no-build-cache
7980

8081
- name: Undo license report clean
8182
if: failure()

.github/workflows/metadata-update.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ jobs:
2121
pull-requests: write # for adding label and assignee to PR
2222

2323
steps:
24+
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
25+
id: otelbot-token
26+
with:
27+
app-id: ${{ vars.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
28+
private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_PRIVATE_KEY }}
29+
2430
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
31+
with:
32+
token: ${{ steps.otelbot-token.outputs.token }}
2533

2634
- name: Free disk space
2735
run: .github/scripts/gha-free-disk-space.sh
@@ -55,27 +63,16 @@ jobs:
5563
if: steps.diffcheck.outputs.has_diff == 'true'
5664
run: .github/scripts/use-cla-approved-bot.sh
5765

58-
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
59-
if: steps.diffcheck.outputs.has_diff == 'true'
60-
id: otelbot-token
61-
with:
62-
app-id: ${{ vars.OTELBOT_APP_ID }}
63-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
64-
6566
- name: Find or create metadata update branch
6667
if: steps.diffcheck.outputs.has_diff == 'true'
6768
id: findbranch
68-
env:
69-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7069
run: |
7170
BRANCH_NAME="otelbot/metadata-update-main"
7271
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
7372
git checkout -B "$BRANCH_NAME"
7473
7574
- name: Commit and push changes
7675
if: steps.diffcheck.outputs.has_diff == 'true'
77-
env:
78-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7976
run: |
8077
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
8178
git commit -m "chore: update instrumentation list [automated]" || echo "No changes to commit."
@@ -104,7 +101,7 @@ jobs:
104101
- name: Add label to PR
105102
if: steps.createpr.outputs.new_pr == 'true'
106103
env:
107-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
108105
run: |
109106
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
110107
PR_URL=$(gh pr list --state open --head "$BRANCH_NAME" --json url -q '.[0].url')

conventions/src/main/kotlin/otel.spotless-conventions.gradle.kts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,19 @@ if (project == rootProject) {
8585
".gitattributes",
8686
".gitconfig",
8787
".editorconfig",
88-
"**/*.md",
89-
"**/*.sh",
90-
"**/*.dockerfile",
91-
"**/gradle.properties"
88+
"*.md",
89+
"gradle.properties",
90+
".github/**/*.md",
91+
".github/**/*.sh",
92+
"docs/**/*.md",
93+
"examples/**/*.md",
94+
"examples/**/gradle.properties",
95+
"licenses/**/*.md"
9296
)
9397
leadingTabsToSpaces()
9498
trimTrailingWhitespace()
9599
endWithNewline()
96100
}
97-
groovy {
98-
target("**/*.groovy")
99-
targetExclude("**/build/**")
100-
licenseHeaderFile(
101-
rootProject.file("buildscripts/spotless.license.java"),
102-
"(package|import|(?:abstract )?class)"
103-
)
104-
endWithNewline()
105-
}
106101
predeclareDeps()
107102
}
108103

examples/distro/smoke-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
dependencies {
66
testImplementation("org.testcontainers:testcontainers:2.0.2")
77
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.20.1")
8-
testImplementation("com.google.protobuf:protobuf-java-util:4.33.1")
8+
testImplementation("com.google.protobuf:protobuf-java-util:4.33.2")
99
testImplementation("com.squareup.okhttp3:okhttp:5.3.2")
1010
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.9.0-alpha")
1111
testImplementation("io.opentelemetry:opentelemetry-api")

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ dependencies {
100100
//All dependencies below are only for tests
101101
testImplementation("org.testcontainers:testcontainers:2.0.2")
102102
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.20.1")
103-
testImplementation("com.google.protobuf:protobuf-java-util:4.33.1")
103+
testImplementation("com.google.protobuf:protobuf-java-util:4.33.2")
104104
testImplementation("com.squareup.okhttp3:okhttp:5.3.2")
105105
testImplementation("io.opentelemetry:opentelemetry-api")
106106
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.9.0-alpha")

instrumentation/grails-3.0/javaagent/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ configurations.testRuntimeClasspath {
6161
}
6262
}
6363

64+
spotless {
65+
groovy {
66+
target("src/**/*.groovy")
67+
licenseHeaderFile(
68+
rootProject.file("buildscripts/spotless.license.java"),
69+
"(package|import|(?:abstract )?class)"
70+
)
71+
endWithNewline()
72+
}
73+
}
74+
6475
tasks {
6576
withType<Test>().configureEach {
6677
systemProperty("testLatestDeps", latestDepTest)

instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/DefaultClientResourcesInstrumentation.java renamed to instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/ClientResourcesInstrumentation.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,29 @@
55

66
package io.opentelemetry.javaagent.instrumentation.lettuce.v5_1;
77

8+
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
9+
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.implementsInterface;
810
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
911
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
1012
import static net.bytebuddy.matcher.ElementMatchers.isStatic;
1113
import static net.bytebuddy.matcher.ElementMatchers.named;
1214

13-
import io.lettuce.core.resource.DefaultClientResources;
15+
import io.lettuce.core.resource.ClientResources;
1416
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1517
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
1618
import net.bytebuddy.asm.Advice;
1719
import net.bytebuddy.description.type.TypeDescription;
1820
import net.bytebuddy.matcher.ElementMatcher;
1921

20-
public class DefaultClientResourcesInstrumentation implements TypeInstrumentation {
22+
public class ClientResourcesInstrumentation implements TypeInstrumentation {
2123
@Override
2224
public ElementMatcher<TypeDescription> typeMatcher() {
23-
return named("io.lettuce.core.resource.DefaultClientResources");
25+
return implementsInterface(named("io.lettuce.core.resource.ClientResources"));
26+
}
27+
28+
@Override
29+
public ElementMatcher<ClassLoader> classLoaderOptimization() {
30+
return hasClassesNamed("io.lettuce.core.resource.ClientResources");
2431
}
2532

2633
@Override
@@ -34,7 +41,7 @@ public void transform(TypeTransformer transformer) {
3441
public static class BuilderAdvice {
3542

3643
@Advice.OnMethodExit(suppress = Throwable.class)
37-
public static void methodEnter(@Advice.Return DefaultClientResources.Builder builder) {
44+
public static void methodEnter(@Advice.Return ClientResources.Builder builder) {
3845
if (CompatibilityChecker.checkCompatible()) {
3946
builder.tracing(TracingHolder.TRACING);
4047
}

instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceInstrumentationModule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public boolean isHelperClass(String className) {
3535

3636
@Override
3737
public List<TypeInstrumentation> typeInstrumentations() {
38-
return asList(
39-
new DefaultClientResourcesInstrumentation(), new LettuceAsyncCommandInstrumentation());
38+
return asList(new ClientResourcesInstrumentation(), new LettuceAsyncCommandInstrumentation());
4039
}
4140

4241
@Override

0 commit comments

Comments
 (0)