Skip to content

Commit 28068a5

Browse files
committed
fixed some merge problems
1 parent 419c918 commit 28068a5

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

sentry_sdk/integrations/openai_agents/spans/agent_workflow.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sentry_sdk
22

33
from ..consts import SPAN_ORIGIN
4-
from ..utils import _get_start_span_function
54

65
from typing import TYPE_CHECKING
76

@@ -13,7 +12,7 @@ def agent_workflow_span(agent):
1312
# type: (agents.Agent) -> sentry_sdk.tracing.Span
1413

1514
# Create a transaction or a span if an transaction is already active
16-
span = _get_start_span_function()(
15+
span = sentry_sdk.start_span(
1716
name=f"{agent.name} workflow",
1817
origin=SPAN_ORIGIN,
1918
)

sentry_sdk/integrations/openai_agents/utils.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
if TYPE_CHECKING:
1111
from typing import Any
12-
from typing import Callable
1312
from typing import Union
1413
from agents import Usage
1514

@@ -30,15 +29,6 @@ def _capture_exception(exc):
3029
sentry_sdk.capture_event(event, hint=hint)
3130

3231

33-
def _get_start_span_function():
34-
# type: () -> Callable[..., Any]
35-
current_span = sentry_sdk.get_current_span()
36-
transaction_exists = (
37-
current_span is not None and current_span.containing_transaction == current_span
38-
)
39-
return sentry_sdk.start_span if transaction_exists else sentry_sdk.start_transaction
40-
41-
4232
def _set_agent_data(span, agent):
4333
# type: (sentry_sdk.tracing.Span, agents.Agent) -> None
4434
span.set_data(

sentry_sdk/integrations/ray.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def new_func(*f_args, _tracing=None, **f_kwargs):
6060
# type: (Any, Optional[dict[str, Any]], Any) -> Any
6161
_check_sentry_initialized()
6262

63-
root_span_name = qualname_from_function(f) or DEFAULT_TRANSACTION_NAME
63+
root_span_name = (
64+
qualname_from_function(user_f) or DEFAULT_TRANSACTION_NAME
65+
)
6466
sentry_sdk.get_current_scope().set_transaction_name(
6567
root_span_name,
6668
source=TransactionSource.TASK,

0 commit comments

Comments
 (0)