Skip to content

ref: simplify the IEventLike interface hierarchy #5893

Open

Description

@jamescrosswell

Problem

IEventLike (which extends IHasTags and IHasExtra) is one public interface shared by very different types:

  • Scope, which holds state and is applied to telemetry
  • SentryEvent, which is sent
  • ITransactionData, and through it SentryTransaction and TransactionTracer, which need explicit IEventLike.TransactionName implementations

Every implementer has to expose the whole surface, including breadcrumbs, fingerprint, request, user and SDK. Logs and metrics don't use the interface at all, so it doesn't describe telemetry in general.

Raised here as a possible simplification while adding attributes to scopes in #4882.

Target

To be agreed. The original comment doesn't say what the simpler shape should be. A proposal should answer:

  • Which members do Scope, SentryEvent and the transaction types actually need to share?
  • Which callers need the shared interface rather than a concrete type? The main internal ones are Scope.Apply(IEventLike) and Enricher.Apply(IEventLike).
  • Should Scope keep implementing the same interface as the telemetry it's applied to?

Work

  • Agree the target shape.
  • Make the change on the version7 branch and update the API snapshots.
  • Add migration guidance.

Things to watch

  • Breaking change. IEventLike, EventLikeExtensions and Scope.Apply(IEventLike) are all public, so removing or moving members has to wait for the next major version.
  • sentry-unity. Check how it uses these types before changing them.
  • Related work. IHasExtra is part of this hierarchy, so this overlaps with Remove Obsolete Extra members #4640. If Enricher goes away in the root scope work, one of the callers above goes with it.

Activity

  1. added
    .NET
    public API
    on Nov 9, 2026
  2. linear-code commented on Nov 9, 2026

    @linear-code
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

    .NETImprovementState: Needs Discussionpublic API

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions