Skip to content

Bug: Go SDK never sets error.type on the span for failed calls #1985

Open

Description

@basil-k-aji-dev

Component

OpenLIT Go SDK (sdk/go, OpenAI, Anthropic and vLLM instrumentation)

What happened?

error.type is never set on the span of a failed call. It is computed in the instrumentors (errType in openai/instrumentor.go, anthropic/instrumentor.go and vllm/instrumentor.go) but only attached to the gen_ai.client.operation.duration metric. helpers.RecordError records the exception and sets the status, and stops there.

The Python SDK sets it on the span (handle_exception in sdk/python/src/openlit/__helpers.py), and OpenTelemetry marks error.type as conditionally required on GenAI spans.

Steps to reproduce

Make an Anthropic or OpenAI call that returns 429 against an httptest server and inspect the span: status is Error with one exception event, and no error.type attribute.

Expected

error.type on the span, with the same value the metric already uses.

Actual

Missing on the span.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions