Skip to content

fix(agentspec): omit session.id for traceless spans - #4482

Open
feiiiiii5 wants to merge 1 commit into
Arize-ai:mainfrom
feiiiiii5:feiiiiii5/1127-D317
Open

feiiiiii5 wants to merge 1 commit into
Arize-ai:mainfrom
feiiiiii5:feiiiiii5/1127-D317

Conversation

@feiiiiii5

Copy link
Copy Markdown
Contributor

What

The agentspec span processor assigned tracing_info[SESSION_ID] = trace.id if trace else None. For a span without a trace, the OTel exporter serialized that None through json.dumps, producing the literal string "null". Unrelated traceless spans were then grouped into one bogus session.

How

Only assign SESSION_ID when a trace exists. Serialization of other attributes and traced-span behavior are unchanged.

Verification

  • New regression tests: base-red 1 failed / 1 passed (exported session.id was 'null'); with fix 2/2 passed.
  • Full agentspec package suite: 14 passed.
  • Ruff format clean; ruff check clean with CI-equivalent first-party config (bare-config import-order warnings are pre-existing).

No live LLM/API/network calls.

This branch has not been deployed

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant