Skip to content

[Bug] Putting the implementation of an interface in an 'internal' package removes the ability to count using 'module.requests' metric #1712

@steam0

Description

@steam0

When I am developing modules, I would like to not expose my actual implementation to other modules but rather just expose the interface that other modules can import and use. See the below file tree as an example of what I would like to be able to do:

com.example
 -> ModuleA
    -> internal
        -> MyServiceImpl.kt
    -> MyService.kt

This works as intended when I run my application. ModuleB can import the MyService interface and the implementation gets autowired. However the metrics counter does not work. Calls to MyService are not counted by the module.requests metric.

The workaround is to place MyServiceImpl.kt in the root of the module. When I do that the module.requests metric count cross module calls as expected. Having to publicly expose the implementation feels like unintentional behaviour and I think this should count as a bug. See file tree below for an example how to make the metric work.

com.example
 -> ModuleA
    -> MyServiceImpl.kt
    -> MyService.kt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions