Skip to content

refactor: share error taxonomy between metrics and tracing plugins #1053

@ajbozarth

Description

@ajbozarth

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. feat(telemetry): close five OTel GenAI semantic convention emission gaps (#1035) #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions