Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arq tests in POTel #3875

Open
wants to merge 5 commits into
base: potel-base
Choose a base branch
from
Open

Fix arq tests in POTel #3875

wants to merge 5 commits into from

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Dec 17, 2024

Make sure OK status is set, only when there has not been a error status set before.

Copy link

codecov bot commented Dec 17, 2024

❌ 345 Tests Failed:

Tests completed Failed Passed Skipped
13128 345 12783 3332
View the top 3 failed tests by shortest run time
 tests.integrations.celery.integration_tests.test_celery_beat_cron_monitoring
Stack Traces | 0s run time
No failure message available
 tests.integrations.celery.test_celery
Stack Traces | 0s run time
No failure message available
 tests.integrations.quart.test_quart
Stack Traces | 0s run time
No failure message available

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Comment on lines 122 to 125
status_unset = (
hasattr(span._otel_span, "status")
and span._otel_span.status.status_code == StatusCode.UNSET
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that we're accessing the underlying _otel_span here -- would prefer to have POTelSpan manage the proxying as much as possible. We could add a status property to POTelSpan that returns _otel_span.status and use that here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right. I thought this is done in multiple integrations and I will fix it in another Pr. But I guess I misremembered.
Will fix it in this PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have now implemented a status property. Have a look at the tests, because the Otel span statuses and the Sentry span status are different, the Sentry status one can get with the status property can be different from the one that has been set with set_status() before. And I default to "UNKNOWN_ERROR". Does this look ok to you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense.

sentry_sdk/tracing.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, see one last comment

Comment on lines +1605 to +1608
@status.setter
def status(self, value):
# type: (Optional[Any]) -> None
raise NotImplementedError("Use set_status instead")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's just get rid of this altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants