Skip to content

Commit e3f70ab

Browse files
committed
Merge branch 'main' into x-bar-1-sfn
2 parents 194c97e + 0842440 commit e3f70ab

File tree

7 files changed

+51
-26
lines changed

7 files changed

+51
-26
lines changed

.github/workflows/auto-update-pull-request.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,22 @@ jobs:
5555
git config user.name otelbot
5656
git config user.email [email protected]
5757
58+
- id: gradle-task
59+
if: steps.unzip-patch.outputs.exists == 'true'
60+
run: |
61+
if [[ "${{ github.event.workflow_run.name }}" == "Auto spotless" ]]; then
62+
echo "name=spotlessApply" >> $GITHUB_OUTPUT
63+
elif [[ "${{ github.event.workflow_run.name }}" == "Auto license report" ]]; then
64+
echo "name=generateLicenseReport" >> $GITHUB_OUTPUT
65+
else
66+
echo "name=unknown" >> $GITHUB_OUTPUT
67+
fi
68+
5869
- name: Apply patch and push
5970
if: steps.unzip-patch.outputs.exists == 'true'
6071
run: |
6172
git apply "${{ runner.temp }}/patch"
62-
git commit -a -m "./gradlew spotlessApply"
73+
git commit -a -m "./gradlew ${{ steps.gradle-task.outputs.name }}"
6374
git push
6475
6576
- id: get-pr
@@ -84,12 +95,12 @@ jobs:
8495
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
8596
PR_NUMBER: ${{ steps.get-pr.outputs.number }}
8697
run: |
87-
gh pr comment $PR_NUMBER --body "🔧 The result from spotlessApply was committed to the PR branch."
98+
gh pr comment $PR_NUMBER --body "🔧 The result from ${{ steps.gradle-task.outputs.name }} was committed to the PR branch."
8899
89100
- if: steps.unzip-patch.outputs.exists == 'true' && failure()
90101
env:
91102
GH_REPO: ${{ github.repository }}
92103
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
93104
PR_NUMBER: ${{ steps.get-pr.outputs.number }}
94105
run: |
95-
gh pr comment $PR_NUMBER --body "❌ The result from spotlessApply could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."
106+
gh pr comment $PR_NUMBER --body "❌ The result from ${{ steps.gradle-task.outputs.name }} could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."

.github/workflows/reusable-markdown-link-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ jobs:
2222
--exclude "^http://code.google.com/p/concurrentlinkedhashmap$"
2323
--exclude "^https://softwareengineering.stackexchange.com/questions/29727"
2424
--max-retries 6
25-
--max-concurrency 1
25+
--max-concurrency 4
26+
--github-token ${{ github.token }}
2627
.

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies {
6060
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.6")
6161
implementation("org.apache.httpcomponents:httpclient:4.5.14")
6262
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.0.2")
63-
implementation("org.owasp:dependency-check-gradle:12.1.2")
63+
implementation("org.owasp:dependency-check-gradle:12.1.3")
6464
implementation("ru.vyarus:gradle-animalsniffer-plugin:2.0.1")
6565
implementation("org.spdx:spdx-gradle-plugin:0.9.0")
6666
// When updating, also update dependencyManagement/build.gradle.kts

instrumentation/hibernate/hibernate-6.0/javaagent/src/hibernate7Test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v7_0/SessionTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ class SessionTest extends AbstractHibernateTest {
5252
@MethodSource("provideHibernateActionParameters")
5353
void testHibernateAction(Parameter parameter) {
5454
Session session = sessionFactory.openSession();
55+
session.beginTransaction();
56+
5557
Value value = session.merge(prepopulated.get(0));
5658
testing.waitForTraces(1);
5759
testing.clearData();
5860

5961
testing.runWithSpan(
6062
"parent",
6163
() -> {
62-
session.beginTransaction();
6364
try {
6465
parameter.sessionMethodTest.accept(session, value);
6566
} catch (RuntimeException e) {

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/OpenTelemetryAutoConfiguration.java

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.springframework.context.annotation.Bean;
4242
import org.springframework.context.annotation.Conditional;
4343
import org.springframework.context.annotation.Configuration;
44+
import org.springframework.context.annotation.DependsOn;
4445
import org.springframework.core.env.Environment;
4546

4647
/**
@@ -62,18 +63,26 @@ public class OpenTelemetryAutoConfiguration {
6263

6364
public OpenTelemetryAutoConfiguration() {}
6465

66+
@Bean
67+
@ConfigurationPropertiesBinding
68+
OtelMapConverter otelMapConverter() {
69+
// This is needed for otlp exporter headers and OtelResourceProperties.
70+
71+
// We need this converter, even if the SDK is disabled,
72+
// because the properties are parsed before the SDK is disabled.
73+
74+
// We also need this converter if the OpenTelemetry bean is user supplied,
75+
// because the environment variables may still contain a value that needs to be converted,
76+
// even if the SDK is disabled (and the value thus ignored).
77+
return new OtelMapConverter();
78+
}
79+
6580
@Configuration
6681
@Conditional(SdkEnabled.class)
82+
@DependsOn("otelMapConverter")
6783
@ConditionalOnMissingBean(OpenTelemetry.class)
6884
static class OpenTelemetrySdkConfig {
6985

70-
@Bean
71-
@ConfigurationPropertiesBinding
72-
public OtelMapConverter otelMapConverter() {
73-
// needed for otlp exporter headers and OtelResourceProperties
74-
return new OtelMapConverter();
75-
}
76-
7786
@Bean
7887
public OpenTelemetrySdkComponentLoader openTelemetrySdkComponentLoader(
7988
ApplicationContext applicationContext) {
@@ -139,21 +148,10 @@ public ConfigProperties otelProperties(
139148
}
140149

141150
@Configuration
151+
@DependsOn("otelMapConverter")
142152
@ConditionalOnMissingBean(OpenTelemetry.class)
143153
@ConditionalOnProperty(name = "otel.sdk.disabled", havingValue = "true")
144154
static class DisabledOpenTelemetrySdkConfig {
145-
146-
@Bean
147-
@ConfigurationPropertiesBinding
148-
// Duplicated in OpenTelemetrySdkConfig and DisabledOpenTelemetrySdkConfig to not expose the
149-
// converter in the public API
150-
public OtelMapConverter otelMapConverter() {
151-
// needed for otlp exporter headers and OtelResourceProperties
152-
// we need this converter, even if the SDK is disabled,
153-
// because the properties are parsed before the SDK is disabled
154-
return new OtelMapConverter();
155-
}
156-
157155
@Bean
158156
public OpenTelemetry openTelemetry() {
159157
logger.info("OpenTelemetry Spring Boot starter has been disabled");

instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/properties/SpringConfigPropertiesTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import static org.assertj.core.api.Assertions.assertThat;
99
import static org.assertj.core.api.Assertions.entry;
1010

11+
import io.opentelemetry.api.OpenTelemetry;
1112
import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration;
1213
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
1314
import io.opentelemetry.sdk.autoconfigure.spi.internal.DefaultConfigProperties;
@@ -77,6 +78,19 @@ void mapFlatHeaders(String key) {
7778
.containsExactly(entry("a", "1"), entry("b", "2")));
7879
}
7980

81+
@ParameterizedTest
82+
@MethodSource("headerKeys")
83+
@DisplayName("should map headers from spring properties with user supplied OpenTelemetry bean")
84+
void mapFlatHeadersWithUserSuppliedOtelBean(String key) {
85+
this.contextRunner
86+
.withSystemProperties(key + "=a=1,b=2")
87+
.withBean(OpenTelemetry.class, OpenTelemetry::noop)
88+
.run(
89+
context ->
90+
assertThat(getConfig(context).getMap(key))
91+
.containsExactly(entry("a", "1"), entry("b", "2")));
92+
}
93+
8094
@ParameterizedTest
8195
@MethodSource("headerKeys")
8296
@DisplayName("should map headers from spring application.yaml")

test-report/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
dependencies {
66
implementation("com.google.api-client:google-api-client:2.8.0")
7-
implementation("com.google.apis:google-api-services-sheets:v4-rev20250513-2.0.0")
7+
implementation("com.google.apis:google-api-services-sheets:v4-rev20250603-2.0.0")
88
implementation("com.google.auth:google-auth-library-oauth2-http:1.37.0")
99
}
1010

0 commit comments

Comments
 (0)