Skip to content

feat(dashboard): support per-target multi-datasource queries - #2238

Draft
jsers wants to merge 5 commits into
mainfrom
feat-dashboard-multi-datasource-query
Draft

feat(dashboard): support per-target multi-datasource queries#2238
jsers wants to merge 5 commits into
mainfrom
feat-dashboard-multi-datasource-query

Conversation

@jsers

@jsers jsers commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Allow each panel query target to carry its own datasource so a single panel can mix datasources. Mixed panels render via SingleTargetQueryEditor reusing each datasource's existing QueryBuilder; single-datasource panels keep the existing per-plugin builder path.

  • Add ITarget.datasource and a v4 migrator that normalizes legacy mode/expr targets to kind-based targets on dashboard load.
  • Introduce datasource registry/contract/service/requestState for the new /api/n9e/v2/query-batch rendering path with expression dependency resolution.
  • Unify expression detection on isExpressionTarget across plugin builders so migrated targets keep rendering after save/reload.
  • Omit field.key when spreading onto nested Form.Items to fix React duplicate-key warnings; add query.mixed_datasource i18n key.

Allow each panel query target to carry its own datasource so a single
panel can mix datasources. Mixed panels render via SingleTargetQueryEditor
reusing each datasource's existing QueryBuilder; single-datasource panels
keep the existing per-plugin builder path.

- Add ITarget.datasource and a v4 migrator that normalizes legacy
  __mode__/expr targets to kind-based targets on dashboard load.
- Introduce datasource registry/contract/service/requestState for the
  new /api/n9e/v2/query-batch rendering path with expression dependency
  resolution.
- Unify expression detection on isExpressionTarget across plugin builders
  so migrated targets keep rendering after save/reload.
- Omit field.key when spreading onto nested Form.Items to fix React
  duplicate-key warnings; add query.mixed_datasource i18n key.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ca8a49de-125f-44b2-afa7-83eb5f711043

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jsers added 4 commits August 4, 2026 21:12
Spread elasticsearch/opensearch query.values into one backend query per
value, preserving the first value's RefID and allocating unique sub
RefIDs for the rest. Normalize responses back to the originating target
while letting an exact-match RefID win over a value-query prefix match.
Also port each datasource's legacy isQueryReady short-circuit so
unprepared targets are silently skipped without triggering validation.
… usage

- migrate Menu.Item children to Menu items prop in DashboardLinks, Detail/Title, Renderer/Main
- add hidden input child to hidden Form.Item in ES QueryPanel/Values, OrganizeFields, TransformationsEditorNG
- reset fields before setFieldsValue in DataLinks FormModal
- move setTableFields side effect from useMemo to useEffect in TableNG
…datasource-query

# Conflicts:
#	src/pages/dashboard/Editor/index.tsx
#	src/pages/dashboard/Renderer/Renderer/Main.tsx
#	src/pages/dashboard/Renderer/Renderer/TableNG/index.tsx
#	src/pages/dashboard/Renderer/Renderer/Timeseries/index.tsx
Strip the `key` field before spreading Form.List field props onto
Form.Item / Form.List to silence the React key-spread warning across
the Elasticsearch query editor and plugin AdvancedSettings components.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant