-
Notifications
You must be signed in to change notification settings - Fork 551
POtel implementation base branch #3152
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
Draft
sl0thentr0py
wants to merge
360
commits into
master
Choose a base branch
from
potel-base
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f7f153c
to
28effd6
Compare
16f9341
to
951477f
Compare
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #3152 +/- ##
==========================================
+ Coverage 79.78% 84.77% +4.99%
==========================================
Files 142 144 +2
Lines 16030 14788 -1242
Branches 2745 2361 -384
==========================================
- Hits 12790 12537 -253
+ Misses 2365 1527 -838
+ Partials 875 724 -151
|
d4b1d00
to
4428ee9
Compare
It is possible to use the return value of `sentry_sdk.init` as a context manager; however, this functionality has not been maintained for a long time, and it does not seem to be documented anywhere. So, we are deprecating this functionality, and we will remove it in the next major release. Closes #3282
BREAKING CHANGE: `sentry_sdk.init` now returns `None` instead of a context manager.
* Don't default to OK span status for UNSET, this breaks older behavior * Set transaction name manually on scope after isolation (we should generally do this everywhere)
…3748) If this option is on, we will only create a new underlying otel span if there's an active valid parent, otherwise we will just return an invalid `NonRecordingSpan` (`INVALID_SPAN`). All internal integration child `start_span` calls have been modified so that now we will only create spans if there is an active root span (transaction) active.
mainly some middleware span reordering
* Fix transaction name setting and forked some tests to make them work in potel * Transactions in transactins is undefined behavior, so remove this.
- Add support for the sampled flag for start_span and respect it when making sampling decisions. - Rework sampling_context in traces_sampler to work with span attributes instead. Make sure we still have the same data accessible as now. We could go one step further and change the format of sampling_context to just be the actual span attributes without any postprocessing into the current format. I kept the format in line with what we have now to make it easier to update. See #3746 Closes #3739 This is a breaking change since we're removing custom_sampling_context. It'll break multiple integrations until we fix them (see #3746).
This PR also needs an update of the docs to make sure people use the top level API. See this docs issue: getsentry/sentry-docs#13592
To preserve behavior form 2.x
Not using plain strings, but always use `SPANDATA`. Follow up to this PR: #4373
We don't use the `client` parameter in the `Scope`'s constructor, perhaps we can remove it and simplify the API. It is still possible to set the client with `Scope.set_client`. BREAKING CHANGE: `sentry_sdk.Scope` no longer has a `client` parameter. <!-- Describe your PR here --> --- Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`. Running the test suite on your PR might require maintainer approval.
Currently, this test only asserts that the `traces_sampler` is called at least once with the given arguments. However, we would expect it to be called exactly once. This PR changes the assertion to assert that the `traces_sampler` was called exactly one time, and that that call included the given arguments. <!-- Describe your PR here --> --- Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`. Running the test suite on your PR might require maintainer approval.
If a `TracerProvider` already exists, patch it. `TracerProvider` is a singleton, so if we aren't the first ones setting it up, we need to use the existing one. In tests, reset `TracerProvider` after each test so that we start with a clean slate and it gets set up anew on init.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Full state of CI: #3744
Contains:
scope.span =
setter and make surescope.span
reference is correct in context manager regardless of source of span #4439SPANDATA
consistent in AI integrations.` #4376add_atttachment
. #4360set_measurement
#4333propagate_scope=False
inThreadingIntegration
#4310Scope.root_span
logic #4274Scope.root_span
#4273LoggingIntegration
to Sentry by default #4300integrations/opentelemetry/
#4277integrations/opentelemetry/
#4276integrations/opentelemetry/
#4272integrations/opentelemetry/
#4260integrations/opentelemetry/
#4259integrations/opentelemetry/
#4258cache_spans
by default #3994start_span
fail if unsupported args are provided #4201Span.set_data()
#4261sample_rand
to POTel #4106propagate_traces
#4206warnings
module for deprecation messagse. #4180sample_rate
update topotel-base
#4069SystemExit(0)
not as a span status of 'internal_error' #4094use_scope
#3851None
#3816only_if_parent
option to POTelSpan and use it in integrations #3748_serialize_span_attribute
intoset_attribute
#3732subprocess
breadcrumbs frommaybe_create_breadcrumbs_from_span
to integration. #3637add
to trace state if key does not exist #3645op
. #3628make aws lambda layer
#3586use_scope
,use_isolation_scope
#3522use_scope
,use_isolation_scope
#3500OpenTelemetryIntegration
toDEFAULT_INTEGRATIONS
#3471active
flag onPOTelSpan
#3470start_transaction
#3379Hub
and related code for good. #3446Simple test
References
startSpan
& friendsstart_span
& friendsMisc
In OTel, this:
is equivalent to