Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/observability-unification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@inkcre/core': patch
'@inkcre/client-web': patch
'@inkcre/client-webext': patch
---

统一观测记录的采集与查询,默认使用内置信息库,选定 Loki 时通过具备能力的 Peer 读写;Web 提供全局筛选、关联时间线与明确的后端/历史状态,Job 生命周期记录不再依赖额外 OTEL 出口开关。
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const NAV_ITEMS: NavItem[] = [
matches: ['/peers'],
requiresReady: true,
},
{
name: 'observability',
labelKey: 'sidePanel.observability',
to: '/observability',
matches: ['/observability'],
requiresReady: true,
},
{
name: 'settings',
labelKey: 'sidePanel.settings',
Expand Down
5 changes: 0 additions & 5 deletions apps/client-web/src/components/obsrv/LogEntry/LogEntry.md

This file was deleted.

99 changes: 0 additions & 99 deletions apps/client-web/src/components/obsrv/LogEntry/LogEntry.scss

This file was deleted.

9 changes: 0 additions & 9 deletions apps/client-web/src/components/obsrv/LogEntry/LogEntry.ts

This file was deleted.

66 changes: 0 additions & 66 deletions apps/client-web/src/components/obsrv/LogEntry/LogEntry.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# LogsViewer

LogsViewer 按 `traceId` 读取并展示日志。首次读取后,以最后一条日志的 ID 作为游标追加新内容;只有收到新日志才滚动到尾部。
Job 内嵌观测视图,复用 ObservationExplorer 和 Core 的统一查询接口,不直接访问 PostgreSQL 或选择外部供应商。

`enablePolling` 决定是否自动更新,`pollingInterval` 设置更新间隔(默认 5000ms)。尾部 spinner 只在请求期间显示,轮询间隔显示静态更新提示。读取完成但没有内容时显示空态。
`jobId` 同时关联新结构化事件和历史 job.N 日志;`since` 使用 Job 创建时间,旧任务不因默认最近窗口而被遗漏。也保留独立 `traceId` 查询。

读取失败时保留已显示的日志,暂停自动更新,并在尾部提供错误和重试。重试成功后按 `enablePolling` 恢复轮询。切换 `traceId` 会清空旧日志并重新读取;上一 trace 的未完成请求不能写入新的日志区域。

组件复用 Core 的 Log 模型和读取方法,错误详情可展开查看,单条日志由 LogEntry 渲染。
查询有界,记录过多时提示缩窄范围;不承诺全量历史。`enablePolling` 与 `pollingInterval` 控制刷新。连接或业务范围变化使在途响应失效;刷新失败保留同范围已有记录并提示重试。
44 changes: 0 additions & 44 deletions apps/client-web/src/components/obsrv/LogsViewer/LogsViewer.scss

This file was deleted.

28 changes: 7 additions & 21 deletions apps/client-web/src/components/obsrv/LogsViewer/LogsViewer.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
import type { PropType } from 'vue'

// --- Types ---

// --- Props ---
export const logsViewerProps = {
/** The trace ID to filter logs by */
traceId: {
type: String,
required: true,
},
/** Polling interval in milliseconds, default 5000 */
pollingInterval: {
type: Number as PropType<number>,
default: 5000,
},
/** Whether to enable polling, default true */
enablePolling: {
type: Boolean,
default: true,
},
/** Business Job correlation also includes legacy job.N log records. */
jobId: { type: Number, default: undefined },
traceId: { type: String, default: undefined },
/** Job creation time keeps an old Job's history in its query window. */
since: { type: String, default: undefined },
pollingInterval: { type: Number, default: 5000 },
enablePolling: { type: Boolean, default: true },
}

// --- Emits ---
export const logsViewerEmits = {} as const
Loading
Loading