lizhimins opened a new pull request, #4213:
URL: https://github.com/apache/rocketmq-dashboard/pull/4213

   Closes #4210
   
   ## Changes
   
   `CacheConfig` declares the `CacheManager` explicitly, removing the 
dependency on whatever Spring
   Boot cache auto-configuration resolves to in this application. It carries no 
fixed cache-name list,
   so `ConcurrentMapCacheManager` creates caches on first use and a future 
`@Cacheable` with a new
   name cannot fail the same way.
   
   `CacheConfigTest` mirrors the production wiring (`@EnableCaching` + 
`CacheConfig`) and asserts the
   manager hands out `data-sources`, hands out an arbitrary future name, and 
that the caching
   interceptor is present. It fails without this configuration — unlike 
`SettingsServiceCachingTest`,
   which supplies its own manager and therefore masked the missing wiring.
   
   The rest gives the metrics dashboard something to query, which the local 
stack did not have:
   
   - Both brokers export Prometheus metrics on 5557. `metricsPromExporterHost` 
is set to `0.0.0.0`
     explicitly — it defaults to `brokerIP1`, which leaves the endpoint 
unreachable from outside the
     container.
   - A `prometheus` service scrapes them by container name, so a rebuild 
changing the container IP
     needs no config change. Port 9090 binds to the loopback interface only.
   - `.env.example` points `STUDIO_METRICS_PROMETHEUS_BASE_URL` at that 
container. It cannot be a
     loopback address: `UrlHostGuard` rejects loopback for metrics data sources 
and the query fails
     with "base URL is invalid".
   
   ## Verification
   
   - `GET /api/settings/datasources` and `/page`: HTTP 500 → 200, and `Cannot 
find cache` no longer
     appears in the server log (it was logged on every request before).
   - Settings data-source tab and `/ops/dashboard` both load with no error 
alert.
   - End to end after wiring Prometheus: broker `/metrics` returns 200 (54KB / 
47KB), all scrape
     targets report `health: up`, `POST /api/metrics/query` returns a matrix 
with real samples, and
     the nine dashboard panels go from nine `Prometheus base URL is not 
configured` errors to zero.
   - `mvn test` for `CacheConfigTest`, `SettingsServiceCachingTest`, 
`SettingsServiceTest`,
     `SettingsControllerTest`: 69 passing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to