Skip to content

SDK should not include sentry-trace header in outgoing requests to Sentry #1237

@rhcarvalho

Description

@rhcarvalho

The SDK HTTP client integration should treat requests made by the SDK itself different than other uses of the same HTTP client.

See the last line in:

(e) ~/s/sentry-python ❯❯❯ ipython                                      master ◼
Python 3.9.7 (default, Oct 13 2021, 06:45:31)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.29.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import sentry_sdk

In [2]: sentry_sdk.init("https://d655584d05f14c58b86e9034aab6817f@o447951.ingest
   ...: .sentry.io/5461230", traces_sample_rate=1.0, debug=True)
 [sentry] DEBUG: Setting up integrations (with default = True)
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.django.DjangoIntegration: Django not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.flask.FlaskIntegration: Flask is not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.bottle.BottleIntegration: Bottle not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.falcon.FalconIntegration: Falcon not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.sanic.SanicIntegration: Sanic not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.celery.CeleryIntegration: Celery not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.rq.RqIntegration: RQ not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.aiohttp.AioHttpIntegration: AIOHTTP not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.tornado.TornadoIntegration: Tornado not installed
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.sqlalchemy.SqlalchemyIntegration: SQLAlchemy not installed.
 [sentry] DEBUG: Did not import default integration sentry_sdk.integrations.boto3.Boto3Integration: botocore is not installed
 [sentry] DEBUG: Setting up previously not enabled integration logging
 [sentry] DEBUG: Setting up previously not enabled integration stdlib
 [sentry] DEBUG: Setting up previously not enabled integration excepthook
 [sentry] DEBUG: Setting up previously not enabled integration dedupe
 [sentry] DEBUG: Setting up previously not enabled integration atexit
 [sentry] DEBUG: Setting up previously not enabled integration modules
 [sentry] DEBUG: Setting up previously not enabled integration argv
 [sentry] DEBUG: Setting up previously not enabled integration threading
 [sentry] DEBUG: Enabling integration logging
 [sentry] DEBUG: Enabling integration stdlib
 [sentry] DEBUG: Enabling integration excepthook
 [sentry] DEBUG: Enabling integration dedupe
 [sentry] DEBUG: Enabling integration atexit
 [sentry] DEBUG: Enabling integration modules
 [sentry] DEBUG: Enabling integration argv
 [sentry] DEBUG: Enabling integration threading
Out[2]: <sentry_sdk.hub._InitGuard at 0x10c6e8610>

In [3]: sentry_sdk.capture_message("hello")
Out[3]: '3d200219b7cf4a91ae83b6cbd2f49093'

 [sentry] DEBUG: Sending event, type:null level:info event_id:3d200219b7cf4a91ae83b6cbd2f49093 project:5461230 host:o447951.ingest.sentry.io
In [4]:  [sentry] DEBUG: [Tracing] Adding `sentry-trace` header 98b5922a479e409ebd9b30453c49ef26-b6e3874f16b788d2- to outgoing request to https://o447951.ingest.sentry.io/api/5461230/store/.

There should not be trace propagation happening in that case.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions