Skip to content

Add admin inspect values to read foreign metric values#232

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

Add admin inspect values to read foreign metric values#232
wu-sheng merged 1 commit into
masterfrom
inspect-values-command

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Add the admin inspect values sub-command

Adds swctl admin inspect values, which reads the values of metric(s) the
target OAP does not define locally ("foreign" metrics) by supplying each
metric's {valueColumn, valueType} metadata. It POSTs to the new OAP admin API
POST /inspect/values, which runs the real MQE engine over the caller-supplied
metadata and returns the native MQE ExpressionResult (the same shape the UI
renders for catalog metrics).

Usage:

swctl --admin-url http://<oap>:17128 admin inspect values \
  --expression meter_foo \
  --service-name my-svc \
  --foreign-metric meter_foo,value,LONG \
  --start "-30m" --end "0m" --step MINUTE
  • The entity scope is inferred from which name flag is set
    (--service-name → Service, --service-instance-name → ServiceInstance,
    --endpoint-name → Endpoint).
  • --foreign-metric name,valueColumn,valueType is repeatable — supply one per
    foreign metric referenced by the expression.

This is the value-reading companion to the existing admin inspect entities
(which enumerates a foreign metric's entities). It targets the OAP-side
POST /inspect/values admin API (Apache SkyWalking 11.0.0).

  • If this is non-trivial feature, paste the links/URLs to the design doc. — N/A (feature implementation; see the OAP PR for the server side).
  • Update the documentation to include this new feature. — CHANGES.md updated; command help text included.
  • Tests(including UT, IT, E2E) are added to verify the new feature. — verified end-to-end against a live OAP serving /inspect/values; lint + unit tests pass. (The command's own e2e lands with the OAP API.)

🤖 Generated with Claude Code

The new sub-command POSTs to the OAP admin API `POST /inspect/values` to
evaluate an MQE expression over metric(s) the target OAP does not define
locally (foreign metrics), supplying each metric's {valueColumn, valueType}.
The entity scope is inferred from which name flag is set (--service-name /
--service-instance-name / --endpoint-name). Returns the native MQE result.
@wu-sheng wu-sheng added this to the 0.15.0 milestone Jun 24, 2026
@wu-sheng wu-sheng added the enhancement New feature or request label Jun 24, 2026
@wu-sheng wu-sheng merged commit 85e5afd into master Jun 24, 2026
7 checks passed
@wu-sheng wu-sheng deleted the inspect-values-command branch June 24, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants