/dotmgt/metrics has no servlet mapping and returns 404, breaking the metrics-monitoring compose example
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem
/dotmgt/metrics returns a dotCMS 404 on the management port. InfrastructureManagementFilter recognises the path and calls forwardToManagementServlet, but no servlet is mapped for it, so the forward resolves to nothing.
There is no metrics servlet mapping anywhere in the repo — and origin/main has zero occurrences of one, so this has never worked rather than having regressed.
Reproduce
- Start dotCMS with the management port enabled (8090 by default).
curl -i http://localhost:8090/dotmgt/metrics
Result: dotCMS 404 page.
Expected: a Prometheus-format scrape, or an explicit "metrics disabled" response.
/dotmgt/livez, /dotmgt/readyz and /dotmgt/health on the same port all respond correctly, so this is specific to the metrics path.
Impact
docker/docker-compose-examples/single-node-metrics-monitoring ships a Prometheus scrape config pointed at this endpoint. That example cannot work as documented — Prometheus scrapes a 404 indefinitely.
Acceptance criteria
GET /dotmgt/metricson the management port returns the Prometheus exposition of the Micrometer registry.- The
single-node-metrics-monitoringcompose example scrapes successfully, with a non-empty target in Prometheus. - When metrics are disabled by configuration, the endpoint returns a deliberate response documenting that rather than a 404.
- Authentication behaviour matches the other
/dotmgt/*endpoints (seeDOT_HEALTH_DETAILED_AUTHENTICATION_REQUIREDand the equivalent metrics flags).
Notes
Blocked in practice by the metrics registry never initializing (filed separately, #36995) — a mapped endpoint would expose an empty registry until that is fixed. Both are needed for the compose example to work.
Found while verifying #36803 / #36864 on a local cluster; not caused by them.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with InfrastructureManagementFilter and inspect the management servlet mappings plus the equivalent metrics authentication and configuration flags. Reproduce with curl against /dotmgt/metrics, then verify the docker/docker-compose-examples/single-node-metrics-monitoring scrape configuration. Done means the endpoint returns Prometheus output or a deliberate disabled response and the compose example reports a non-empty target; coordinate with #36995 for registry initialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, java
- Domain
- backend, devops, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100