Skip to content

Muzzle check plugin should verify that TypeInstrumentations are applied #2780

Open
@mateuszrzeszutek

Description

@mateuszrzeszutek

Is your feature request related to a problem? Please describe.
Currently when running the muzzle task we verify that the generated ReferenceMatcher and the classLoaderMatcher() match the library classloader (for each tested version). We do not verify the TypeInstrumentation typeMatcher() and transformers() method matchers whatsoever.
This leads to unfortunate findings that parts of our instrumentation actually do not work for some library versions (for example netty-4.0 AbstractChannelHandlerContextInstrumentation).

Describe the solution you'd like
The muzzle check gradle plugin should execute TypeInstrumentation matchers and check if they're applied at least once.
Since this pretty much requires iterating over every class in the application classloader this verification MUST NOT run in the javaagent runtime, this should be a gradle-only feature that only executes during build time.

Additional context
Mentioned in: #536

Does muzzle fail if an Instrumentation doesn't match anything? E.g. seems it doesn't fail if it doesn't match, see running muzzle against elasticsearch 7 doesn't fail Elasticsearch6TransportClientInstrumentation even though Action class doesn't exist anymore

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:buildIssues about build infra, both local and centralenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions