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

Add LaunchDarkly and OpenFeature integration #3648

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

cmanallen
Copy link
Member

@cmanallen cmanallen commented Oct 11, 2024

Adds LaunchDarkly and OpenFeature integration and extends the Scope with a flags property.

As flags are evaluated by an application they are stored within the Sentry SDK (lru cache). When an error occurs we fetch the flags stored in the SDK and serialize them on the event.

Copy link

codecov bot commented Oct 11, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
14947 1 14946 4376
View the top 1 failed tests by shortest run time
tests.test_utils test_get_current_thread_meta_failed_to_get_main_thread
Stack Traces | 0.045s run time
tests/test_utils.py:916: in test_get_current_thread_meta_failed_to_get_main_thread
    thread.join()
.../hostedtoolcache/Python/3.6.15........./x64/lib/python3.6/threading.py:1052: in join
    if self is current_thread():
.../hostedtoolcache/Python/3.6.15........./x64/lib/python3.6/unittest/mock.py:939: in __call__
    return _mock_self._mock_call(*args, **kwargs)
.../hostedtoolcache/Python/3.6.15........./x64/lib/python3.6/unittest/mock.py:1001: in _mock_call
    result = next(effect)
E   StopIteration

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@cmanallen cmanallen marked this pull request as ready for review October 21, 2024 14:37
sentry_sdk/scope.py Outdated Show resolved Hide resolved
@cmanallen cmanallen requested a review from a team October 22, 2024 13:32
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.

Will have a proper look soon -- just two comments regarding tox for now

tox.ini Outdated Show resolved Hide resolved
tox.ini Show resolved Hide resolved
@antonpirker antonpirker self-assigned this Oct 24, 2024
@antonpirker antonpirker added the New Integration Integrating with a new framework or library label Oct 24, 2024
@antonpirker
Copy link
Member

Hey @cmanallen ! This is the best PR I have received ever! Great work.

The integrations should not change the Scope.

I have created an commit on your branch to illustrate how the flags could live on the integration rather than the scope (I hope you don't mind):
430387f

This way all the functionality is contained in the integration.
I also added some tests to show how you can now set the capacity of the buffer when initializing the Integration.

wdyt?

Feel free to make changes to my commit if you want to do things differently.

@cmanallen
Copy link
Member Author

@antonpirker Reverted your commit per our conversation on Slack. Tl;dr the commit didn't work because we need to be tied to the scope to maintain flag isolation. After @sl0thentr0py's comment about it being fine to keep the flags on the scope if this change is permanent I think its appropriate to revert that change.

@cmanallen cmanallen changed the title Add OpenFeature integration Add LaunchDarkly and OpenFeature integration Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Integration Integrating with a new framework or library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants