refactor: share error taxonomy between metrics and tracing plugins

未关闭
#1,053 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
observability

调研方向

Start with classify_error() and the eight ERROR_TYPE_* constants in mellea/telemetry/metrics_plugins.py, then find where the tracing plugins set error.type on error spans. Move the classifier and constants into one shared module that both plugins import, and add mellea.error.type next to the existing error.type on error spans. Done when no duplicate constants remain and error spans carry both attributes, which the tests for the tracing plugin should check. Phase 3 depends on #1045 and #1047, so confirm those have landed first.

由索引模型根据 Issue 内容生成。

描述

area/telemetry p2 refactor

Background

Retired sub-issue #475 proposed creating mellea/telemetry/errors.py. That's no longer needed — mellea/telemetry/metrics_plugins.py already has classify_error() and 8 ERROR_TYPE_* constants, built during the metrics epic (issue #465).

Scope

  • Extract classify_error and ERROR_TYPE_* constants into a shared location (e.g., mellea/telemetry/errors.py or mellea/telemetry/_shared.py) so both metrics and tracing plugins can import from one source.
  • Have tracing plugins set mellea.error.type (semantic category) and error.type (exception class name) on error spans, matching metrics' labels. #1036 already sets error.type on the error path; this issue adds the semantic category alongside it.

Phase & dependencies

Phase 3 (polish). Depends on #1045 and #1047. Can start any time after Phase 1 lands.

Acceptance criteria

  • One source of truth for error classification across metrics and tracing.
  • No duplicate ERROR_TYPE_* constants.
  • Error spans carry both mellea.error.type (semantic) and error.type (exception class).

Parent epic: #444

主要语言
Python
星标
1.8k
派生
161
平均合并
4 天 3 小时
30 天内合并 PR
45

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

generative-computing/mellea 的其他 Issue

查看 generative-computing/mellea 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。