Skip to content

servletEnabled not working when using dropwizard-core:4.0.3 and metrics-jakarta.servlets:4.2.21 #8748

@rorytorneymf

Description

@rorytorneymf

Setting:

admin:
  healthChecks:
    servletEnabled: false

as per the instructions here:

https://www.dropwizard.io/en/release-4.0.x/manual/configuration.html#health-checks

results in the healthcheck-enabled attribute getting set:

handler.getServletContext().setAttribute(HealthCheckServlet.HEALTH_CHECK_REGISTRY, healthChecks);

However, the AdminServlet is checking for an initParamater rather than an attribute:

https://github.com/dropwizard/metrics/blob/v4.2.21/metrics-servlets/src/main/java/com/codahale/metrics/servlets/AdminServlet.java#L115

image

Also, am I right in thinking that, even if the above works, servletEnabled: false only affects the links shown, and the actual servlet/endpoint is still enabled and can still be accessed?

Many thanks

Versions:

dropwizard-core:4.0.3
metrics-jakarta.servlets:4.2.21

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleStale issue or pull request which will be closed soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions