@@ -335,7 +335,14 @@ def bind_client(
335335
336336 def capture_event (self , event , hint = None , scope = None , ** scope_args ):
337337 # type: (Event, Optional[Hint], Optional[Scope], Any) -> Optional[str]
338- """Captures an event. Alias of :py:meth:`sentry_sdk.Client.capture_event`."""
338+ """
339+ Captures an event.
340+
341+ Alias of :py:meth:`sentry_sdk.Client.capture_event`.
342+
343+ :param scope_args: For supported `**scope_args` see
344+ :py:meth:`sentry_sdk.Scope.update_from_kwargs`.
345+ """
339346 client , top_scope = self ._stack [- 1 ]
340347 scope = _update_scope (top_scope , scope , scope_args )
341348 if client is not None :
@@ -348,8 +355,17 @@ def capture_event(self, event, hint=None, scope=None, **scope_args):
348355
349356 def capture_message (self , message , level = None , scope = None , ** scope_args ):
350357 # type: (str, Optional[str], Optional[Scope], Any) -> Optional[str]
351- """Captures a message. The message is just a string. If no level
352- is provided the default level is `info`.
358+ """
359+ Captures a message.
360+
361+ :param message: The string to send as the message.
362+
363+ :param level: If no level is provided, the default level is `info`.
364+
365+ :param scope: An optional :py:class:`sentry_sdk.Scope` to use.
366+
367+ :param scope_args: For supported `**scope_args` see
368+ :py:meth:`sentry_sdk.Scope.update_from_kwargs`.
353369
354370 :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.Client.capture_event`).
355371 """
@@ -367,6 +383,9 @@ def capture_exception(self, error=None, scope=None, **scope_args):
367383
368384 :param error: An exception to catch. If `None`, `sys.exc_info()` will be used.
369385
386+ :param scope_args: For supported `**scope_args` see
387+ :py:meth:`sentry_sdk.Scope.update_from_kwargs`.
388+
370389 :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.Client.capture_event`).
371390 """
372391 client = self .client
@@ -397,22 +416,48 @@ def _capture_internal_exception(
397416 """
398417 logger .error ("Internal error in sentry_sdk" , exc_info = exc_info )
399418
400- def add_breadcrumb (self , crumb = None , hint = None , ** kwargs ):
401- # type: (Optional[Breadcrumb], Optional[BreadcrumbHint], Any) -> None
419+ def add_breadcrumb (
420+ self ,
421+ crumb = None , # type: Optional[Breadcrumb]
422+ hint = None , # type: Optional[BreadcrumbHint]
423+ timestamp = None , # type: Optional[datetime]
424+ type = None , # type: Optional[str]
425+ data = None , # type: Optional[Dict[str, Any]]
426+ ** kwargs # type: Any
427+ ):
428+ # type: (...) -> None
402429 """
403430 Adds a breadcrumb.
404431
405- :param crumb: Dictionary with the data as the sentry v7/v8 protocol expects.
432+ :param crumb: Dictionary with the data as the Sentry v7/v8 protocol expects.
406433
407434 :param hint: An optional value that can be used by `before_breadcrumb`
408435 to customize the breadcrumbs that are emitted.
436+
437+ :param timestamp: The timestamp associated with this breadcrumb. Defaults
438+ to now if not provided.
439+
440+ :param type: The type of the breadcrumb. Will be set to "default" if
441+ not provided.
442+
443+ :param data: Additional custom data to put on the breadcrumb.
444+
445+ :param kwargs: Adding any further keyword arguments will not result in
446+ an error, but the breadcrumb will be dropped before arriving to
447+ Sentry.
409448 """
410449 client , scope = self ._stack [- 1 ]
411450 if client is None :
412451 logger .info ("Dropped breadcrumb because no client bound" )
413452 return
414453
415454 crumb = dict (crumb or ()) # type: Breadcrumb
455+ if timestamp is not None :
456+ crumb ["timestamp" ] = timestamp
457+ if type is not None :
458+ crumb ["type" ] = type
459+ if data is not None :
460+ crumb ["data" ] = data
416461 crumb .update (kwargs )
417462 if not crumb :
418463 return
@@ -441,15 +486,19 @@ def add_breadcrumb(self, crumb=None, hint=None, **kwargs):
441486 def start_span (self , span = None , instrumenter = INSTRUMENTER .SENTRY , ** kwargs ):
442487 # type: (Optional[Span], str, Any) -> Span
443488 """
444- Create and start timing a new span whose parent is the currently active
445- span or transaction, if any. The return value is a span instance,
489+ Start a span whose parent is the currently active span or transaction, if any.
490+
491+ The return value is a :py:class:`sentry_sdk.tracing.Span` instance,
446492 typically used as a context manager to start and stop timing in a `with`
447493 block.
448494
449495 Only spans contained in a transaction are sent to Sentry. Most
450496 integrations start a transaction at the appropriate time, for example
451- for every incoming HTTP request. Use `start_transaction` to start a new
452- transaction when one is not already in progress.
497+ for every incoming HTTP request. Use
498+ :py:meth:`sentry_sdk.start_transaction` to start a new transaction when
499+ one is not already in progress.
500+
501+ For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
453502 """
454503 configuration_instrumenter = self .client and self .client .options ["instrumenter" ]
455504
@@ -515,6 +564,8 @@ def start_transaction(
515564
516565 When the transaction is finished, it will be sent to Sentry with all its
517566 finished child spans.
567+
568+ For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Transaction`.
518569 """
519570 configuration_instrumenter = self .client and self .client .options ["instrumenter" ]
520571
0 commit comments