@dx-do/cli 5.2.49 → 5.2.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -6
- package/dist-node/01-discover-vertices.tas-pwngv2fz.md +31 -0
- package/dist-node/01-discover-vertices.tas.data-store-svjfrm1f.json5 +29 -0
- package/dist-node/01-discover-vertices.tas.data-store-tmd-w650nfzt.json +4 -0
- package/dist-node/02-discover-services.tas-867m0m88.md +30 -0
- package/dist-node/02-discover-services.tas.data-store-jz0gx5vn.json5 +40 -0
- package/dist-node/02-discover-services.tas.data-store-tmd-eq264m6y.json +4 -0
- package/dist-node/03-discover-sources.nassql-4tgp9jvv.md +34 -0
- package/dist-node/03-discover-sources.nassql.data-store-by6sqk23.json5 +63 -0
- package/dist-node/03-discover-sources.nassql.data-store-tmd-n3gy57wm.json +4 -0
- package/dist-node/04-discover-metadata-columns.nassql-vhzb0mrq.md +26 -0
- package/dist-node/04-discover-metadata-columns.nassql.data-store-c9zr7p0q.json5 +35 -0
- package/dist-node/04-discover-metadata-columns.nassql.data-store-tmd-4ygrjvty.json +4 -0
- package/dist-node/10-filter-attribute-matches.tas-tafqmtw1.md +33 -0
- package/dist-node/10-filter-attribute-matches.tas.data-store-tmd-m2sendv0.json +4 -0
- package/dist-node/10-filter-attribute-matches.tas.data-store-whdc6vbc.json5 +35 -0
- package/dist-node/11-filter-and-compose.tas-m8856738.md +29 -0
- package/dist-node/11-filter-and-compose.tas.data-store-dh5meyk8.json5 +56 -0
- package/dist-node/11-filter-and-compose.tas.data-store-tmd-mfn8a16f.json +4 -0
- package/dist-node/12-filter-or-not.tas-21zab96s.md +35 -0
- package/dist-node/12-filter-or-not.tas.data-store-7vjr4fnd.json5 +83 -0
- package/dist-node/12-filter-or-not.tas.data-store-tmd-am9smwe5.json +4 -0
- package/dist-node/13-filter-layer.tas-r1ff5anv.md +29 -0
- package/dist-node/13-filter-layer.tas.data-store-5mneyz77.json5 +30 -0
- package/dist-node/13-filter-layer.tas.data-store-tmd-9qmhyfzr.json +4 -0
- package/dist-node/14-filter-traverse.tas-da9jene0.md +38 -0
- package/dist-node/14-filter-traverse.tas.data-store-p0vxtfvj.json5 +63 -0
- package/dist-node/14-filter-traverse.tas.data-store-tmd-5hepg5wf.json +4 -0
- package/dist-node/15-filter-take-vertices-edges.tas-m160qc7z.md +35 -0
- package/dist-node/15-filter-take-vertices-edges.tas.data-store-drmcme43.json5 +46 -0
- package/dist-node/15-filter-take-vertices-edges.tas.data-store-tmd-8fewsp5s.json +4 -0
- package/dist-node/16-filter-projection.tas-dh39mcx8.md +31 -0
- package/dist-node/16-filter-projection.tas.data-store-tmd-3r8anggx.json +4 -0
- package/dist-node/16-filter-projection.tas.data-store-xjbdry1x.json5 +36 -0
- package/dist-node/17-filter-lucene.tas-gyvtzwaa.md +29 -0
- package/dist-node/17-filter-lucene.tas.data-store-1knw6srt.json5 +39 -0
- package/dist-node/17-filter-lucene.tas.data-store-tmd-5cf3tygg.json +5 -0
- package/dist-node/18-filter-variable-reuse.tas-89fq0y6x.md +46 -0
- package/dist-node/18-filter-variable-reuse.tas.data-store-by35113t.json5 +55 -0
- package/dist-node/18-filter-variable-reuse.tas.data-store-tmd-ak7aprgk.json +4 -0
- package/dist-node/19-filter-order-statefilter.tas-hm3z71qj.md +36 -0
- package/dist-node/19-filter-order-statefilter.tas.data-store-ra9hj1rz.json5 +51 -0
- package/dist-node/19-filter-order-statefilter.tas.data-store-tmd-wqer9xy2.json +4 -0
- package/dist-node/20-nassql-from-metadata-basic.nassql-szr2xax1.md +28 -0
- package/dist-node/20-nassql-from-metadata-basic.nassql.data-store-tmd-c7drxs1m.json +4 -0
- package/dist-node/20-nassql-from-metadata-basic.nassql.data-store-zdf1gp1v.json5 +42 -0
- package/dist-node/21-nassql-from-metadata-regex.nassql-78jnsn3e.md +30 -0
- package/dist-node/21-nassql-from-metadata-regex.nassql.data-store-ckzsv7h1.json5 +53 -0
- package/dist-node/21-nassql-from-metadata-regex.nassql.data-store-tmd-zgr6r9my.json +4 -0
- package/dist-node/22-nassql-from-topology.nassql-a71qw9r0.md +42 -0
- package/dist-node/22-nassql-from-topology.nassql.data-store-81m23nge.json5 +58 -0
- package/dist-node/22-nassql-from-topology.nassql.data-store-tmd-vhpjy6c7.json +4 -0
- package/dist-node/23-nassql-join-topology-metadata.nassql-hywxhcg2.md +35 -0
- package/dist-node/23-nassql-join-topology-metadata.nassql.data-store-da7q90n2.json5 +76 -0
- package/dist-node/23-nassql-join-topology-metadata.nassql.data-store-tmd-rr8wt9qa.json +4 -0
- package/dist-node/24-nassql-from-data-window-mean.nassql-q6qsgdxw.md +33 -0
- package/dist-node/24-nassql-from-data-window-mean.nassql.data-store-j7xmg7fc.json5 +81 -0
- package/dist-node/24-nassql-from-data-window-mean.nassql.data-store-tmd-qgzz2f7v.json +4 -0
- package/dist-node/25-nassql-group-order-top.nassql-awgnwn3r.md +30 -0
- package/dist-node/25-nassql-group-order-top.nassql.data-store-cmrn300b.json5 +48 -0
- package/dist-node/25-nassql-group-order-top.nassql.data-store-tmd-7xpqeh7c.json +4 -0
- package/dist-node/26-nassql-filter-predicate.nassql-2t27h5ev.md +41 -0
- package/dist-node/26-nassql-filter-predicate.nassql.data-store-k2rgp609.json5 +59 -0
- package/dist-node/26-nassql-filter-predicate.nassql.data-store-tmd-m4dddgwm.json +4 -0
- package/dist-node/27-nassql-distinct-keep.nassql-6z55dvk3.md +24 -0
- package/dist-node/27-nassql-distinct-keep.nassql.data-store-mrx00ys5.json5 +52 -0
- package/dist-node/27-nassql-distinct-keep.nassql.data-store-tmd-0p9hy42g.json +4 -0
- package/dist-node/28-nassql-format-time.nassql-6wraqgdk.md +30 -0
- package/dist-node/28-nassql-format-time.nassql.data-store-tmd-bbbqhz1x.json +4 -0
- package/dist-node/28-nassql-format-time.nassql.data-store-tvy8y2cs.json5 +59 -0
- package/dist-node/29-nassql-describe-log.nassql-t9vnxeb0.md +31 -0
- package/dist-node/29-nassql-describe-log.nassql.data-store-tmd-q4mtczy8.json +4 -0
- package/dist-node/29-nassql-describe-log.nassql.data-store-x16y4crx.json5 +51 -0
- package/dist-node/30-nassql-map-string.nassql-f2tdknzs.md +30 -0
- package/dist-node/30-nassql-map-string.nassql.data-store-t8ahcabn.json5 +53 -0
- package/dist-node/30-nassql-map-string.nassql.data-store-tmd-a6xq0bdx.json +4 -0
- package/dist-node/31-nassql-join-data-sum.nassql-p16y3xk6.md +26 -0
- package/dist-node/31-nassql-join-data-sum.nassql.data-store-dje7wm6v.json5 +64 -0
- package/dist-node/31-nassql-join-data-sum.nassql.data-store-tmd-c1pyx1qw.json +4 -0
- package/dist-node/32-nassql-bottom-aggregation.nassql-hpgfn77p.md +26 -0
- package/dist-node/32-nassql-bottom-aggregation.nassql.data-store-tmd-p0ssj1vc.json +4 -0
- package/dist-node/32-nassql-bottom-aggregation.nassql.data-store-v9580caa.json5 +43 -0
- package/dist-node/33-nassql-cross-domain-pipeline.nassql-fm0ynphf.md +45 -0
- package/dist-node/33-nassql-cross-domain-pipeline.nassql.data-store-tmd-18881drs.json +4 -0
- package/dist-node/33-nassql-cross-domain-pipeline.nassql.data-store-vqs9hkx4.json5 +79 -0
- package/dist-node/3rdpartylicenses-hx59bakt.txt +885 -0
- package/dist-node/50-discover-custom-layers.tas-2hvvpkzw.md +66 -0
- package/dist-node/50-discover-custom-layers.tas.data-store-h85zgna9.json5 +36 -0
- package/dist-node/50-discover-custom-layers.tas.data-store-tmd-hagn9eak.json +4 -0
- package/dist-node/51-collect-counts-everything.tas-nz0ksgdc.md +46 -0
- package/dist-node/51-collect-counts-everything.tas.data-store-eypcjah8.json5 +48 -0
- package/dist-node/51-collect-counts-everything.tas.data-store-tmd-4pcj94s9.json +4 -0
- package/dist-node/52-collect-counts-bulk.tas-eerw4z8s.md +54 -0
- package/dist-node/52-collect-counts-bulk.tas.data-store-scedtw1m.json5 +65 -0
- package/dist-node/52-collect-counts-bulk.tas.data-store-tmd-csyzj189.json +4 -0
- package/dist-node/53-collect-attributes-by-type.tas-cw0285hx.md +71 -0
- package/dist-node/53-collect-attributes-by-type.tas.data-store-fvjge4yr.json5 +65 -0
- package/dist-node/53-collect-attributes-by-type.tas.data-store-tmd-274qrd8f.json +4 -0
- package/dist-node/README-ghxecaz0.md +84 -0
- package/dist-node/SKILL-1xn7r9nt.md +104 -0
- package/dist-node/agent-25q752kd.md +55 -0
- package/dist-node/agent_connection_and_status-0dq7zkpc.md +62 -0
- package/dist-node/agent_source_collector-6s06n3rs.md +40 -0
- package/dist-node/agentic-mcp-rycd2gh8.md +140 -0
- package/dist-node/application-dfva8tz0.md +48 -0
- package/dist-node/application-m0q2vaxj.md +74 -0
- package/dist-node/attribute_resource_metric_name-pxrceab5.md +56 -0
- package/dist-node/browseragent-snippet.template-9megjp8a.html +12 -0
- package/dist-node/bulkvertexpatch-1a4qy5vb.md +78 -0
- package/dist-node/bundle.pbd-38r15kyd.template +13 -0
- package/dist-node/bundle.profile-1wpzpt3d.template +2 -0
- package/dist-node/business_transaction-mbqz5ex9.md +61 -0
- package/dist-node/chunk-4I3HBO6U-2ebgf7kh.js +127 -0
- package/dist-node/chunk-4PMCLJMS-0mqvr4m4.js +1 -0
- package/dist-node/chunk-5VSFINOX-ewzpx7wh.js +5 -0
- package/dist-node/chunk-72HYG3XZ-kf7hy4vs.js +3625 -0
- package/dist-node/chunk-JRM4BLOM-rg32z8w4.js +1 -0
- package/dist-node/chunk-Q2JA73UH-akkb8bh3.js +14 -0
- package/dist-node/chunk-RNMHSXZF-pdwasrg7.js +1358 -0
- package/dist-node/chunk-VV2FJEMA-3rvtkmga.js +321 -0
- package/dist-node/chunk-YVD3UK5I-9pxr1jka.js +695 -0
- package/dist-node/configuration-1vczsdex.md +104 -0
- package/dist-node/dashboards-x0xddksy.md +17 -0
- package/dist-node/database_or_inferred-8vqf5gyr.md +75 -0
- package/dist-node/default-licensing-config-0p879qpb.template +122 -0
- package/dist-node/dependency-3b0neg5x.md +40 -0
- package/dist-node/description.md-qwc2bj9r.template +30 -0
- package/dist-node/discovery-flow-fw79kbx4.md +116 -0
- package/dist-node/dxi_service-13prnpd5.md +59 -0
- package/dist-node/entity-relationships-cevz61kj.md +142 -0
- package/dist-node/gotchas-8ab64kcd.md +389 -0
- package/dist-node/host-es6fxtgx.md +46 -0
- package/dist-node/host-j3qqrm5f.md +55 -0
- package/dist-node/index-104hyb1m.html +13 -0
- package/dist-node/index-7fp2dfas.json +178 -0
- package/dist-node/index-g3hh5wez.json +403 -0
- package/dist-node/index-mbzg9rhc.json +270 -0
- package/dist-node/index-qffdhwgm.json +2479 -0
- package/dist-node/inferred-w998vfq1.md +41 -0
- package/dist-node/installInstructions.md-k9ghf3dr.template +21 -0
- package/dist-node/inventorize-xc9h9bjr.md +34 -0
- package/dist-node/investigation-planning-6kcm01h9.md +149 -0
- package/dist-node/investigator-flow-jc2s0n46.md +186 -0
- package/dist-node/k8s_deployment_and_namespace-69c29152.md +88 -0
- package/dist-node/k8s_pod_and_container-9h4v6cmj.md +64 -0
- package/dist-node/main-SGLYO5YX-ht69eb0y.js +13 -0
- package/dist-node/main.js +397415 -0
- package/dist-node/marketplace-srdmzxkj.json +15 -0
- package/dist-node/metric-source-names-6cbczyks.md +75 -0
- package/dist-node/metrics-grounding-2h4kkbe3.md +130 -0
- package/dist-node/mm-cookbook-23jpw721.md +231 -0
- package/dist-node/mm-quickstart-x2adfc16.md +106 -0
- package/dist-node/nassql-cookbook-n8kc0mff.md +812 -0
- package/dist-node/nassql-quickstart-090e0yex.md +149 -0
- package/dist-node/plugin-c3bavxvf.json +18 -0
- package/dist-node/polyfills-A7ZF72EO-mp884a0b.js +2 -0
- package/dist-node/prerendered-routes-523d8gat.json +3 -0
- package/dist-node/primeicons-4GST5W3O-jac3wxrf.woff2 +0 -0
- package/dist-node/primeicons-DHQU4SEP-760n99pp.svg +345 -0
- package/dist-node/primeicons-GEFHGEHP-rc4kaa3b.ttf +0 -0
- package/dist-node/primeicons-P53SE5CV-4saz3d5j.woff +0 -0
- package/dist-node/primeicons-RSSEDYLY-4d4vbd67.eot +0 -0
- package/dist-node/query-vs-analysis-separation-sag1ezcq.md +97 -0
- package/dist-node/run-query-vs-run-partial-6138pc94.md +80 -0
- package/dist-node/service-5pz5nhzf.md +133 -0
- package/dist-node/service-hierarchies-87a4ynpj.md +178 -0
- package/dist-node/service-k4f5mkbq.md +51 -0
- package/dist-node/servlet_or_frontend-1kjcb7ar.md +76 -0
- package/dist-node/src-apm-mfnsq6vw.svg +4 -0
- package/dist-node/src-axa-nn28yqmj.svg +4 -0
- package/dist-node/src-dxim-fv7ne4qa.svg +4 -0
- package/dist-node/styles-23VUPSCU-9ehggc1f.css +1 -0
- package/dist-node/tas-cookbook-0y4826rp.md +693 -0
- package/dist-node/tas-quickstart-wgcvwffc.md +138 -0
- package/dist-node/time-format-0595g01j.md +41 -0
- package/dist-node/toggles.pbd-9wscbmng.template +2 -0
- package/dist-node/type-host-agbhmn6v.svg +6 -0
- package/dist-node/type-metric-p9b90bpx.svg +4 -0
- package/dist-node/type-service-k7f1x71k.svg +4 -0
- package/dist-node/ui-0b5grqrg.md +113 -0
- package/dist-node/universe-b9nhf325.md +47 -0
- package/dist-node/universe-fzpwzvxr.md +91 -0
- package/dist-node/universes-and-scopes-1cb9pfk7.md +105 -0
- package/dist-node/vertex_entity_node-mm3yp9d0.md +31 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The simplest NASSQL pipeline — count all metrics on the tenant.
|
|
3
|
+
* The "hello world" of NASSQL: FROM_METADATA → COUNT → KEEP.
|
|
4
|
+
*
|
|
5
|
+
* `FROM_METADATA` returns one row per registered metric definition
|
|
6
|
+
* (NOT per datapoint). COUNT collapses to a single number. The
|
|
7
|
+
* total scales with how much telemetry the tenant collects;
|
|
8
|
+
* single thousands → tens of thousands is normal.
|
|
9
|
+
*/
|
|
10
|
+
{
|
|
11
|
+
"query": [
|
|
12
|
+
/*
|
|
13
|
+
* FROM_METADATA loads metric DEFINITIONS as rows. The `ALL`
|
|
14
|
+
* specifier matches every metric; an alternative spec narrows.
|
|
15
|
+
* `alias` names this stage's output (referenceable downstream
|
|
16
|
+
* via `<alias>.<column>` if you do JOINs).
|
|
17
|
+
*/
|
|
18
|
+
{
|
|
19
|
+
"op": "FROM_METADATA",
|
|
20
|
+
"querySpecifier": { "op": "ALL" },
|
|
21
|
+
"alias": "all_metrics"
|
|
22
|
+
},
|
|
23
|
+
/*
|
|
24
|
+
* COUNT with no `columns` field → count all rows (regardless
|
|
25
|
+
* of grouping). With a preceding GROUP, COUNT is per-group.
|
|
26
|
+
* `as: "total"` names the resulting column.
|
|
27
|
+
*/
|
|
28
|
+
{
|
|
29
|
+
"op": "COUNT",
|
|
30
|
+
"as": "total"
|
|
31
|
+
},
|
|
32
|
+
/*
|
|
33
|
+
* KEEP must be the LAST op (server returns HTTP 400 if anything
|
|
34
|
+
* follows). Selects which columns appear in the response.
|
|
35
|
+
*/
|
|
36
|
+
{
|
|
37
|
+
"op": "KEEP",
|
|
38
|
+
"columns": ["total"]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"limit": 10
|
|
42
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 21-nassql-from-metadata-regex (NASSQL)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Demonstrate `FROM_METADATA` with a `SPEC` query specifier that uses REGEX patterns to filter by source name and attribute path.
|
|
6
|
+
|
|
7
|
+
## Query Construction
|
|
8
|
+
|
|
9
|
+
The `querySpecifier` uses the `SPEC` op with two nested specifiers:
|
|
10
|
+
- `sourceNameSpecifier: { op: "REGEX", pattern: ".*Infrastructure.*" }` — matches sources containing "Infrastructure"
|
|
11
|
+
- `attributeNameSpecifier: { op: "REGEX", pattern: ".*CPU.*" }` — matches metric paths containing "CPU"
|
|
12
|
+
|
|
13
|
+
This finds CPU metrics reported by Infrastructure agents.
|
|
14
|
+
|
|
15
|
+
## API Surface Exercised
|
|
16
|
+
|
|
17
|
+
- **FROM_METADATA** with `SPEC` specifier
|
|
18
|
+
- **SourceNameSpecifier**: `REGEX` op with `pattern`
|
|
19
|
+
- **AttributeNameSpecifier**: `REGEX` op with `pattern`
|
|
20
|
+
- **KEEP**: Column selection
|
|
21
|
+
|
|
22
|
+
## Expected Output
|
|
23
|
+
|
|
24
|
+
Up to 50 rows with columns `["metric.source", "metric.path"]`. Each row is a metric whose source contains "Infrastructure" and whose path contains "CPU".
|
|
25
|
+
|
|
26
|
+
## What the Results Tell You
|
|
27
|
+
|
|
28
|
+
The `SPEC` specifier is the most flexible metadata query mechanism. It composes independent specifiers for source name, attribute/path name, and folder name. Each sub-specifier supports its own set of ops (`ALL`, `REGEX`, `EXACT`, `PART`, `AND`, `OR`, `NOT`).
|
|
29
|
+
|
|
30
|
+
Important: You cannot put `{ op: "REGEX", source: "...", path: "..." }` directly as the `querySpecifier`. The REGEX must be nested inside a `SPEC` with `sourceNameSpecifier` and/or `attributeNameSpecifier`.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `FROM_METADATA` with a structured `SPEC` querySpecifier — narrow
|
|
3
|
+
* which metrics enter the pipeline. Two filter axes, both optional:
|
|
4
|
+
* sourceNameSpecifier → narrows by metric.source value
|
|
5
|
+
* attributeNameSpecifier → narrows by metric attribute name
|
|
6
|
+
*
|
|
7
|
+
* Each can be REGEX (Java regex) or EXACT (literal). Combine them
|
|
8
|
+
* to find "all CPU metrics from Infrastructure-* sources" etc.
|
|
9
|
+
*
|
|
10
|
+
* Cheaper + cleaner than loading ALL metrics and filtering with
|
|
11
|
+
* a downstream FILTER op — the spec narrows server-side.
|
|
12
|
+
*/
|
|
13
|
+
{
|
|
14
|
+
"query": [
|
|
15
|
+
{
|
|
16
|
+
"op": "FROM_METADATA",
|
|
17
|
+
/*
|
|
18
|
+
* `querySpecifier` shapes WHICH metric metadata rows enter
|
|
19
|
+
* the pipeline. `op: SPEC` is the structured form; `op:
|
|
20
|
+
* ALL` (cheaper, no narrowing) is the alternative.
|
|
21
|
+
*
|
|
22
|
+
* Both specifiers are AND-combined when present. Missing
|
|
23
|
+
* means "no constraint on that axis."
|
|
24
|
+
*/
|
|
25
|
+
"querySpecifier": {
|
|
26
|
+
"op": "SPEC",
|
|
27
|
+
/*
|
|
28
|
+
* Narrow by source. REGEX takes a Java pattern;
|
|
29
|
+
* `.*Infrastructure.*` matches any source name
|
|
30
|
+
* containing "Infrastructure" (case-sensitive). For
|
|
31
|
+
* EXACT match, use `op: EXACT, names: ["..."]`.
|
|
32
|
+
*/
|
|
33
|
+
"sourceNameSpecifier": {
|
|
34
|
+
"op": "REGEX",
|
|
35
|
+
"pattern": ".*Infrastructure.*"
|
|
36
|
+
},
|
|
37
|
+
/*
|
|
38
|
+
* Narrow by metric attribute name. Same shape.
|
|
39
|
+
*/
|
|
40
|
+
"attributeNameSpecifier": {
|
|
41
|
+
"op": "REGEX",
|
|
42
|
+
"pattern": ".*CPU.*"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"alias": "cpu_metrics"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"op": "KEEP",
|
|
49
|
+
"columns": ["metric.source", "metric.path"]
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"limit": 50
|
|
53
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 22-nassql-from-topology (NASSQL)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Demonstrate `FROM_TOPOLOGY`, which loads TAS topology vertices into a NASSQL tabular result for further processing with NASSQL operations.
|
|
6
|
+
|
|
7
|
+
## Query Construction
|
|
8
|
+
|
|
9
|
+
`FROM_TOPOLOGY` takes a `querySpecifier` that is a **full TAS query object** (with `filter`), not a metadata query specifier:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"op": "FROM_TOPOLOGY",
|
|
14
|
+
"querySpecifier": {
|
|
15
|
+
"filter": {
|
|
16
|
+
"op": "ATTRIBUTE",
|
|
17
|
+
"expressions": [{ "name": "type", "values": ["HOST"], "operator": "IN" }]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The TAS query result is flattened into tabular rows. Each vertex attribute becomes a column prefixed with `vertex.attr.`, and vertex metadata becomes `vertex.id`, `vertex.externalId`, `vertex.startTime`, `vertex.endTime`.
|
|
24
|
+
|
|
25
|
+
## API Surface Exercised
|
|
26
|
+
|
|
27
|
+
- **FROM_TOPOLOGY**: Cross-domain bridge from topology to tabular NASSQL
|
|
28
|
+
- **TAS filter inside NASSQL**: Reuses the full TAS query model
|
|
29
|
+
- **KEEP**: Select specific vertex attribute columns
|
|
30
|
+
|
|
31
|
+
## Expected Output
|
|
32
|
+
|
|
33
|
+
Up to 20 rows, each representing a HOST vertex with columns like:
|
|
34
|
+
- `vertex.attr.name` — host name
|
|
35
|
+
- `vertex.attr.type` — "HOST"
|
|
36
|
+
- `vertex.externalId` — canonical external ID (e.g., `INFRASTRUCTURE:HOST:...`)
|
|
37
|
+
|
|
38
|
+
## What the Results Tell You
|
|
39
|
+
|
|
40
|
+
`FROM_TOPOLOGY` is the key cross-domain operation that connects topology data with metric data. After loading topology vertices as rows, you can `JOIN_METADATA` or `JOIN_DATA` to enrich them with metrics.
|
|
41
|
+
|
|
42
|
+
Critical: The `querySpecifier` here is a TAS query, NOT a metric query specifier. It must include `filter` and optionally `projection`, `limit`, etc.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `FROM_TOPOLOGY` — load TAS query results into a NASSQL pipeline
|
|
3
|
+
* as rows (one row per matched vertex). The bridge from the graph
|
|
4
|
+
* world (TAS) to the tabular world (NASSQL).
|
|
5
|
+
*
|
|
6
|
+
* Use when the question is "tabular questions ABOUT entities":
|
|
7
|
+
* - Group hosts by region and count
|
|
8
|
+
* - Sort agents by name and paginate
|
|
9
|
+
* - Compute statistics across vertex attributes
|
|
10
|
+
*
|
|
11
|
+
* For "graph questions" (neighbors, paths, traversal), stay in TAS.
|
|
12
|
+
*
|
|
13
|
+
* The vertex attributes appear as columns prefixed `vertex.attr.<n>`;
|
|
14
|
+
* the vertex's own metadata appears as `vertex.externalId`,
|
|
15
|
+
* `vertex.id`, `vertex.startTime`, etc.
|
|
16
|
+
*/
|
|
17
|
+
{
|
|
18
|
+
"query": [
|
|
19
|
+
/*
|
|
20
|
+
* FROM_TOPOLOGY's querySpecifier is `{ filter: <TASFilter> }`
|
|
21
|
+
* — a wrapper around a normal TAS filter. Anything you can
|
|
22
|
+
* write at the TAS top level can go here.
|
|
23
|
+
*
|
|
24
|
+
* NOTE: `querySpecifier.filter` is a TAS FILTER, not a TAS
|
|
25
|
+
* QUERY (no `limit`/`projection`/etc. fields). The parent
|
|
26
|
+
* NASSQL query's `limit` controls overall row count.
|
|
27
|
+
*/
|
|
28
|
+
{
|
|
29
|
+
"op": "FROM_TOPOLOGY",
|
|
30
|
+
"querySpecifier": {
|
|
31
|
+
"filter": {
|
|
32
|
+
"op": "ATTRIBUTE",
|
|
33
|
+
"expressions": [
|
|
34
|
+
{
|
|
35
|
+
"name": "type",
|
|
36
|
+
"values": ["HOST"],
|
|
37
|
+
"operator": "IN"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"alias": "hosts"
|
|
43
|
+
},
|
|
44
|
+
/*
|
|
45
|
+
* Column names from FROM_TOPOLOGY:
|
|
46
|
+
* vertex.attr.<attrname> — any vertex attribute
|
|
47
|
+
* vertex.externalId — canonical string id
|
|
48
|
+
* vertex.id — numeric internal id
|
|
49
|
+
* vertex.startTime — vertex creation timestamp
|
|
50
|
+
* vertex.endTime — vertex deletion timestamp
|
|
51
|
+
*/
|
|
52
|
+
{
|
|
53
|
+
"op": "KEEP",
|
|
54
|
+
"columns": ["vertex.attr.name", "vertex.attr.type", "vertex.externalId"]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"limit": 20
|
|
58
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 23-nassql-join-topology-metadata (NASSQL)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Demonstrate the full cross-domain pipeline: load topology vertices, join with metric metadata, then aggregate — answering "how many metrics does each agent report?"
|
|
6
|
+
|
|
7
|
+
## Query Construction
|
|
8
|
+
|
|
9
|
+
Six-step pipeline:
|
|
10
|
+
1. **FROM_TOPOLOGY**: Load AGENT vertices from TAS
|
|
11
|
+
2. **JOIN_METADATA**: Join each agent vertex with its metric metadata (ALL specifier)
|
|
12
|
+
3. **GROUP**: Group by agent name and type
|
|
13
|
+
4. **COUNT**: Count metrics per agent
|
|
14
|
+
5. **ORDER**: Sort by metric count descending
|
|
15
|
+
6. **KEEP**: Select output columns
|
|
16
|
+
|
|
17
|
+
## API Surface Exercised
|
|
18
|
+
|
|
19
|
+
- **FROM_TOPOLOGY** + **JOIN_METADATA**: The fundamental cross-domain join pattern
|
|
20
|
+
- **GROUP + COUNT + ORDER**: Standard aggregation pipeline
|
|
21
|
+
- **KEEP**: Column selection
|
|
22
|
+
|
|
23
|
+
## Expected Output
|
|
24
|
+
|
|
25
|
+
Up to 20 rows showing each agent name with its metric count, sorted from most to fewest:
|
|
26
|
+
|
|
27
|
+
| vertex.attr.name | vertex.attr.type | metric_count |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Kubernetes Agent (node-1) | AGENT | 3000+ |
|
|
30
|
+
| Infrastructure Agent | AGENT | 1500+ |
|
|
31
|
+
| ... | ... | ... |
|
|
32
|
+
|
|
33
|
+
## What the Results Tell You
|
|
34
|
+
|
|
35
|
+
This pipeline demonstrates the most common real-world pattern: start with topology entities, enrich with metrics, then aggregate for a dashboard view. The `JOIN_METADATA` operation correlates each topology vertex with the metric sources that belong to it (based on the vertex's external ID mapping to metric source paths).
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Cross-domain pipeline — load topology rows (FROM_TOPOLOGY), then
|
|
3
|
+
* JOIN with metric metadata (JOIN_METADATA) to count metrics per
|
|
4
|
+
* entity. Demonstrates the FROM_<source> + JOIN_<other-source>
|
|
5
|
+
* pattern that's the workhorse of "things × their metrics" queries.
|
|
6
|
+
*
|
|
7
|
+
* Result: one row per agent with the count of metrics that agent
|
|
8
|
+
* publishes. Use this shape to find noisy agents, coverage gaps,
|
|
9
|
+
* or to build dashboards that pair topology + metric counts.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: this counts METADATA rows (metric definitions per agent),
|
|
12
|
+
* not DATAPOINTS. For "what value did this metric have last hour"
|
|
13
|
+
* questions, switch JOIN_METADATA → JOIN_DATA (separate cookbook).
|
|
14
|
+
*/
|
|
15
|
+
{
|
|
16
|
+
"query": [
|
|
17
|
+
/*
|
|
18
|
+
* Source 1: agent vertices.
|
|
19
|
+
*/
|
|
20
|
+
{
|
|
21
|
+
"op": "FROM_TOPOLOGY",
|
|
22
|
+
"querySpecifier": {
|
|
23
|
+
"filter": {
|
|
24
|
+
"op": "ATTRIBUTE",
|
|
25
|
+
"expressions": [
|
|
26
|
+
{
|
|
27
|
+
"name": "type",
|
|
28
|
+
"values": ["AGENT"],
|
|
29
|
+
"operator": "IN"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"alias": "agents"
|
|
35
|
+
},
|
|
36
|
+
/*
|
|
37
|
+
* JOIN_METADATA enriches each row with metric metadata for
|
|
38
|
+
* the corresponding entity. The join key is implicit
|
|
39
|
+
* (DataStore knows how to match topology vertices to their
|
|
40
|
+
* metrics). After JOIN_METADATA, columns include both
|
|
41
|
+
* vertex.attr.* (from FROM_TOPOLOGY) AND metric.* (from
|
|
42
|
+
* JOIN_METADATA).
|
|
43
|
+
*
|
|
44
|
+
* `querySpecifier: { op: ALL }` includes all metrics the
|
|
45
|
+
* entity publishes; for a narrower join use `op: SPEC` (see
|
|
46
|
+
* #21 for the regex pattern).
|
|
47
|
+
*/
|
|
48
|
+
{
|
|
49
|
+
"op": "JOIN_METADATA",
|
|
50
|
+
"querySpecifier": { "op": "ALL" },
|
|
51
|
+
"alias": "agent_metrics"
|
|
52
|
+
},
|
|
53
|
+
/*
|
|
54
|
+
* GROUP by agent — collapses the joined rows back to one
|
|
55
|
+
* row per agent. This is the "metric count per agent"
|
|
56
|
+
* shape: one row out per group in.
|
|
57
|
+
*/
|
|
58
|
+
{
|
|
59
|
+
"op": "GROUP",
|
|
60
|
+
"columns": ["vertex.attr.name", "vertex.attr.type"]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"op": "COUNT",
|
|
64
|
+
"as": "metric_count"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"op": "ORDER",
|
|
68
|
+
"columns": [{ "column": "metric_count", "sortDescending": true }]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"op": "KEEP",
|
|
72
|
+
"columns": ["vertex.attr.name", "vertex.attr.type", "metric_count"]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"limit": 20
|
|
76
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 24-nassql-from-data-window-mean (NASSQL)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Demonstrate the `FROM` (data) source operation combined with `WINDOW` and `MEAN` to compute time-windowed averages — the fundamental time-series aggregation pattern.
|
|
6
|
+
|
|
7
|
+
## Query Construction
|
|
8
|
+
|
|
9
|
+
Five-step pipeline:
|
|
10
|
+
1. **FROM**: Load actual metric data values (not just metadata) for CPU Utilization metrics from Infrastructure agents
|
|
11
|
+
2. **GROUP**: Group by `metric.source` (one group per agent)
|
|
12
|
+
3. **WINDOW**: Window into 1-hour intervals (`every: 3600000` ms)
|
|
13
|
+
4. **MEAN**: Compute average of `data.value` within each window
|
|
14
|
+
5. **KEEP**: Select source and average
|
|
15
|
+
|
|
16
|
+
## API Surface Exercised
|
|
17
|
+
|
|
18
|
+
- **FROM**: Source operation that loads time-series data values (unlike FROM_METADATA which loads only metric registration info)
|
|
19
|
+
- **WINDOW**: Time-based windowing with `every` (milliseconds)
|
|
20
|
+
- **MEAN**: Aggregation operation with `column` and `as`
|
|
21
|
+
- **GROUP**: Must precede WINDOW to define the grouping dimension
|
|
22
|
+
|
|
23
|
+
The `FROM` columns are: `data.time`, `data.value`, `metric.source`, `metric.path`.
|
|
24
|
+
|
|
25
|
+
## Expected Output
|
|
26
|
+
|
|
27
|
+
Rows with `metric.source` and `avg_cpu` for each hour. May return 0 rows if the default query time range has no data for these metrics.
|
|
28
|
+
|
|
29
|
+
## What the Results Tell You
|
|
30
|
+
|
|
31
|
+
The `FROM` operation loads actual metric data values (time-series points), not just metadata. Combined with `WINDOW` + aggregation, this enables time-series analytics. The `GROUP` must come before `WINDOW` to establish the grouping key. The pipeline order matters: GROUP → WINDOW → aggregation → KEEP.
|
|
32
|
+
|
|
33
|
+
Note: `WINDOW` uses `every` (milliseconds), not `windowSizeMs`. For calendar-aligned windows, use `WINDOW_CALENDAR` with `calendarInterval` instead.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `FROM` (datapoints) + WINDOW + MEAN — the time-series workhorse.
|
|
3
|
+
* Where FROM_METADATA returns metric DEFINITIONS (one row per
|
|
4
|
+
* metric), `FROM` returns DATAPOINTS (one row per metric per
|
|
5
|
+
* timestamp). Use FROM whenever the question involves values
|
|
6
|
+
* over time (CPU last hour, latency now, error rate trend).
|
|
7
|
+
*
|
|
8
|
+
* `WINDOW + MEAN` is the canonical "average over time bucket"
|
|
9
|
+
* pattern. Bucket size set by `WINDOW.every` (epoch ms);
|
|
10
|
+
* 3600000 = 1h. After WINDOW each row has a `time.bucket` column
|
|
11
|
+
* representing the bucket start.
|
|
12
|
+
*
|
|
13
|
+
* NEVER author a FROM-without-time-window for "right now" questions
|
|
14
|
+
* — the response includes EVERY datapoint in the default range and
|
|
15
|
+
* scales with metric volume × time. Bound it with a window.
|
|
16
|
+
*/
|
|
17
|
+
{
|
|
18
|
+
"query": [
|
|
19
|
+
/*
|
|
20
|
+
* `FROM` is the datapoints source op. Same querySpecifier
|
|
21
|
+
* shapes as FROM_METADATA (ALL or SPEC with regex/exact);
|
|
22
|
+
* here narrowed to Infrastructure-source CPU utilization.
|
|
23
|
+
*
|
|
24
|
+
* Default time range is implementation-defined (recent past);
|
|
25
|
+
* for a custom range, set `time` on the parent envelope.
|
|
26
|
+
*/
|
|
27
|
+
{
|
|
28
|
+
"op": "FROM",
|
|
29
|
+
"querySpecifier": {
|
|
30
|
+
"op": "SPEC",
|
|
31
|
+
"sourceNameSpecifier": {
|
|
32
|
+
"op": "REGEX",
|
|
33
|
+
"pattern": ".*Infrastructure.*"
|
|
34
|
+
},
|
|
35
|
+
"attributeNameSpecifier": {
|
|
36
|
+
"op": "REGEX",
|
|
37
|
+
"pattern": ".*CPU.*Utilization.*"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"alias": "cpu_data"
|
|
41
|
+
},
|
|
42
|
+
/*
|
|
43
|
+
* GROUP by source — collapses to one logical series per
|
|
44
|
+
* metric source. Required before WINDOW + MEAN if you want
|
|
45
|
+
* per-source averages (vs a single global average).
|
|
46
|
+
*/
|
|
47
|
+
{
|
|
48
|
+
"op": "GROUP",
|
|
49
|
+
"columns": ["metric.source"]
|
|
50
|
+
},
|
|
51
|
+
/*
|
|
52
|
+
* WINDOW.every is the bucket width in milliseconds:
|
|
53
|
+
* 60000 = 1 minute
|
|
54
|
+
* 300000 = 5 minutes
|
|
55
|
+
* 3600000 = 1 hour
|
|
56
|
+
* 86400000 = 1 day
|
|
57
|
+
*
|
|
58
|
+
* After WINDOW, downstream aggregations (MEAN, SUM, MIN, MAX,
|
|
59
|
+
* PERCENTILE) operate per bucket per group.
|
|
60
|
+
*/
|
|
61
|
+
{
|
|
62
|
+
"op": "WINDOW",
|
|
63
|
+
"every": 3600000
|
|
64
|
+
},
|
|
65
|
+
/*
|
|
66
|
+
* MEAN per bucket per group. `column: data.value` references
|
|
67
|
+
* the datapoint value. `as: avg_cpu` names the result column.
|
|
68
|
+
* Alternatives: SUM, MIN, MAX, MEDIAN, PERCENTILE, STDDEV.
|
|
69
|
+
*/
|
|
70
|
+
{
|
|
71
|
+
"op": "MEAN",
|
|
72
|
+
"column": "data.value",
|
|
73
|
+
"as": "avg_cpu"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"op": "KEEP",
|
|
77
|
+
"columns": ["metric.source", "avg_cpu"]
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"limit": 50
|
|
81
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 25-nassql-group-order-top (NASSQL)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Demonstrate the `TOP` shaping operation, which efficiently selects the top N rows by a column value.
|
|
6
|
+
|
|
7
|
+
## Query Construction
|
|
8
|
+
|
|
9
|
+
Pipeline: FROM_METADATA → GROUP → COUNT → TOP → KEEP
|
|
10
|
+
|
|
11
|
+
The `TOP` operation takes:
|
|
12
|
+
- `column`: The column to rank by
|
|
13
|
+
- `n`: How many rows to keep (schema field is `n`, not `count`)
|
|
14
|
+
|
|
15
|
+
## API Surface Exercised
|
|
16
|
+
|
|
17
|
+
- **TOP**: Selects the top N rows by a numeric column
|
|
18
|
+
- **GROUP + COUNT**: Standard aggregation producing the ranking column
|
|
19
|
+
|
|
20
|
+
## Expected Output
|
|
21
|
+
|
|
22
|
+
Exactly 10 rows: the 10 metric sources with the most metrics, each with `metric.source` and `metric_count`.
|
|
23
|
+
|
|
24
|
+
Typical top metric sources are things like OpenTelemetry-fed app traffic, Kubernetes agents per cluster, and Infrastructure agents per host — exact ranking and counts depend on what's reporting on the tenant.
|
|
25
|
+
|
|
26
|
+
## What the Results Tell You
|
|
27
|
+
|
|
28
|
+
`TOP` is more efficient than `ORDER + LIMIT` for selecting the highest-ranked rows, as it can use partial sorting. The companion operation `BOTTOM` selects the lowest-ranked rows (see query 32).
|
|
29
|
+
|
|
30
|
+
Schema note: The field is `n` (number), not `count`. This matches the Java source `QueryTopSpec.n`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `TOP` — efficient "top N rows by column" selection. Compared to
|
|
3
|
+
* ORDER + LIMIT, TOP can use partial sorting and is the right op
|
|
4
|
+
* when you specifically want the N highest-ranked rows.
|
|
5
|
+
*
|
|
6
|
+
* Pipeline shape: FROM_METADATA → GROUP → COUNT → TOP → KEEP.
|
|
7
|
+
* Same shape works for any "top N <X> by <metric>" question.
|
|
8
|
+
*
|
|
9
|
+
* Schema gotcha: the field is `n` (number of rows), NOT `count`.
|
|
10
|
+
* Easy to mis-author from intuition. Companion op `BOTTOM` (#32)
|
|
11
|
+
* works the same way for the lowest-ranked rows.
|
|
12
|
+
*/
|
|
13
|
+
{
|
|
14
|
+
"query": [
|
|
15
|
+
{
|
|
16
|
+
"op": "FROM_METADATA",
|
|
17
|
+
"querySpecifier": { "op": "ALL" },
|
|
18
|
+
"alias": "all_metadata"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"op": "GROUP",
|
|
22
|
+
"columns": ["metric.source"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"op": "COUNT",
|
|
26
|
+
"as": "metric_count"
|
|
27
|
+
},
|
|
28
|
+
/*
|
|
29
|
+
* TOP keeps the N rows with the HIGHEST values in `column`.
|
|
30
|
+
* `n` (singular int) — NOT `count`, NOT `top`. The schema
|
|
31
|
+
* field is exactly `n`. (Java source: QueryTopSpec.n)
|
|
32
|
+
*
|
|
33
|
+
* If multiple rows tie for the boundary value, behavior is
|
|
34
|
+
* implementation-defined; don't depend on which tie-broken
|
|
35
|
+
* rows make the cut.
|
|
36
|
+
*/
|
|
37
|
+
{
|
|
38
|
+
"op": "TOP",
|
|
39
|
+
"column": "metric_count",
|
|
40
|
+
"n": 10
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"op": "KEEP",
|
|
44
|
+
"columns": ["metric.source", "metric_count"]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"limit": 10
|
|
48
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 26-nassql-filter-predicate (NASSQL)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Demonstrate the `FILTER` operation with a `NUMERIC` predicate spec to filter rows based on computed values.
|
|
6
|
+
|
|
7
|
+
## Query Construction
|
|
8
|
+
|
|
9
|
+
Pipeline: FROM_METADATA → GROUP → COUNT → FILTER → ORDER → KEEP
|
|
10
|
+
|
|
11
|
+
The `FILTER` operation uses a `spec` object:
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"op": "NUMERIC",
|
|
15
|
+
"column": "metric_count",
|
|
16
|
+
"operator": "GT",
|
|
17
|
+
"value": 2000
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This keeps only sources where `metric_count > 2000`.
|
|
22
|
+
|
|
23
|
+
## API Surface Exercised
|
|
24
|
+
|
|
25
|
+
- **FILTER**: Row filtering with predicate specs
|
|
26
|
+
- **NUMERIC predicate**: `{ op: "NUMERIC", column, operator, value }`
|
|
27
|
+
- **NumericOperator**: `GT` (also: `GE`, `LT`, `LE`, `EQ`, `NE`)
|
|
28
|
+
|
|
29
|
+
Other predicate types available:
|
|
30
|
+
- `IN`: `{ op: "IN", column, values: [...] }`
|
|
31
|
+
- `REGEX`: `{ op: "REGEX", column, pattern, ignoreCase }`
|
|
32
|
+
- `EXPR`: `{ op: "EXPR", spec: "expression_string" }`
|
|
33
|
+
- Boolean: `AND`, `OR`, `NOT` composing other predicates
|
|
34
|
+
|
|
35
|
+
## Expected Output
|
|
36
|
+
|
|
37
|
+
Only metric sources with more than 2000 metrics. On a busy tenant a handful of sources usually qualify (OpenTelemetry, Kubernetes agents, etc.); a quiet lab tenant may have none.
|
|
38
|
+
|
|
39
|
+
## What the Results Tell You
|
|
40
|
+
|
|
41
|
+
`FILTER` is applied after aggregation, making it equivalent to SQL's `HAVING` clause. It operates on computed columns (like `metric_count` from COUNT), not just source data columns. The predicate spec system supports arbitrary nesting via AND/OR/NOT.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `FILTER` — row-level filtering with predicate specs. Equivalent
|
|
3
|
+
* to SQL's `HAVING` when applied after aggregation, or `WHERE`
|
|
4
|
+
* when applied before. Operates on COMPUTED columns (like
|
|
5
|
+
* metric_count from COUNT), not just source columns.
|
|
6
|
+
*
|
|
7
|
+
* The `spec` field shape is a discriminated union:
|
|
8
|
+
* { op: NUMERIC, column, operator: GT|GE|LT|LE|EQ|NE, value }
|
|
9
|
+
* { op: IN, column, values: [...] }
|
|
10
|
+
* { op: REGEX, column, pattern, ignoreCase }
|
|
11
|
+
* { op: EXPR, spec: "<expression string>" }
|
|
12
|
+
* { op: AND|OR|NOT, ... } — compose other predicates
|
|
13
|
+
*
|
|
14
|
+
* Default to FILTER for "more than N" / "matches X" / "within
|
|
15
|
+
* range" questions. Default to TOP/BOTTOM for "highest/lowest N".
|
|
16
|
+
*/
|
|
17
|
+
{
|
|
18
|
+
"query": [
|
|
19
|
+
{
|
|
20
|
+
"op": "FROM_METADATA",
|
|
21
|
+
"querySpecifier": { "op": "ALL" },
|
|
22
|
+
"alias": "all_metrics"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"op": "GROUP",
|
|
26
|
+
"columns": ["metric.source"]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"op": "COUNT",
|
|
30
|
+
"as": "metric_count"
|
|
31
|
+
},
|
|
32
|
+
/*
|
|
33
|
+
* FILTER applied AFTER aggregation = SQL HAVING semantics.
|
|
34
|
+
* Per-row predicate; rows where the spec evaluates true
|
|
35
|
+
* pass through.
|
|
36
|
+
*
|
|
37
|
+
* NUMERIC operators: GT (>), GE (>=), LT (<), LE (<=),
|
|
38
|
+
* EQ (=), NE (!=). For string predicates use REGEX.
|
|
39
|
+
*/
|
|
40
|
+
{
|
|
41
|
+
"op": "FILTER",
|
|
42
|
+
"spec": {
|
|
43
|
+
"op": "NUMERIC",
|
|
44
|
+
"column": "metric_count",
|
|
45
|
+
"operator": "GT",
|
|
46
|
+
"value": 2000
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"op": "ORDER",
|
|
51
|
+
"columns": [{ "column": "metric_count", "sortDescending": true }]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"op": "KEEP",
|
|
55
|
+
"columns": ["metric.source", "metric_count"]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"limit": 50
|
|
59
|
+
}
|