Skip to content

Commit 8af1359

Browse files
committed
Fix compilation errors and formatting issues
- Fix RuntimeConfigProperties to use EmptyConfigProperties.INSTANCE instead of new - Make deprecated configure() method default in IgnoredTypesConfigurer interface - Migrate IgnoredTypesConfigurer implementations to use DeclarativeConfigUtil with GlobalOpenTelemetry - Add @SuppressWarnings with explanatory comments for deprecated API usage in fallback paths - Fix spotless formatting in OpenTelemetryAutoConfiguration
1 parent a221e95 commit 8af1359

File tree

7 files changed

+50
-20
lines changed

7 files changed

+50
-20
lines changed

CI-PLAN.md

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
# CI Failure Analysis Plan
22

33
## Failed Jobs Summary
4-
- Multiple test jobs (test0, test1, test2, test3 across Java 8, 11, 17, 21, 25 with various indy settings)
5-
- testLatestDeps jobs (0, 1, 2, 3)
4+
5+
- Job: common / spotless (job ID: 57983607252)
6+
- Job: common / build (job ID: 57983607261)
7+
- Job: Analyze (java) (job ID: 57983599428)
8+
- Job: markdown-lint-check / markdown-lint-check (job ID: 57983607254)
9+
- Multiple test jobs (test0, test1, test2, test3) across different Java versions
10+
- Multiple smoke-test jobs
11+
- common / examples
12+
- testLatestDeps (0-3)
13+
- muzzle (1-4)
614

715
## Unique Failed Gradle Tasks
816

9-
- [ ] Task: :instrumentation-api-incubator:javaagent-testing:test
10-
- Seen in: test1 (Java 8, indy false)
11-
- Log files: /tmp/test1-java8-indy-false.log
12-
- Failure: Test assertions failing for http.response.body.size attribute
17+
- [x] Task: :instrumentation:spring:spring-boot-autoconfigure:spotlessJavaCheck
18+
- Seen in: common / spotless, common / build
19+
- Log files: /tmp/spotless.log, /tmp/build.log
20+
- Issue: Format violation in OpenTelemetryAutoConfiguration.java
21+
- Fix: Ran spotlessApply to fix formatting
22+
23+
- [x] Task: :javaagent-tooling:compileJava
24+
- Seen in: common / build, all test jobs, all smoke-test jobs, examples, testLatestDeps, muzzle
25+
- Log files: /tmp/build.log, /tmp/test0-java8.log, /tmp/examples.log
26+
- Issue: Compilation errors - cannot find symbol EmptyConfigProperties, and IgnoredTypesConfigurer implementations missing required method
27+
- Fix:
28+
- Fixed EmptyConfigProperties instantiation to use INSTANCE instead of new
29+
- Made deprecated configure(builder, config) method default in IgnoredTypesConfigurer
30+
- Updated IgnoredTypesConfigurer implementations to use deprecated method when config is needed
31+
- Added @SuppressWarnings("deprecation") with comments to all deprecated API usage
1332

14-
- [ ] Task: :smoke-tests-otel-starter:spring-boot-2:testDeclarativeConfig
15-
- Seen in: test1 (Java 8, indy false)
16-
- Log files: /tmp/test1-java8-indy-false.log
17-
- Failure: 6 tests failed - AssertionError for [LONG attribute 'http.response.body.size'] - Expecting actual not to be null
33+
- [ ] Task: markdown-lint-check
34+
- Seen in: markdown-lint-check / markdown-lint-check
35+
- Log files: /tmp/markdown-lint.log
36+
- Issue: CI-PLAN.md format violations (will be fixed by not committing this file)
1837

1938
## Notes
20-
- All failures appear related to missing `http.response.body.size` attribute in test assertions
21-
- The attribute is expected to be present in HTTP spans but is null
22-
- This is likely related to the declarative-configuration-bridge changes
23-
- Both regular instrumentation API tests and Spring Boot smoke tests are affected
39+
40+
- All failures appear related to the declarative-configuration-bridge changes
41+
- The compilation error in javaagent-tooling is the root cause blocking all downstream jobs
42+
- Need to fix: EmptyConfigProperties missing class and IgnoredTypesConfigurer interface changes

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ public OpenTelemetryConfigurationModel openTelemetryConfigurationModel(
165165

166166
@Bean
167167
public OpenTelemetry openTelemetry(
168-
OpenTelemetryConfigurationModel model,
169-
ApplicationContext applicationContext) {
168+
OpenTelemetryConfigurationModel model, ApplicationContext applicationContext) {
170169
ExtendedOpenTelemetrySdk sdk =
171170
DeclarativeConfiguration.create(
172171
model, new OpenTelemetrySdkComponentLoader(applicationContext));

javaagent-extension-api/src/main/java/io/opentelemetry/javaagent/extension/ignore/IgnoredTypesConfigurer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ default void configure(IgnoredTypesBuilder builder) {
3333
* @deprecated Use {@link #configure(IgnoredTypesBuilder)} instead.
3434
*/
3535
@Deprecated
36-
void configure(IgnoredTypesBuilder builder, ConfigProperties config);
36+
default void configure(IgnoredTypesBuilder builder, ConfigProperties config) {
37+
configure(builder);
38+
}
3739
}

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/AgentInstaller.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ private static void installBytebuddyAgent(
185185
agentBuilder = agentExtension.extend(agentBuilder);
186186
} catch (UnsupportedOperationException e) {
187187
// fall back to the deprecated method
188-
agentBuilder = agentExtension.extend(agentBuilder, RuntimeConfigProperties.get());
188+
@SuppressWarnings("deprecation")
189+
AgentBuilder extended = agentExtension.extend(agentBuilder, RuntimeConfigProperties.get());
190+
agentBuilder = extended;
189191
}
190192
numberOfLoadedExtensions++;
191193
} catch (Exception | LinkageError e) {
@@ -289,6 +291,8 @@ private static void copyNecessaryConfigToSystemProperties() {
289291
"otel.instrumentation.experimental.span-suppression-strategy", value));
290292
}
291293

294+
// Need to call deprecated API for backward compatibility with extensions that haven't migrated
295+
@SuppressWarnings("deprecation")
292296
private static void setBootstrapPackages(ClassLoader extensionClassLoader) {
293297
BootstrapPackagesBuilderImpl builder = new BootstrapPackagesBuilderImpl();
294298
for (BootstrapPackagesConfigurer configurer :
@@ -307,6 +311,8 @@ private static void setDefineClassHandler() {
307311
DefineClassHelper.internalSetHandler(DefineClassHandler.INSTANCE);
308312
}
309313

314+
// Need to call deprecated API for backward compatibility with extensions that haven't migrated
315+
@SuppressWarnings("deprecation")
310316
private static AgentBuilder configureIgnoredTypes(
311317
ClassLoader extensionClassLoader, AgentBuilder agentBuilder) {
312318
IgnoredTypesBuilderImpl builder = new IgnoredTypesBuilderImpl();

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/RuntimeConfigProperties.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
package io.opentelemetry.javaagent.tooling.config;
77

8+
import io.opentelemetry.javaagent.tooling.EmptyConfigProperties;
89
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
910
import javax.annotation.Nullable;
1011

1112
public final class RuntimeConfigProperties {
1213

13-
@Nullable private static volatile ConfigProperties instance = new EmptyConfigProperties();
14+
@Nullable private static volatile ConfigProperties instance = EmptyConfigProperties.INSTANCE;
1415

1516
public static void set(ConfigProperties configProperties) {
1617
instance = configProperties;

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ignore/UserExcludedClassesConfigurer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import static java.util.Collections.emptyList;
99

1010
import com.google.auto.service.AutoService;
11+
import io.opentelemetry.api.GlobalOpenTelemetry;
1112
import io.opentelemetry.instrumentation.api.incubator.config.internal.DeclarativeConfigUtil;
1213
import io.opentelemetry.javaagent.extension.ignore.IgnoredTypesBuilder;
1314
import io.opentelemetry.javaagent.extension.ignore.IgnoredTypesConfigurer;
@@ -19,7 +20,7 @@ public class UserExcludedClassesConfigurer implements IgnoredTypesConfigurer {
1920
@Override
2021
public void configure(IgnoredTypesBuilder builder) {
2122
List<String> excludedClasses =
22-
DeclarativeConfigUtil.getList(openTelemetry, "java", "agent", "exclude_classes")
23+
DeclarativeConfigUtil.getList(GlobalOpenTelemetry.get(), "java", "agent", "exclude_classes")
2324
.orElse(emptyList());
2425
configureInternal(builder, excludedClasses);
2526
}

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/InstrumentationModuleInstaller.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public InstrumentationModuleInstaller(Instrumentation instrumentation) {
6565
this.instrumentation = instrumentation;
6666
}
6767

68+
// Need to call deprecated API for backward compatibility with modules that haven't migrated
69+
@SuppressWarnings("deprecation")
6870
AgentBuilder install(
6971
InstrumentationModule instrumentationModule, AgentBuilder parentAgentBuilder) {
7072
boolean defaultEnabled;

0 commit comments

Comments
 (0)