Skip to content

Trace meta types transaction.event_id as never null #130461

Closed

Description

@sentry-junior

The organization trace-meta endpoint documents transactionChildCountMap[].transaction.event_id as a non-null string, but it returns null there for spans that belong to no transaction.

  • TransactionChildCount in src/sentry/api/endpoints/organization_trace_meta_types.py declares "transaction.event_id": str.
  • serialize in src/sentry/api/endpoints/organization_trace_meta.py passes the rows of the transaction_children query (grouped by transaction.event_id) through unchanged, so spans without a transaction show up as a row with "transaction.event_id": null.
  • The generated OpenAPI spec carries the non-null type at paths["/api/0/organizations/{organization_id_or_slug}/trace-meta/{trace_id}/"].get.responses.200.content["application/json"].schema.properties.transactionChildCountMap.items.properties["transaction.event_id"].
  • Since @sentry/api 1.52.0, the generated Valibot and Zod validators require a string there, so they reject these responses. The Sentry MCP server has accepted null for this field since fix: Allow nullable transaction.event_id in trace metadata schema toolkit#494, after it hit these responses in production.

via @BYK.

--

View Session in Sentry

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions