Skip to content

Add POST /inspect/values admin API to read foreign metric values#13927

Merged
wu-sheng merged 1 commit into
masterfrom
inspect-foreign-metric-values
Jun 24, 2026
Merged

Add POST /inspect/values admin API to read foreign metric values#13927
wu-sheng merged 1 commit into
masterfrom
inspect-foreign-metric-values

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Adds an admin-only POST /inspect/values that reads the values of a metric this OAP does not define locally (a "foreign" metric persisted by another OAP), by running the real MQE engine over caller-supplied {valueColumn, valueType}. The value-reading companion to the merged GET /inspect/entities foreign path (#13926).

A single request-scoped InspectQueryContext ThreadLocal makes the foreign metric look registered to every read path (provide-if-absent — the local catalog always wins): ValueColumnMetadata resolves its value column / type / scope, and the storage location registries resolve where it lives — MetadataRegistry synthesizes a BanyanDB measure schema, IndexController resolves the ES metrics-all index, TableHelper probes the JDBC function tables. The storage read paths need no per-DAO special-casing; the response is the native MQE ExpressionResult. Admin-only (a forced read this OAP cannot validate); not mirrored onto the public REST / GraphQL surface. The entity's scope-required fields are validated in the handler; a malformed entity is a 400.

Verified end-to-end: OAP-B reads a foreign metric's value (42) across BanyanDB, Elasticsearch, and PostgreSQL. The skywalking-cli admin inspect values command for this API was merged in apache/skywalking-cli#232.

Add the POST /inspect/values admin API to read foreign metric values

  • If this is non-trivial feature, paste the links/URLs to the design doc. — feature implementation (no SWIP); see the Inspect API doc.

  • Update the documentation to include this new feature. — docs/en/setup/backend/admin-api/inspect.md + admin-api index + CHANGES.

  • Tests(including UT, IT, E2E) are added to verify the new feature. — test/e2e-v2/cases/inspect/inspect-foreign-flow.sh step DataSender放弃NIO,使用标准Socket #5 across BanyanDB / ES / PostgreSQL (driven by swctl admin inspect values, cli Support application JVM info, based on instance discovery #232).

  • If it's UI related, attach the screenshots below.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.

  • Update the CHANGES log.

🤖 Generated with Claude Code

A new admin-only POST /inspect/values reads the VALUES of a metric this OAP does not
define locally (persisted by another OAP), by running the real MQE engine over
caller-supplied {valueColumn, valueType} — the value-reading companion to the merged
GET /inspect/entities foreign path (#13926).

A request-scoped InspectQueryContext ThreadLocal makes the foreign metric look
registered to every read path (provide-if-absent — the local catalog always wins):
ValueColumnMetadata resolves its value column / type / scope, and the storage location
registries resolve where it lives — MetadataRegistry synthesizes a BanyanDB measure
schema, IndexController resolves the ES metrics-all index, TableHelper probes the JDBC
function tables. The storage read paths need no per-DAO special-casing; the response is
the native MQE ExpressionResult. Verified end-to-end across banyandb/es/postgresql.
@wu-sheng wu-sheng added this to the 11.0.0 milestone Jun 24, 2026
@wu-sheng wu-sheng added backend OAP backend related. enhancement Enhancement on performance or codes labels Jun 24, 2026
@wu-sheng wu-sheng merged commit 4226f14 into master Jun 24, 2026
440 of 445 checks passed
@wu-sheng wu-sheng deleted the inspect-foreign-metric-values branch June 24, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. enhancement Enhancement on performance or codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants