Skip to content
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

aiohttp-client: Fix producing additional spans with each newly created ClientSession #1246

Merged

Conversation

mariojonke
Copy link
Contributor

@mariojonke mariojonke commented Aug 26, 2022

Description

TraceConfigs that are created when a new ClientSession is created were incorrectly added to the effectively global list of trace configs that can be passed as argument to the instrumentor's instrument function. The global list then got inject into the arguments to create the ClientSession. With every TraceConfig in the global list an additional span got created per request.
This even happened when there wasn't passed any trace config list to the instrument function since as default an empty list was used.

Fixes #1207

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Adapted existing tests and added a new one.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added

@mariojonke mariojonke requested a review from a team as a code owner August 26, 2022 09:28
@srikanthccv srikanthccv merged commit 934af7e into open-telemetry:main Aug 27, 2022
shalevr added a commit to shalevr/opentelemetry-python-contrib that referenced this pull request Aug 30, 2022
* main:
  Codespell ci (open-telemetry#1237)
  aiohttp-client: Fix producing additional spans with each newly created ClientSession (open-telemetry#1246)
  Remove support for 3.6 (open-telemetry#853)
  Added the Licence and Manifest file
  Restore metrics in django (open-telemetry#1208)
  fix typo in example codes (open-telemetry#1240)
  boto3sqs: Make propagation compatible with other instrumentations and add 'messaging.url' span attribute (open-telemetry#1234)
  Release 1.12.0-0.33b0 (open-telemetry#1223)
  Fix Flask instrumentation doc link (open-telemetry#1216)
  Feature/metrics instrumentation urllib3 (open-telemetry#1198)
  Metric instrumentation asgi (open-telemetry#1197)
  Metrics instrumentation flask (open-telemetry#1186)
  Adding sqlalchemy native tags in sqlalchemy commenter (open-telemetry#1206)
  ci: fix docs workflow failure (open-telemetry#1211)
  Add psycopg2 native tags to sqlcommenter (open-telemetry#1203)
  SQLCommenter semicolon bug fix (open-telemetry#1200)
  Sync with sdk setup from setUpClass to setUp (open-telemetry#1193)

# Conflicts:
#	CHANGELOG.md
#	instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
#	instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/client.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

instrumentation-aiohttp-client: Number of created spans per request increases by 1 with every new request
2 participants