Skip to content

Conversation

Copy link

Copilot AI commented Aug 24, 2025

This PR updates the aws-resources module to follow the OpenTelemetry Java Contrib style guide by replacing manual service registration with @AutoService annotations.

Changes Made

  • Added @AutoService annotations to all ResourceProvider implementations (BeanstalkResourceProvider, Ec2ResourceProvider, EcsResourceProvider, EksResourceProvider, LambdaResourceProvider) and the AwsResourceDetector class
  • Made AwsResourceDetector final as it's in an internal package, following the style guide requirement that internal classes should be final where possible
  • Updated build.gradle.kts to include AutoService dependencies:
    • annotationProcessor("com.google.auto.service:auto-service")
    • compileOnly("com.google.auto.service:auto-service")
    • testImplementation("com.google.auto.service:auto-service")
  • Removed manual META-INF service registration files as they are now auto-generated by the @AutoService annotation processor

Benefits

  • Follows style guide conventions: Uses @AutoService for SPI registration as recommended in the style guide
  • Eliminates manual maintenance: Service registration files are now automatically generated at compile time
  • Reduces errors: No need to manually maintain service registration files that can get out of sync
  • Maintains backward compatibility: All existing functionality is preserved

The module now properly follows the OpenTelemetry Java Contrib style guide while maintaining all existing functionality. All tests continue to pass and the auto-generated service files are correctly included in the built JAR.

Fixes #234.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…nnotations

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Update aws-resources module to follow style guide Update aws-resources module to follow style guide Aug 24, 2025
Copilot AI requested a review from trask August 24, 2025 20:03
Copilot finished work on behalf of trask August 24, 2025 20:03
@trask trask closed this Aug 24, 2025
@trask trask deleted the copilot/fix-234 branch October 20, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update aws-resources module to follow style guide

2 participants