cx-datasets

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Datasets Skill

数据集 Skill

Coralogix data lives in datasets, addressed as
<dataspace>/<dataset>
— e.g.
default/logs
,
default/rum.events
,
system/labs.limitViolations
. Every DataPrime query starts with
source <dataspace>/<dataset>
, so before querying an unfamiliar team (or a source you are not sure exists), list what is actually queryable instead of guessing names.
Coralogix 数据位于 datasets 中,使用
<dataspace>/<dataset>
寻址——例如
default/logs
、
default/rum.events
、
system/labs.limitViolations
。每个 DataPrime 查询都始于
source <dataspace>/<dataset>
,因此,在查询陌生团队(或不确定 source 是否存在)之前,应先列出实际可查询的数据集,而不是猜测名称。

CLI Commands

CLI 命令

CommandPurposeKey flags
cx datasets list
List every dataset queryable by the current profile's team
--filter <DPXL>
cx datasets list -o json
Same, as a JSON array of dataset rows-
  • Supports
    -p <profile>
    (repeatable) for multi-profile fan-out; a
    profile
    key is added to each JSON row when more than one profile is targeted.
  • Read-only — no
    --yes
    confirmation needed.
命令用途关键参数
cx datasets list
列出当前 profile 所属团队可查询的所有数据集
--filter <DPXL>
cx datasets list -o json
以 JSON 数组形式返回相同的数据集行-
  • 支持使用
    -p <profile>
    (可重复)进行 multi-profile 扇出;针对多个 profile 时,每个 JSON 行都会增加一个
    profile
    键。
  • 只读操作——无需使用
    --yes
    确认。

Dataset Row Fields

数据集行字段

FieldMeaning
dataspace
The dataset's dataspace, e.g.
default
or
system
dataset
The dataset name inside its dataspace, e.g.
logs
,
rum.events
pillar
The pillar the data belongs to:
logs
,
spans
,
data
, ...
entityType
The entity type behind the dataset, e.g.
logs
,
browserLogs/v2
,
jsonData
version
The latest dataset version
teamId
The team that owns the dataset
Only read-enabled, latest-version datasets are returned. The
Source
column in text output is the copy-pasteable
source
argument.
字段含义
dataspace
数据集所属的 dataspace,例如
default
或
system
dataset
dataspace 内的数据集名称,例如
logs
、
rum.events
pillar
数据所属的 pillar:
logs
、
spans
、
data
等
entityType
数据集对应的实体类型,例如
logs
、
browserLogs/v2
、
jsonData
version
数据集的最新版本
teamId
拥有该数据集的团队
仅返回已启用读取权限的最新版本数据集。文本输出中的
Source
列可直接复制,作为
source
参数。

Workflow

工作流

  1. List the datasets to see what exists:
    bash
    cx datasets list
    cx datasets list -o json | jq -r '.[] | .dataspace + "/" + .dataset' | sort
  2. Narrow with a DPXL filter when looking for a specific pillar or dataspace:
    bash
    cx datasets list --filter "<v1> \$d.pillar == 'logs'"
    cx datasets list --filter "<v1> \$d.dataspace == 'default' && \$d.pillar == 'data'"
    cx datasets list --filter "<v1> \$d.dataset.contains('rum')" -o json
  3. Query the dataset with DataPrime, using the full source name:
    bash
    cx dataprime query --source default/checkoutservice_dataset 'filter $d.severity == ERROR'
    cx dataprime query --source system/labs.limitViolations 'filter $m.timestamp > now()-1h'
    --source
    is a
    cx dataprime query
    flag —
    cx logs
    and
    cx spans
    always query the legacy
    logs
    /
    spans
    datasets and take no source override.
  1. 列出数据集,查看存在哪些数据集:
    bash
    cx datasets list
    cx datasets list -o json | jq -r '.[] | .dataspace + "/" + .dataset' | sort
  2. 使用 DPXL 过滤器缩小范围,查找特定的 pillar 或 dataspace:
    bash
    cx datasets list --filter "<v1> \$d.pillar == 'logs'"
    cx datasets list --filter "<v1> \$d.dataspace == 'default' && \$d.pillar == 'data'"
    cx datasets list --filter "<v1> \$d.dataset.contains('rum')" -o json
  3. 使用完整的 source 名称通过 DataPrime 查询数据集:
    bash
    cx dataprime query --source default/checkoutservice_dataset 'filter $d.severity == ERROR'
    cx dataprime query --source system/labs.limitViolations 'filter $m.timestamp > now()-1h'
    --source
    是
    cx dataprime query
    的 flag——
    cx logs
    和
    cx spans
    始终查询旧版的
    logs
    /
    spans
    数据集,且不接受 source 覆盖。

DPXL Filter Syntax

DPXL 过滤语法

--filter
takes a DPXL expression including its version tag — it must start with
<v1>
. An expression missing the tag is rejected with a 400. In double-quoted shells (bash/zsh), escape the
$
as
\$d
so the shell does not expand it — the examples above are copy-paste safe.
Available fields:
$d.dataspace
,
$d.dataset
,
$d.pillar
,
$d.entityType
,
$d.teamId
. Compare with
==
/
!=
and combine with
&&
/
||
. Substring matching uses method-call syntax —
$d.dataset.contains('rum')
(case-sensitive substring), not an infix
contains
operator.
--filter
接受包含版本标记的 DPXL 表达式——必须以
<v1>
开头。缺少该标记的表达式会收到 400 错误。在双引号 shell(bash/zsh)中,将
$
转义为
\$d
,避免 shell 对其进行展开——上面的示例可安全地直接复制。
可用字段包括:
$d.dataspace
、
$d.dataset
、
$d.pillar
、
$d.entityType
、
$d.teamId
。可使用
==
/
!=
进行比较,并使用
&&
/
||
组合条件。子字符串匹配使用方法调用语法——
$d.dataset.contains('rum')
(区分大小写的子字符串),而不是中缀
contains
操作符。

Key Principles

关键原则

  • Never guess dataset names — a query against a wrong source fails or, worse, silently returns the wrong data. List first, then query.
  • The source is
    <dataspace>/<dataset>
    — both parts are needed in DataPrime
    source
    commands;
    default/logs
    not just
    logs
    .
  • Use
    -o json
    with
    jq
    when you need just the source strings:
    cx datasets list -o json | jq -r '.[] | .dataspace + "/" + .dataset'
    .
  • Filter server-side with
    --filter
    rather than listing everything and grepping locally — same result, less output to parse.
  • Multi-profile fan-out with
    -p <profile>
    (repeatable) lists datasets across environments in one call.
  • 绝不猜测数据集名称——使用错误的 source 执行查询会失败,更糟的是可能静默返回错误数据。请先列出,再查询。
  • source 是
    <dataspace>/<dataset>
    ——DataPrime
    source
    命令需要两部分;应使用
    default/logs
    ,不能只写
    logs
    。
  • 只需要 source 字符串时,使用
    -o json
    配合
    jq
    :
    cx datasets list -o json | jq -r '.[] | .dataspace + "/" + .dataset'
    。
  • 使用
    --filter
    在服务器端过滤
    ,而不是列出全部内容后在本地 grep——结果相同,但需要解析的输出更少。
  • 使用
    -p <profile>
    (可重复)进行 multi-profile 扇出
    ,一次调用即可列出各环境中的数据集。

Related Skills

相关 Skills

  • cx-telemetry-querying
    — run the DataPrime queries against the datasets discovered here (logs, spans, metrics, RUM).
  • cx-telemetry-querying
    ——针对此处发现的数据集运行 DataPrime 查询(logs、spans、metrics、RUM)。