Skip to content

Commit 55d54fe

Browse files
authored
Document the meter-analyzer-config catalog in admin runtime-rule / dsl-debug (#233)
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.
1 parent 85e5afd commit 55d54fe

5 files changed

Lines changed: 4 additions & 9 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Release Notes.
1818
* Add the sub-command `profiling pprof` for pprof query API by @JophieQu in https://github.com/apache/skywalking-cli/pull/226
1919
* Add the `admin` command group for the OAP admin-server REST host (default port `17128`), with a new global `--admin-url` flag (derived from `--base-url` when unset). Covers every admin feature module: `admin preflight`; `admin cluster nodes`, `admin config dump|ttl`, `admin alarm rules|rule` (status); `admin inspect metrics|entities` (inspect); `admin ui-template list|get|create|update|disable` (ui-management); `admin runtime-rule list|bundled|get|add|inactivate|delete|dump` (runtime-rule); and `admin dsl-debug status|sessions|session start|get|stop` plus `admin oal files|file|rules|rule` (dsl-debugging).
2020
* Add the sub-command `admin inspect values` to read the VALUES of metric(s) an OAP does not define locally (foreign metrics) by supplying their `{valueColumn, valueType}` metadata, via the new `POST /inspect/values` admin API; returns the native MQE result.
21+
* Document the `meter-analyzer-config` catalog in `admin runtime-rule` and `admin dsl-debug session start`, matching the OAP-side support for native meter rule hot-update and MAL DSL debugging.
2122

2223
### Bug Fixes
2324

internal/commands/admin/dsldebug/dsldebug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $ swctl admin dsl-debug session start --catalog otel-rules --name vm --rule-name
8686
Flags: []cli.Flag{
8787
&cli.StringFlag{
8888
Name: "catalog",
89-
Usage: "session `catalog`: otel-rules / log-mal-rules / telegraf-rules / lal / oal",
89+
Usage: "session `catalog`: otel-rules / log-mal-rules / telegraf-rules / meter-analyzer-config / lal / oal",
9090
Required: true,
9191
},
9292
&cli.StringFlag{

internal/commands/admin/runtimerule/runtimerule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var Command = &cli.Command{
3636
UsageText: `Add, override, inactivate and delete MAL / LAL rule files at runtime without
3737
restarting OAP, and inspect the live and bundled rule state.
3838
39-
Catalogs: otel-rules, log-mal-rules, telegraf-rules, lal.`,
39+
Catalogs: otel-rules, log-mal-rules, telegraf-rules, meter-analyzer-config, lal.`,
4040
Subcommands: []*cli.Command{
4141
listCommand,
4242
bundledCommand,
@@ -51,7 +51,7 @@ Catalogs: otel-rules, log-mal-rules, telegraf-rules, lal.`,
5151
func catalogFlag(required bool) cli.Flag {
5252
return &cli.StringFlag{
5353
Name: "catalog",
54-
Usage: "rule `catalog`: otel-rules / log-mal-rules / telegraf-rules / lal",
54+
Usage: "rule `catalog`: otel-rules / log-mal-rules / telegraf-rules / meter-analyzer-config / lal",
5555
Required: required,
5656
}
5757
}

pkg/admin/dsldebug/dsldebug.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ const (
3636
MaxRetentionMillis = 60 * 60 * 1000
3737
)
3838

39-
// Catalogs accepted by a debug session.
40-
var Catalogs = []string{"otel-rules", "log-mal-rules", "telegraf-rules", "lal", "oal"}
41-
4239
// StartArgs holds the inputs of POST /dsl-debugging/session. Catalog, Name, RuleName
4340
// and ClientID are mandatory query params; RecordCap / RetentionMillis are optional and
4441
// sent as a JSON body only when set. Granularity (LAL only) is sent as a query param.

pkg/admin/runtimerule/runtimerule.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ import (
3131
"github.com/apache/skywalking-cli/pkg/admin/client"
3232
)
3333

34-
// Catalogs accepted by the runtime-rule endpoints.
35-
var Catalogs = []string{"otel-rules", "log-mal-rules", "telegraf-rules", "lal"}
36-
3734
// ApplyResult is the JSON envelope returned by addOrUpdate / inactivate / delete.
3835
type ApplyResult struct {
3936
ApplyStatus string `json:"applyStatus"`

0 commit comments

Comments
 (0)