Skip to content

Commit 900c279

Browse files
committed
Revert some stuff
1 parent 2196b5c commit 900c279

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

sentry_sdk/integrations/opentelemetry/utils.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,30 @@ def extract_span_data(span):
130130
if db_query:
131131
return span_data_for_db_query(span)
132132

133+
rpc_service = span.attributes.get(SpanAttributes.RPC_SERVICE)
134+
if rpc_service:
135+
return (
136+
span.attributes.get(SentrySpanAttribute.OP) or "rpc",
137+
description,
138+
status,
139+
http_status,
140+
origin,
141+
)
142+
143+
messaging_system = span.attributes.get(SpanAttributes.MESSAGING_SYSTEM)
144+
if messaging_system:
145+
return (
146+
span.attributes.get(SentrySpanAttribute.OP) or "message",
147+
description,
148+
status,
149+
http_status,
150+
origin,
151+
)
152+
153+
faas_trigger = span.attributes.get(SpanAttributes.FAAS_TRIGGER)
154+
if faas_trigger:
155+
return (str(faas_trigger), description, status, http_status, origin)
156+
133157
return (op, description, status, http_status, origin)
134158

135159

sentry_sdk/tracing.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,9 +1653,6 @@ def is_success(self):
16531653

16541654
def finish(self, end_timestamp=None):
16551655
# type: (Optional[Union[float, datetime]]) -> Optional[str]
1656-
if self.status is None:
1657-
self.set_status(SPANSTATUS.OK)
1658-
16591656
if end_timestamp is not None:
16601657
from sentry_sdk.integrations.opentelemetry.utils import (
16611658
convert_to_otel_timestamp,

tests/integrations/celery/test_celery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def walk_dogs(x, y):
444444
walk_dogs, [["Maisey", "Charlie", "Bodhi", "Cory"], "Dog park round trip"], 1
445445
)
446446

447-
sampling_context = traces_sampler.call_args_list[0][0][0]
447+
sampling_context = traces_sampler.call_args_list[1][0][0]
448448
assert sampling_context["celery.job.task"] == "dog_walk"
449449
for i, arg in enumerate(args_kwargs["args"]):
450450
assert sampling_context[f"celery.job.args.{i}"] == str(arg)

0 commit comments

Comments
 (0)