-
Notifications
You must be signed in to change notification settings - Fork 553
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
377
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
+12,490
−17,390
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 80.63% 84.89% +4.25%
==========================================
Files 156 144 -12
Lines 16482 15006 -1476
Branches 2802 2376 -426
==========================================
- Hits 13291 12739 -552
+ Misses 2308 1539 -769
+ Partials 883 728 -155
|
d4b1d00
to
4428ee9
Compare
- 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).
Remove explicit trace_id passing
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.
- According to our [span ops](https://develop.sentry.dev/sdk/telemetry/traces/span-operations/#database) there is no op called just `db`, but we're emitting these from django, clickhouse, asyncpg and pymongo. Changing to `db.query` instead. - There was also a breadcrumb with type `db` that's also [officially not a supported type](https://develop.sentry.dev/sdk/data-model/event-payloads/breadcrumbs/#breadcrumb-types), changed it to `query`. This is intentionally just on `potel-base` since it's technically a breaking change.
It is not ready yet and i do not want to push dog fooding back again.
extracted from https://github.com/getsentry/sentry-python/pull/4487/files with lots of manual fixes * migrate old style `# type: bla` to inline types * most importantly use [`__future__.annotations`](https://peps.python.org/pep-0563/#enabling-the-future-behavior-in-python-3-7) so that we can simply use forward annotations without wrapping them in strings like we did before, this simplifies things substantially * also guard only things that shouldn't be imported under `TYPE_CHECKING`, in the future it seems we should avoid using `TYPE_CHECKING` completely * #4510 * #4522 * #4529 * #4530 * #4532 * #4533 * #4534 closes #2585
Ensure tag values are strings before serializing an event or a transaction to an `Event` dictionary. Fixes #4391 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
We currently use an `if self._ctx_token` check to determine if a span has a `_ctx_token`. However, this check is incorrect, since `_ctx_token` is only sometimes set. Furthermore, when `_ctx_token` is set, we should always have a `_ctx_token`. Therefore, using `hasattr` is what we want. <!-- 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.
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