You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "X-LightYear (via GitHub)" <gi...@apache.org> on 2026/09/22 16:26:33 UTC

[I] [Studio][Bug] Instance-scoped metrics queries ignore globally available data sources [rocketmq-dashboard]

X-LightYear opened a new issue, #4990:
URL: https://github.com/apache/rocketmq-dashboard/issues/4990

   ## Problem
   
   The metrics data-source contract documents an empty `instanceIds` list as a globally available data source. The normal data-source query path honors that contract, and the Metrics Explorer labels such a source as `Global`.
   
   The instance-scoped MCP metrics path does not. `MetricsService.queryInstance` filters `SettingsService.listDataSources()` to sources whose `instanceIds` explicitly contain the requested instance. A sole global source is therefore treated as if no source were configured and the request fails with HTTP 409.
   
   ## Reproduction
   
   1. Configure one Prometheus-compatible data source with an empty `instanceIds` list.
   2. Invoke the instance-scoped metrics tool for any configured instance, for example `instance-a`.
   3. The tool reaches `MetricsService.queryInstance("instance-a", query)`.
   
   Minimal deterministic regression setup:
   
   ```java
   DataSourceVO global = dataSource("ds-global", List.of());
   when(settingsService.listDataSources()).thenReturn(List.of(global));
   when(settingsService.getDataSource("ds-global")).thenReturn(global);
   when(metricsSourceFactory.create(any(MetricsDataSourceConfig.class))).thenReturn(metricsSource);
   when(metricsSource.query(any(MetricQueryDTO.class))).thenReturn(emptyMetricData());
   
   metricsService.queryInstance("instance-a", rawQuery());
   ```
   
   On current `rocketmq-studio`, this throws:
   
   ```text
   Configure exactly one metrics data source bound to Instance instance-a
   ```
   
   ## Expected behavior
   
   A sole global data source should be selected for an instance-scoped query, subject to the same ambiguity and authentication checks as an explicitly shared source.
   
   ## Actual behavior
   
   Global sources are excluded before source selection, so the instance-scoped query fails even though the source is intentionally configured for all instances.
   
   ## Root cause
   
   `MetricsService.queryInstance` defines `boundSources` using only `source.getInstanceIds().contains(instanceId)`. It omits the existing global-source semantics (`null` or empty bindings) used by `validateInstanceBinding` and the web data-source selector.
   
   ## Scope
   
   The minimal fix is limited to the source-selection predicate in `MetricsService.queryInstance`, plus deterministic service-level regression coverage. Explicit instance bindings and ambiguity behavior should remain unchanged.
   
   ## Duplicate check
   
   Historical #1260/#1178 and merged PR #1373 established instance binding enforcement and explicitly preserved unbound data sources as globally available. They cover the direct data-source query path and do not cover the MCP `queryInstance` selector, which still excludes global sources.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Studio][Bug] Instance-scoped metrics queries ignore globally available data sources [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #4990: [Studio][Bug] Instance-scoped metrics queries ignore globally available data sources
URL: https://github.com/apache/rocketmq-dashboard/issues/4990


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Studio][Bug] Instance-scoped metrics queries ignore globally available data sources [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4990:
URL: https://github.com/apache/rocketmq-dashboard/issues/4990#issuecomment-5901552174

   This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org