Skip to content

Move OTel code out of integrations/ #3853

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

Closed
8 tasks done
sentrivana opened this issue Dec 5, 2024 · 0 comments
Closed
8 tasks done

Move OTel code out of integrations/ #3853

sentrivana opened this issue Dec 5, 2024 · 0 comments

Comments

@sentrivana
Copy link
Contributor

sentrivana commented Dec 5, 2024

Right now, POTel is written as an integration. This is problematic since it can be disabled via default_integrations=False. Also in architectural sense it's no longer an integration but an integral part of the SDK, so it's time for it to move out of the integrations/ directory.

This should also enable us to clean up the code and get rid of some inline imports due to circular imports.

Consider not breaking people importing the processor/propagator by reexporting it in the old place. Also add a message, maybe.

@sentrivana sentrivana self-assigned this Apr 3, 2025
sentrivana added a commit that referenced this issue Apr 10, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK.

This moves `sentry_sdk/integrations/opentelemetry/sampler.py` ->
`sentry_sdk/opentelemetry/sampler.py`

Ref #3853
sentrivana added a commit that referenced this issue Apr 10, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK.

This moves `sentry_sdk/integrations/opentelemetry/span_processor.py` ->
`sentry_sdk/opentelemetry/span_processor.py`

Ref #3853

---------

Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
sentrivana added a commit that referenced this issue Apr 10, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK.

This moves `sentry_sdk/integrations/opentelemetry/propagator.py` ->
`sentry_sdk/opentelemetry/propagator.py`

Ref #3853

---------

Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
sentrivana added a commit that referenced this issue Apr 10, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK.

This moves
`sentry_sdk/integrations/opentelemetry/contextvars_context.py` ->
`sentry_sdk/opentelemetry/contextvars_context.py`

Ref #3853
sentrivana added a commit that referenced this issue Apr 14, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK. This moves
`sentry_sdk/integrations/opentelemetry/{utils,consts}.py` ->
`sentry_sdk/opentelemetry/{utils,consts}.py`.

There's quite some stuff moving around in this PR in order to remove
circular dependencies that have to do with `tracing.py`:
- `get_span_status_from_http_code` from `tracing.py` is now in
`tracing_utils.py`
- various constants from `tracing.py` are now in `consts.py`

Additionally, Sphinx was unhappy, so tweaked the way we type some things
in `api.py` and `_init_implementation.py`.

I'll possibly follow this up with creating a nice structure for the
tracing files, maybe a common `tracing` directory with `tracing.py`,
`tracing_utils.py` -> `utils.py`, and dedicated `consts.py`.

Ref #3853
sentrivana added a commit that referenced this issue Apr 14, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK.

This moves `sentry_sdk/integrations/opentelemetry/scope.py` ->
`sentry_sdk/opentelemetry/scope.py`

Ref #3853
@sentrivana sentrivana marked this as a duplicate of #3407 Apr 14, 2025
sentrivana added a commit that referenced this issue Apr 15, 2025
Moving stuff out of `integrations/opentelemetry/` step by step since
there is no OpenTelemetry integration anymore -- it's part of the core
SDK.

- Moved `sentry_sdk/integrations/opentelemetry/integration.py` ->
`sentry_sdk/opentelemetry/tracing.py`.
- Removed all the experimental autoinstrumentation stuff from
`integration.py`.
- Removed `integrations/opentelemetry/` altogether (there was nothing
left but `__init__.py`, which is now also gone).
- Moved all tests from `tests/integrations/opentelemetry` to
`tests/opentelemetry`.
- Removed the potel/opentelemetry integration test targets from
`tox.ini`. These will now be run as part of the Common test suite.

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

No branches or pull requests

3 participants