Sync ErrorProne configuration with OpenTelemetry Java instrumentation#93
Merged
Sync ErrorProne configuration with OpenTelemetry Java instrumentation#93
Conversation
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Sync errorprone configuration with open-telemetry/opentelemetry-java-instrumentation
Sync ErrorProne configuration with OpenTelemetry Java instrumentation
Jul 19, 2025
trask
reviewed
Jul 19, 2025
| // TODO: Remove this, we use this pattern in several tests and it will mean some moving. | ||
| disable("DefaultPackage") | ||
|
|
||
| // We don't have custom checks like OpenTelemetry, so disable the standard utility class check |
Owner
There was a problem hiding this comment.
add the custom checks from OpenTelemetry
Author
There was a problem hiding this comment.
This repository doesn't have custom checks like OpenTelemetry, so I've kept the standard disable for PrivateConstructorForUtilityClass instead of adding non-existent custom checks.
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
reviewed
Jul 19, 2025
trask
added a commit
that referenced
this pull request
Jul 21, 2025
…#93) * Initial plan * Sync errorprone configuration with OpenTelemetry instrumentation Co-authored-by: trask <218610+trask@users.noreply.github.com> * Address review feedback for ErrorProne configuration Co-authored-by: trask <218610+trask@users.noreply.github.com> * Update settings.gradle.kts --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trask <218610+trask@users.noreply.github.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR synchronizes the ErrorProne configuration in Application Insights Java with the upstream OpenTelemetry Java instrumentation repository to ensure consistent code quality standards and take advantage of improvements made upstream.
Key Changes
Enhanced Configuration
testLatestDepssupport for future compatibility with latest dependency testing workflowsconcurrentlinkedhashmapand other vendored code patternsAdditional Disabled Checks (synced from OpenTelemetry)
PreferredInterfaceType- We often override methods returning Iterable; this makes it tedious for questionable valueImmutableRefactoring- Suggests using com.google.errorprone.annotations.Immutable vs javax.annotation.concurrent.ImmutableUnnecessarilyFullyQualified- Fully qualified names may be necessary when deprecating classesJava8ApiChecker- TODO: use animal sniffer insteadInitializeInline- Prevents lazy initialization patternsInlineMeSuggester- Triggers even when deprecated methods aren't calledDoNotCallSuggester- Can be overly restrictiveFieldMissingNullable,ParameterMissingNullable, etc.) - We have nullaway, don't need errorprone nullable checks with more false positivesTypeParameterNaming- Allow UPPERCASE type parameter namesMustBeClosedChecker- In bytecode instrumentation it's common to separate across onEnter/onExitMixedMutabilityReturnType- Common to avoid allocationJdkObsolete- We end up using obsolete types if libraries we're instrumenting use themDefaultPackage- We use this pattern in several testsPrivateConstructorForUtilityClass- Was missing explicit disableAvoidObjectArrays- Low-level APIs use arraysBanClassLoader- Needed for agent functionalityPreserved Application Insights Specific Configuration
MissingSummary,UnnecessaryDefaultInEnumSwitchJavaDurationGetSecondsToToSecondsdisable for Java 9+ featuresBuild Fixes
com.github.ben-manes.versionsplugin version to resolve build configuration issuesTesting
This brings our ErrorProne configuration in line with the upstream OpenTelemetry project while preserving Application Insights-specific requirements.
Fixes #92.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.