antithesis-query-logs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Antithesis Logs Explorer

Antithesis Logs Explorer

Purpose and Goal

用途与目标

Search across all timelines in an Antithesis test run to find events, correlate property failures, and answer temporal questions about ordering and causation — cascade elimination, fault correlation, root cause hypothesis testing, and any "if X happened before Y" query.
The Logs Explorer is distinct from the per-example log viewer used in triage. The triage log viewer shows one timeline centered on one event. The Logs Explorer searches across ALL timelines in a run, supports temporal queries (preceded by, not preceded by, followed by, not followed by), and visualizes results on a multiverse map.
在Antithesis测试运行的所有时间线中进行搜索,以查找事件、关联属性失败,并解答关于顺序和因果关系的时序问题——包括排除连锁故障、关联故障、测试根因假设,以及任何“X是否发生在Y之前”的查询。
Logs Explorer 与分类排查(triage)中使用的单示例日志查看器不同。分类排查日志查看器仅显示以单个事件为中心的一条时间线,而Logs Explorer 会搜索一次运行中的所有时间线,支持时序查询(先于、不先于、后于、不后于),并在多元宇宙图谱(multiverse map)上可视化结果。

When to Use

使用场景

  • Investigating whether a property failure is independent or a cascade from an earlier failure
  • Counting how many independent occurrences of a failure exist across timelines
  • Correlating failures with fault injection events
  • Comparing failure patterns between backend configurations
  • Identifying timeline clusters where failures co-occur
  • 调查属性失败是独立故障还是由早期故障引发的连锁反应
  • 统计跨时间线的独立故障发生次数
  • 将故障与故障注入事件相关联
  • 对比不同后端配置下的故障模式
  • 识别故障共同发生的时间线集群

Prerequisites

前提条件

  • A completed Antithesis run. If you don't have a specific run URL, use the
    antithesis-triage
    skill's run discovery workflow to find one first.
  • agent-browser
    installed and authenticated to the Antithesis tenant
  • 已完成的Antithesis测试运行。如果没有特定的运行URL,请先使用
    antithesis-triage
    技能的运行发现工作流找到一个。
  • 已安装
    agent-browser
    并完成Antithesis租户的身份验证

Key Concepts

核心概念

  • Temporal query: Search for event X that is (or is not) preceded by or followed by event Y. Used to filter out cascade failures.
  • Multiverse map: Visualization of the timeline tree. Failures appear as dots. Clusters of dots on related timelines suggest a shared root cause.
  • Independent cluster count: The number of distinct timeline branches where a failure appears. "8 failures in 2 clusters" is much more informative than just "8 failures" — it tells you how many independent reproductions exist.
  • Session ID: Each run has a unique session ID that scopes all queries. Queries against the wrong session return no results. The session ID is embedded in the encoded search URL parameter.
  • Temporal query(时序查询):搜索事件X是否在事件Y之前(或不先于)、之后(或不后于)发生,用于过滤连锁故障。
  • Multiverse map(多元宇宙图谱):时间线树的可视化展示,故障以圆点形式呈现。相关时间线上的圆点集群表明存在共同根因。
  • Independent cluster count(独立集群数):出现故障的不同时间线分支数量。“2个集群中出现8次故障”比单纯的“8次故障”更有价值——它能告诉你有多少个独立的复现案例。
  • Session ID(会话ID):每次运行都有唯一的会话ID,用于限定所有查询的范围。针对错误会话的查询将返回空结果。会话ID嵌入在编码后的搜索URL参数中。

Important: Field Names

重要提示:字段名称

The Logs Explorer uses singular field names, not plural:
  • assertion.message
    — the property/assertion name (NOT
    assertions.message
    )
  • assertion.status
    passing
    or
    failing
    (NOT
    assertions.status
    )
  • general.output_text
    — log output text
The
assertion.status
field requires the
matches
operator, not
contains
. Other text fields use
contains
.
Logs Explorer 使用单数字段名称,而非复数:
  • assertion.message
    — 属性/断言名称(不是
    assertions.message
  • assertion.status
    passing
    failing
    (不是
    assertions.status
  • general.output_text
    — 日志输出文本
assertion.status
字段需要使用**
matches
**操作符,而非
contains
。其他文本字段使用
contains

Session Setup

会话设置

Use
agent-browser
with the shared Antithesis authentication:
SESSION="logs-explorer-$(date +%s)-$$"
agent-browser --session "$SESSION" --session-name antithesis --profile antithesis --args "--no-sandbox"
使用
agent-browser
及共享的Antithesis身份验证:
SESSION="logs-explorer-$(date +%s)-$$"
agent-browser --session "$SESSION" --session-name antithesis --profile antithesis --args "--no-sandbox"

Launching the Logs Explorer

启动Logs Explorer

There are three ways to reach the Logs Explorer with the correct run selected:
有三种方式可以打开Logs Explorer并选择正确的测试运行:

Method 1: From a triage report (preferred)

方法1:从分类排查报告进入(推荐)

Navigate to the triage report first, then extract the "Explore logs" link. This is the most reliable method because the link contains the correct session ID already encoded in the URL.
bash
agent-browser --session "$SESSION" eval \
  "document.querySelector('a.an-button[href*=\"/search\"]').href"
Navigate to the returned URL. This automatically sets the correct session/run.
The URL will have the form:
https://{tenant}.antithesis.com/search?search=v5v{base64_encoded_query}
The
v5v
prefix is a version marker. The base64 payload contains the query JSON including the session ID (
s
field). See
references/query-builder.md
for the full query JSON format.
先导航到分类排查报告,然后提取“Explore logs”链接。这是最可靠的方法,因为链接中已包含编码好的正确会话ID。
bash
agent-browser --session "$SESSION" eval \
  "document.querySelector('a.an-button[href*=\"/search\"]').href"
导航到返回的URL,系统会自动设置正确的会话/测试运行。
URL格式如下:
https://{tenant}.antithesis.com/search?search=v5v{base64_encoded_query}
v5v
前缀是版本标记。Base64负载包含查询JSON,其中包括会话ID(
s
字段)。完整的查询JSON格式请参考
references/query-builder.md

Method 2: From the Logs Explorer directly

方法2:直接从Logs Explorer进入

The Logs Explorer page has a "Show me logs from" dropdown at the top (
div.select_container.event_search_run_selector
). Click it to see a list of recent runs with their name, status (In progress / Completed / Incomplete), and timestamp. Select the run you want.
If a run you expect to see is missing, refresh the page.
Logs Explorer页面顶部有一个“Show me logs from”下拉菜单(
div.select_container.event_search_run_selector
)。点击它可以查看最近的测试运行列表,包含运行名称、状态(进行中/已完成/未完成)和时间戳。选择你需要的运行。
如果预期的运行未显示,请刷新页面。

Method 3: From the sidebar

方法3:从侧边栏进入

Click "Logs explorer" in the left sidebar navigation. This goes directly to
https://{tenant}.antithesis.com/search
with no run pre-selected. Then use the "Show me logs from" dropdown to choose a run.
bash
agent-browser --session "$SESSION" open "https://{tenant}.antithesis.com/search"
Important: Always ensure the correct run is selected before searching. Each run has its own session ID — queries against the wrong session return no results. The selected run is shown in the dropdown at the top of the page.
点击左侧导航栏中的“Logs explorer”,直接进入
https://{tenant}.antithesis.com/search
,此时未预先选择测试运行。然后使用“Show me logs from”下拉菜单选择运行。
bash
agent-browser --session "$SESSION" open "https://{tenant}.antithesis.com/search"
重要提示:搜索前务必确保选择了正确的测试运行。每个运行都有自己的会话ID——针对错误会话的查询将返回空结果。页面顶部的下拉菜单会显示当前选中的运行。

Reference Files

参考文件

ReferenceWhen to read
references/query-builder.md
Building and executing search queries
references/temporal-queries.md
Using preceded-by / not-preceded-by filters
references/results.md
Reading search results and clicking into details
references/map.md
Using the multiverse map for cluster analysis
参考文件阅读场景
references/query-builder.md
构建并执行搜索查询
references/temporal-queries.md
使用先于/不先于过滤器
references/results.md
读取搜索结果并查看详情
references/map.md
使用多元宇宙图谱进行集群分析

Runtime Injection

运行时注入

Inject
assets/antithesis-query-logs.js
into the Logs Explorer page:
bash
cat assets/antithesis-query-logs.js \
  | agent-browser --session "$SESSION" eval --stdin
The runtime registers two objects:
  • window.__antithesisQueryBuilder
    — standalone URL construction helpers. Available on any page after injection. Use this when building a search URL before navigating to the Logs Explorer.
  • window.__antithesisQueryLogs
    — full runtime with URL builders, UI interaction methods, and result-reading methods.
URL construction is the preferred approach for executing queries programmatically, because UI interaction (clicking dropdowns, targeting rows) is fragile with the query builder's dynamic DOM.
Important: You must inject the runtime before calling any
window.__antithesisQueryBuilder
or
window.__antithesisQueryLogs
method. If you get
TypeError: Cannot read properties of undefined
, inject first.
assets/antithesis-query-logs.js
注入到Logs Explorer页面:
bash
cat assets/antithesis-query-logs.js \
  | agent-browser --session "$SESSION" eval --stdin
注入后会注册两个对象:
  • window.__antithesisQueryBuilder
    — 独立的URL构建工具,注入后在任何页面都可用。适用于在导航到Logs Explorer之前构建搜索URL。
  • window.__antithesisQueryLogs
    — 完整的运行时工具,包含URL构建器、UI交互方法和结果读取方法。
推荐使用URL构建方式以程序化执行查询,因为UI交互(点击下拉菜单、定位行)在查询构建器的动态DOM环境中容易出错。
重要提示:调用任何
window.__antithesisQueryBuilder
window.__antithesisQueryLogs
方法之前,必须先注入运行时。如果出现
TypeError: Cannot read properties of undefined
错误,请先执行注入操作。

Recommended Workflows

推荐工作流

Cascade elimination

排除连锁故障

  1. Navigate to the triage report for the run
  2. Inject
    assets/antithesis-query-logs.js
    (required before using any builder methods)
  3. Extract the session ID from the "Explore logs" link (see query-builder.md)
  4. Build a simple query URL using
    window.__antithesisQueryBuilder.buildFailureQueryUrl(sessionId, "my-failing-property")
  5. Navigate to the URL and note the result count
  6. Build a temporal query URL using
    window.__antithesisQueryBuilder.buildNotPrecededByUrl(sessionId, "my-failing-property", "assertion.message", "suspected-upstream-failure")
  7. Navigate to the temporal URL and note the new count
  8. If the count drops, the difference is cascade failures
  9. If the count stays the same, the failures are independent
  1. 导航到该测试运行的分类排查报告
  2. 注入
    assets/antithesis-query-logs.js
    (使用任何构建方法前必须执行此步骤)
  3. 从“Explore logs”链接中提取会话ID(参考query-builder.md)
  4. 使用
    window.__antithesisQueryBuilder.buildFailureQueryUrl(sessionId, "my-failing-property")
    构建简单查询URL
  5. 导航到该URL并记录结果数量
  6. 使用
    window.__antithesisQueryBuilder.buildNotPrecededByUrl(sessionId, "my-failing-property", "assertion.message", "suspected-upstream-failure")
    构建时序查询URL
  7. 导航到时序查询URL并记录新的结果数量
  8. 如果数量减少,差值即为连锁故障的数量
  9. 如果数量不变,则说明故障是独立的

Failure correlation with event details

故障与事件详情关联

  1. Search for a property failure
  2. Expand the
    {}
    details on several results
  3. Identify detail fields that vary across results (e.g., configuration modes, feature flags, container names, protocol versions)
  4. Note whether failures cluster on a specific detail value — if all failures share a common detail that other passing events do not, that detail is likely part of the root cause
  1. 搜索某一属性的故障
  2. 展开多个结果中的
    {}
    详情
  3. 识别结果间存在差异的详情字段(例如:配置模式、功能标志、容器名称、协议版本)
  4. 查看故障是否集中在某个特定详情值上——如果所有故障都共享一个其他成功事件没有的详情值,该详情值很可能是根因的一部分

Independent cluster analysis

独立集群分析

  1. Search for a property failure
  2. Switch to the Map tab
  3. Count the number of distinct timeline branches with failure dots
  4. Failures on the same branch are likely the same root cause
  5. Pick one representative from each cluster for investigation
  1. 搜索某一属性的故障
  2. 切换到“Map”标签页
  3. 统计带有故障圆点的不同时间线分支数量
  4. 同一分支上的故障很可能有相同的根因
  5. 从每个集群中选择一个代表性案例进行调查

Output

输出内容

  • Event counts (total matches, matches after temporal filtering)
  • Event details (timestamp, timeline, assertion details and custom key-value pairs)
  • Cluster count from the multiverse map
  • Log context around each failure (fault events, preceding operations)
  • 事件计数(总匹配数、时序过滤后的匹配数)
  • 事件详情(时间戳、时间线、断言详情和自定义键值对)
  • 多元宇宙图谱中的集群数量
  • 每个故障的日志上下文(故障事件、前置操作)