Repository navigation
feat(obsrv): 统一观测读写并提供 Web 观测视图 - #186
Merged
Merged
Conversation
This was referenced Nov 4, 2026
6 tasks done
- 增加显式目标 SDK,统一 PostgreSQL 与 Peer 执行的 Loki 读写 - 默认采集有界 operation 与 Job 事件,保留独立 OTEL 出口 - 提供全局过滤、关联时间线和后端历史状态,覆盖边界回归
- 明确外部 Peer 接收进入队列不构成持久化证明
xiaoland
marked this pull request as ready for review
November 5, 2026 09:53
xiaoland
force-pushed
the
feat/observability-unification
branch
from
November 5, 2026 09:53
1a34a0a to
1aac7a6
Compare
- 使用 Observability 可访问区域替换已移除的日志组件 class - 保留加载失败、旧结果可读和恢复查询的真实数据库断言
3 of 5 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
意图与范围
将观测采集和查询收敛到同一 Core 接口,让 Web 全局观测与 Job 详情按部署选择读取数据。缺少后端 selector 时直接使用已准入 PostgreSQL 协议;选择 Loki 时通过公告
core.observability.v1的 Peer 双向读写。外部凭据留在执行 Peer,外部故障、未知配置和缺失能力明确失败,不回退 PostgreSQL。独立 SDK 新增显式连接的
ObservabilityClient;实例固定部署和后端,保留原Log为 deprecated 的 PG 历史兼容 API。operation 摘要和 Job 开始/终态默认进入有界采集,不再依赖可选 OTEL 出口;不自动采集业务原文。Web 提供全局筛选、关联时间线、记录详情、返回记录摘要、后端状态和历史说明,并区分加载、空、错误与截断状态。这里的 span 是操作摘要,不宣称完整指标或 Trace 树。主要实现范围:Core SDK、现有 App 观测集成、client-web。
受影响发布项目:
@inkcre/core、@inkcre/client-web、@inkcre/client-webext,已附 Changeset。下一步
请维护者评审统一接口与 Web 消费行为。跨仓跟踪:InKCre/docs#52;共享合同:InKCre/docs#53,引用固定到
33f5a13c4ec4ba5b3cad73a0e8f3a097139458de,单独提交 ref 更新。真实 Loki 持久化、跨 Peer 路由和浏览器交互仍需交付环境验收。受本任务明确要求约束,未执行本地 E2E;此限制不修改或禁用云端 E2E。当前仓库 CI 与 Pages preview 只匹配 base
main,本 PR 以父分支为 base,因此不会自动触发这两条工作流;父 PR 合并后需 restack 到最新main、更新 base,再取得正常云端检查与预览证据。验证证据
pnpm check:格式、类型感知 lint、workspace/runtime/database/locale 合同、全仓类型、Web/WebExt/Extension 构建、package 检查全部通过。git diff --check与共享文档pre-bump/pre-commit检查通过。新增测试位于 SDK/Job 的稳定消费边界,保护配置切换误投、外部故障回退和旧日志不可读等实际风险;静态类型无法验证这些传输与状态行为。受控传输证据不替代真实后端持久化和端到端验收。
交付影响
没有数据库迁移或凭据变更,不发布生产制品。缺省增加有界基础诊断写入;外部模式需要部署端选择 Loki,并由具备私密配置的 Peer 公告公共能力。切换只影响新实例,新旧后端历史不会合并、搬迁或删除。外部接收进入队列不代表已经持久化。
Stack
feat/core-app-separation。风险与回滚
主要风险是后端配置和执行 Peer 状态不一致、历史日志映射及新默认采集的请求量。实例快照、
expected_backend、有界队列与明确错误限制这些路径;查询最多 31 天/500 条,截断后需缩窄范围。回滚本 PR 的源码提交即可恢复原消费行为;已写入的记录与原存储保留,文档 ref 可独立回退。后续 App / Peer 命名迁移
直接子 PR:https://github.com/InKCre/impl-ts/pull/188(draft)。先交付本 PR,再重排命名迁移;跨仓跟踪 InKCre/docs#55。