-
Notifications
You must be signed in to change notification settings - Fork 532
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
POtel implementation base branch #3152
Draft
sl0thentr0py
wants to merge
294
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
+7,855
−11,409
Conversation
This file contains 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.54% 83.59% +4.04%
==========================================
Files 142 144 +2
Lines 15898 14659 -1239
Branches 2721 2324 -397
==========================================
- Hits 12646 12254 -392
+ Misses 2388 1687 -701
+ Partials 864 718 -146
|
d4b1d00
to
4428ee9
Compare
* add and track underlying root span in a hidden attr `_sentry_root_otel_span` in all subsequent children spans in the span processor on start * wrap this underlying root otel span in a `POTelSpan` to act as a proxy * make `POTelSpan` constructor work with explicitly passed in `otel_span` * implement `__eq__` on `POTelSpan` to make sure proxies to the same underlying `_otel_span` are considered the same
Add a new SentrySampler that is used for sampling OpenTelemetry spans the Sentry way (using Sentrys traces_sample_rate and traces_sampler config options) Fixes #3318
* Remove 3.6 compat * fix
…#3519) Make sure that `op`, `name`, `description` are set correctly on `Span`s and `Transaction`s.
* Add parsed baggage sentry items as items on the `sampling_context.trace_state` in `continue_trace` * Fix sampler to propagate the `trace_state` to children in both sampled and dropped cases * make `iter_headers` work * make `get_trace_context` work * add `dynamic_sampling_context` in `trace_context` so that it can be picked up by the client and added in the envelope header
Remove the following deprecated stuff: - `configure_debug_hub` from `debug.py` - exported stuff in `profiler/__init__.py` that's not part of public API and was only exported for backwards compat reasons - support for `_experiments['profiler_mode']` and `_experiments['profiles_sample_rate']` which both have non-experimental top-level options now - `Transport.capture_event` - `_FunctionTransport` and support for function transports in general - `enable_tracing` --------- Co-authored-by: Anton Pirker <[email protected]>
`InvalidOperation` can occur when using tracing if the `Decimal` class's global context has been modified to set the precision below 6. This change fixes this bug by setting a custom context for our `quantize` call. Fixes #4177
With the refactoring of the AWS Lambda test suite in `master`. We need to update the tests in `potel-base` to succeed again. This also fixes a check in the `stdlib` integration. With local AWS Lambda we have a DSN that includes a port. This did not work and this PR makes this work. (This will allow support for self hosted Sentry running on a specific port too)
Fixing this: ``` ==================================== ERRORS ==================================== _________ ERROR collecting tests/integrations/trytond/test_trytond.py __________ ImportError while importing test module '/home/runner/work/sentry-python/sentry-python/tests/integrations/trytond/test_trytond.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: .tox/py3.7-trytond-v5.0.9/lib/python3.7/site-packages/_pytest/python.py:617: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) .tox/py3.7-trytond-v5.0.9/lib/python3.7/site-packages/_pytest/pathlib.py:567: in import_path importlib.import_module(module_name) /opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) <frozen importlib._bootstrap>:1006: in _gcd_import ??? <frozen importlib._bootstrap>:983: in _find_and_load ??? <frozen importlib._bootstrap>:967: in _find_and_load_unlocked ??? <frozen importlib._bootstrap>:677: in _load_unlocked ??? .tox/py3.7-trytond-v5.0.9/lib/python3.7/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) tests/integrations/trytond/test_trytond.py:11: in <module> from trytond.wsgi import app as trytond_app .tox/py3.7-trytond-v5.0.9/lib/python3.7/site-packages/trytond/wsgi.py:12: in <module> from werkzeug.contrib.fixers import ProxyFix E ModuleNotFoundError: No module named 'werkzeug.contrib' ```
This is now part of the Cloud test group
Drop the deprecated `propagate_traces` `init` option in POTel. Important: The Celery integration also has an option called `propagate_traces` -- this should remain unchanged. --------- Co-authored-by: nellaG <[email protected]>
Port `sample_rand` to `potel-base`. See [spec](https://develop.sentry.dev/sdk/telemetry/traces/#propagated-random-value). There are now two places where a `sample_rand` might be generated: - If we're explicitly propagating with `continue_trace`, we'll [backfill](https://github.com/getsentry/sentry-python/pull/4106/files#diff-7c64294459f5053c93d44e0e33e4e73ffcef0adefcd77ba91f4031aa461a8c42R396-R397) `sample_rand` on the propagation context like on master, either using the incoming one or generating a new one from the incoming `sampled`/`sample_rate`. - Otherwise, we generate a new `sample_rand` [in the Sampler](https://github.com/getsentry/sentry-python/pull/4106/files#diff-59aa7195d955e153b5cdd730f888994996a72eaf5e9ea174335ce961841584a9R194-R213). The generated `sample_rand` is then saved on the trace state. This change fixes most of the failures in the Common test suite. Closes #4027 --------- Co-authored-by: Daniel Szoke <[email protected]>
Fixing Celery tests in Potel
Fixes #4063 Co-authored-by: Ivana Kellyer <[email protected]>
- function transports have been removed. removing the related test - `profiles_sample_rate` is not experimental anymore - `continuous_profiling_mode` has been removed so only the top level `profiler_mode` exists. (so the if is not necessary anymore)
Drop: - setting `Scope.transaction` directly - old way of setting `failed_request_status_codes` - setting the `span` argument of `Scope.trace_propagation_meta` - setting `Scope.user` directly
- trytond<5, falcon<3, django<2 are all more than 5 years old Closes #4049
Changing the default of `traces_sample_rate` to `0`. This means incoming traces will be continued, but we will not start traces on our own. (It used to be set to: never start or continue traces by default) Refs #4102
BREAKING CHANGE: Remove `Span.containing_transaction`. Use `Span.root_span` instead. Closes #4253 <!-- 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:
Span.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