@@ -479,10 +479,43 @@ def set_transaction_name(name, source=None):
479479def update_current_span (op = None , name = None , attributes = None ):
480480 # type: (Optional[str], Optional[str], Optional[dict[str, Union[str, int, float, bool]]]) -> None
481481 """
482- Update the current span with the given parameters.
483- :param op: The operation of the span.
484- :param name: The name of the span.
485- :param attributes: The attributes of the span.
482+ Update the current active span with the provided parameters.
483+
484+ This function allows you to modify properties of the currently active span.
485+ If no span is currently active, this function will do nothing.
486+
487+ :param op: The operation name for the span. This is a high-level description
488+ of what the span represents (e.g., "http.client", "db.query").
489+ You can use predefined constants from :py:class:`sentry_sdk.consts.OP`
490+ or provide your own string. If not provided, the span's operation will
491+ remain unchanged.
492+ :type op: str or None
493+
494+ :param name: The human-readable name/description for the span. This provides
495+ more specific details about what the span represents (e.g., "GET /api/users",
496+ "SELECT * FROM users"). If not provided, the span's name will remain unchanged.
497+ :type name: str or None
498+
499+ :param attributes: A dictionary of key-value pairs to add as attributes to the span.
500+ Attribute values must be strings, integers, floats, or booleans. These
501+ attributes will be merged with any existing span data. If not provided,
502+ no attributes will be added.
503+ :type attributes: dict[str, Union[str, int, float, bool]] or None
504+
505+ :returns: None
506+
507+ .. versionadded:: 2.0.0
508+
509+ Example::
510+
511+ import sentry_sdk
512+ from sentry_sdk.consts import OP
513+
514+ sentry_sdk.update_current_span(
515+ op=OP.FUNCTION,
516+ name="process_user_data",
517+ attributes={"user_id": 123, "batch_size": 50}
518+ )
486519 """
487520 current_span = get_current_span ()
488521
0 commit comments