diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py index cf708b839e..693acf488d 100644 --- a/sentry_sdk/tracing.py +++ b/sentry_sdk/tracing.py @@ -131,7 +131,7 @@ class TransactionKwargs(SpanKwargs, total=False): # Transaction source # see https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations -class TransactionSource(str, Enum): +class TransactionSource(Enum): COMPONENT = "component" CUSTOM = "custom" ROUTE = "route" @@ -143,6 +143,12 @@ def __str__(self): # type: () -> str return self.value + def __eq__(self, other): + # type: (Any) -> bool + if isinstance(other, str): + return self.value == other + return super().__eq__(other) + # These are typically high cardinality and the server hates them LOW_QUALITY_TRANSACTION_SOURCES = [