Skip to content

Extend GET /inspect/entities to inspect foreign metrics persisted by any OAP#13926

Open
wu-sheng wants to merge 3 commits into
masterfrom
extend-inspect-api-foreign-metric
Open

Extend GET /inspect/entities to inspect foreign metrics persisted by any OAP#13926
wu-sheng wants to merge 3 commits into
masterfrom
extend-inspect-api-foreign-metric

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Extend GET /inspect/entities to inspect a metric persisted by any OAP (foreign metric)

/inspect/entities previously enumerated entities only for metrics defined on the queried OAP. This extends it so a metric persisted by any OAP — one this node never loaded the OAL/MAL/runtime-rule for — can be inspected when the caller supplies the metric's valueColumn + valueType.

  • The storage backend resolves the physical index/table/group from its own running config — no DB schema / table-metadata read:
    • Elasticsearch — merged metrics-all index + metric_table discriminator.
    • JDBC — probes the node's function tables by the table_name discriminator.
    • BanyanDB — synthesizes a read-only measure schema.
  • entity_id is decoded structurally (service / 2nd-level / relations) with a generic name leaf; scope is no longer required for the foreign path.
  • Locally-defined metrics keep the exact field names, scope, and mqeEntity (behavior unchanged).
  • Reads are optimistic — errors surface to the caller; a metric unknown locally without valueColumn/valueType returns a clear 400 steering the caller to the foreign path.

swctl admin inspect entities gains --value-column / --value-type (apache/skywalking-cli#230); SW_CTL_COMMIT is bumped to the cli commit that ships them, and a 2-OAP inspect e2e (aware + foreign) is wired across BanyanDB / ES / PostgreSQL.

  • This is an API extension, not a SWIP-level feature — no design doc.
  • Update the documentation to include this new feature. (docs/en/setup/backend/admin-api/inspect.md)
  • Tests (UT + E2E) are added to verify the new feature. (EntityDecoderTest + test/e2e-v2/cases/inspect/ across BanyanDB/ES/PostgreSQL)
  • Update the CHANGES log.

wu-sheng added 2 commits June 23, 2026 22:08
…any OAP

The inspect admin API could only enumerate entities for metrics defined on the
queried OAP. Extend it so a metric persisted by ANY OAP — one this node never
loaded the OAL/MAL/runtime-rule for — can be inspected when the caller supplies
the metric's valueColumn + valueType. The backend resolves the physical
index/table/group from its own running config (no DB schema read): ES uses the
merged metrics-all index + metric_table discriminator, JDBC probes the node's
function tables by the table_name discriminator, BanyanDB synthesizes a read-only
measure schema. entity_id is decoded structurally (scope-free); locally-defined
metrics keep exact field names, scope and mqeEntity.

Adds a two-OAP inspect e2e (aware + foreign) across BanyanDB/ES/PostgreSQL driven
by 'swctl admin inspect entities --value-column/--value-type' (apache/skywalking-cli#230;
SW_CTL_COMMIT bumped to the cli commit that includes the flags).
The listEntities javadoc used @param valueColumn / @param valueType, but the
Optional parameters are named valueColumnOpt / valueTypeOpt, so javadoc failed
with 'error: @param name not found' (failOnError), breaking the dist build and
every dependent e2e job. Move the valueColumn/valueType documentation into the
method-description list so there are no @param tags to mismatch.
@wu-sheng wu-sheng added this to the 11.0.0 milestone Jun 23, 2026
@wu-sheng wu-sheng added backend OAP backend related. enhancement Enhancement on performance or codes labels Jun 23, 2026
Metrics is not imported in TableHelper (only used in the doc), so JDK 11's
doclint rejects the simple-name {@link} with 'reference not found', failing the
dist build at :storage-jdbc-hikaricp-plugin. Newer local JDKs (21/25) resolve it
via the classpath and don't flag it. Use {@code Metrics} to match the sibling
{@code ServiceTraffic}/... refs — no import, no reference resolution. Verified
the javadoc build of all changed modules under temurin-11.
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.

1 participant