Skip to content

Document the meter-analyzer-config catalog in admin runtime-rule / admin dsl-debug - #233

Merged
wu-sheng merged 1 commit into
masterfrom
fix/meter-analyzer-config-catalog-help
Aug 8, 2026
Merged

Document the meter-analyzer-config catalog in admin runtime-rule / admin dsl-debug#233
wu-sheng merged 1 commit into
masterfrom
fix/meter-analyzer-config-catalog-help

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Context

apache/skywalking#13969 brings the meter-analyzer-config catalog (native MeterReportService rules) to parity with otel-rules: those rules now load through the shared Rules/RuleSetMerger pipeline, so a meter rule can be hot-added, structurally edited, or inactivated at runtime, and attached to a MAL DSL debug session — without restarting OAP.

Does swctl need a functional change? No.

On the wire that OAP change is purely additive — one more value in the shared Catalog enum:

OTEL_RULES("otel-rules"),
LOG_MAL_RULES("log-mal-rules"),
TELEGRAF_RULES("telegraf-rules"),
+METER_ANALYZER_CONFIG("meter-analyzer-config"),
LAL("lal"),

No new endpoints, no new request/response fields, no changed payload shapes. And swctl already passes it through:

  • There is no client-side catalog allow-list — --catalog reaches the server verbatim.
  • pkg/admin/runtimerule only ever calls the canonical/runtime/rule/{list,bundled,addOrUpdate,inactivate,delete,dump} routes; it never maps a catalog onto the /runtime/mal/otel-style shortcuts. That matters, because meter-analyzer-config is one of the two catalogs (with telegraf-rules) that deliberately has no shortcut route.

The e2e added in that same OAP PR (test/e2e-v2/cases/runtime-rule/meter/meter-runtime-rule-flow.sh) is the proof: it sets CATALOG="meter-analyzer-config" and drives all five phases — bundled visibility, hot add, structural edit with converter replacement, DSL debug session, inactivate — entirely through swctl admin runtime-rule … and swctl admin dsl-debug session … against an unmodified CLI.

What this PR does

What was stale is discoverability — --help still advertised only four catalogs.

  • Add meter-analyzer-config to the --catalog flag help of admin runtime-rule and admin dsl-debug session start, and to the admin runtime-rule catalog list.
  • Drop the two unreferenced Catalogs vars in pkg/admin/{runtimerule,dsldebug}. Nothing read them — they were a second copy of the catalog list, free to drift out of sync with OAP's enum, and this change is exactly the drift they would have caused. The rendered help text is now the single place the list lives; keeping it out of a client-side allow-list means a newer OAP catalog keeps working without a CLI release.
  • CHANGES.md entry under 0.15.0.

Verification

$ swctl admin runtime-rule add --help
--catalog catalog rule catalog: otel-rules / log-mal-rules / telegraf-rules / meter-analyzer-config / lal
$ swctl admin dsl-debug session start --help
--catalog catalog session catalog: otel-rules / log-mal-rules / telegraf-rules / meter-analyzer-config / lal / oal

go build ./..., go vet, and go test ./pkg/admin/... ./internal/commands/admin/... all pass. make lint fails identically before and after (40 pre-existing lll violations in untouched files); this change adds none.

🤖 Generated with Claude Code

…dsl-debug
apache/skywalking#13969 brings native meter (MeterReportService) rules to
parity with otel-rules: they now load through the shared Rules pipeline, so a
meter rule can be hot-added, overridden or inactivated at runtime and attached
to a MAL DSL debug session. On the wire that is purely additive — one more
value in the shared `Catalog` enum (`METER_ANALYZER_CONFIG`). No new endpoints,
no new request or response fields.
swctl therefore needs no functional change: `--catalog` is passed through
verbatim, and pkg/admin/runtimerule only ever calls the canonical
`/runtime/rule/...` routes, never the per-catalog shortcut routes that
`meter-analyzer-config` deliberately lacks. The OAP-side e2e added in that
commit already drives the whole flow (bundled / add / edit / dsl-debug /
inactivate) through `swctl admin ...` against this catalog.
What was stale was discoverability, so:
- add `meter-analyzer-config` to the `--catalog` flag help of
`admin runtime-rule` and `admin dsl-debug session start`, and to the
`admin runtime-rule` catalog list.
- drop the two unreferenced `Catalogs` vars in pkg/admin/{runtimerule,dsldebug}.
Nothing read them — they were a second copy of the catalog list, free to
drift out of sync with OAP's enum, and this change is exactly the drift they
would have caused. The rendered help text is now the single place the list
lives; widening it is not a client-side allow-list, so a newer OAP catalog
keeps working without a CLI release.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wu-sheng
wu-sheng requested a balanced review from CopilotAugust 8, 2026 00:19
@wu-shengwu-sheng added this to the 0.15.0 milestone Aug 8, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents OAP’s new meter-analyzer-config catalog without changing CLI behavior.

Changes:

  • Updates runtime-rule and DSL-debug help text.
  • Removes unused catalog-list variables.
  • Adds a 0.15.0 changelog entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
pkg/admin/runtimerule/runtimerule.goRemoves unused catalog list.
pkg/admin/dsldebug/dsldebug.goRemoves unused catalog list.
internal/commands/admin/runtimerule/runtimerule.goDocuments the meter catalog.
internal/commands/admin/dsldebug/dsldebug.goDocuments meter DSL debugging.
CHANGES.mdRecords the documentation update.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wu-shengwu-sheng added the chore Chores of the project label Aug 8, 2026
@wu-sheng
wu-sheng merged commit 55d54fe into masterAug 8, 2026
8 checks passed
@wu-sheng
wu-sheng deleted the fix/meter-analyzer-config-catalog-help branch August 8, 2026 00:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

choreChores of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@wu-sheng@mrproliu