@@ -478,6 +478,46 @@ class OP:
478478 SOCKET_DNS = "socket.dns"
479479
480480
481+ BAGGAGE_HEADER_NAME = "baggage"
482+ SENTRY_TRACE_HEADER_NAME = "sentry-trace"
483+
484+ DEFAULT_SPAN_ORIGIN = "manual"
485+ DEFAULT_SPAN_NAME = "<unlabeled span>"
486+
487+
488+ # Transaction source
489+ # see https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
490+ class TransactionSource (str , Enum ):
491+ COMPONENT = "component"
492+ CUSTOM = "custom"
493+ ROUTE = "route"
494+ TASK = "task"
495+ URL = "url"
496+ VIEW = "view"
497+
498+ def __str__ (self ):
499+ # type: () -> str
500+ return self .value
501+
502+
503+ # These are typically high cardinality and the server hates them
504+ LOW_QUALITY_TRANSACTION_SOURCES = [
505+ TransactionSource .URL ,
506+ ]
507+
508+ SOURCE_FOR_STYLE = {
509+ "endpoint" : TransactionSource .COMPONENT ,
510+ "function_name" : TransactionSource .COMPONENT ,
511+ "handler_name" : TransactionSource .COMPONENT ,
512+ "method_and_path_pattern" : TransactionSource .ROUTE ,
513+ "path" : TransactionSource .URL ,
514+ "route_name" : TransactionSource .COMPONENT ,
515+ "route_pattern" : TransactionSource .ROUTE ,
516+ "uri_template" : TransactionSource .ROUTE ,
517+ "url" : TransactionSource .ROUTE ,
518+ }
519+
520+
481521# This type exists to trick mypy and PyCharm into thinking `init` and `Client`
482522# take these arguments (even though they take opaque **kwargs)
483523class ClientConstructor :
@@ -945,43 +985,4 @@ def _get_default_options():
945985del _get_default_options
946986
947987
948- BAGGAGE_HEADER_NAME = "baggage"
949- SENTRY_TRACE_HEADER_NAME = "sentry-trace"
950-
951- DEFAULT_SPAN_ORIGIN = "manual"
952- DEFAULT_SPAN_NAME = "<unlabeled span>"
953-
954-
955- # Transaction source
956- # see https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
957- class TransactionSource (str , Enum ):
958- COMPONENT = "component"
959- CUSTOM = "custom"
960- ROUTE = "route"
961- TASK = "task"
962- URL = "url"
963- VIEW = "view"
964-
965- def __str__ (self ):
966- # type: () -> str
967- return self .value
968-
969-
970- # These are typically high cardinality and the server hates them
971- LOW_QUALITY_TRANSACTION_SOURCES = [
972- TransactionSource .URL ,
973- ]
974-
975- SOURCE_FOR_STYLE = {
976- "endpoint" : TransactionSource .COMPONENT ,
977- "function_name" : TransactionSource .COMPONENT ,
978- "handler_name" : TransactionSource .COMPONENT ,
979- "method_and_path_pattern" : TransactionSource .ROUTE ,
980- "path" : TransactionSource .URL ,
981- "route_name" : TransactionSource .COMPONENT ,
982- "route_pattern" : TransactionSource .ROUTE ,
983- "uri_template" : TransactionSource .ROUTE ,
984- "url" : TransactionSource .ROUTE ,
985- }
986-
987988VERSION = "2.25.1"
0 commit comments