Skip to content

Comment out aiohttp-server from bootstrap_gen libraries #2299

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

tammy-baylis-swi
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi commented Feb 26, 2024

Description

Removes opentelemetry-instrumentation-aiohttp-server from libraries list used to find and install instrumentors that match installed Python frameworks at bootstrap.

For example: with Opentelemetry 1.23.0/0.44b0, Python 3.9 and aiohttp 3.9.3 in a test environment, I get RuntimeError at opentelemetry-bootstrap:

ERROR: Could not find a version that satisfies the requirement opentelemetry-instrumentation-aiohttp-server==0.44b0 (from versions: none)
ERROR: No matching distribution found for opentelemetry-instrumentation-aiohttp-server==0.44b0
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/opentelemetry/instrumentation/bootstrap.py", line 35, in wrapper
    return func(package)
  File "/usr/local/lib/python3.9/site-packages/opentelemetry/instrumentation/bootstrap.py", line 51, in _sys_pip_install
    subprocess.check_call(
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-m', 'pip', 'install', '-U', '--upgrade-strategy', 'only-if-needed', 'opentelemetry-instrumentation-aiohttp-server==0.44b0']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/opentelemetry-bootstrap", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.9/site-packages/opentelemetry/instrumentation/bootstrap.py", line 156, in run
    cmd()
  File "/usr/local/lib/python3.9/site-packages/opentelemetry/instrumentation/bootstrap.py", line 118, in _run_install
    _sys_pip_install(lib)
  File "/usr/local/lib/python3.9/site-packages/opentelemetry/instrumentation/bootstrap.py", line 43, in wrapper
    raise RuntimeError(msg)
RuntimeError: Error calling system command "/usr/local/bin/python -m pip install -U --upgrade-strategy only-if-needed opentelemetry-instrumentation-aiohttp-server==0.44b0" for package "opentelemetry-instrumentation-aiohttp-server==0.44b0"

This PR temporarily patches #2053 until PyPI package is made available.

Related to #2258.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

In a python:3.9 docker container, I have a FastAPI app that uses aiohttp 3.9.3. I locally installed a working copy of opentelemetry-instrumentation and its dependencies (pip install -Ie <dir>). The updated libraries list stops the RuntimeError from happening and bootstrap finishes.

Does This PR Require a Core Repo Change?

  • Yes.
  • 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
  • Documentation has been updated

@tammy-baylis-swi
Copy link
Contributor Author

tammy-baylis-swi commented Feb 26, 2024

Investigating the generate failure. EDIT: addressed in e19b13a

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review February 26, 2024 22:40
@tammy-baylis-swi
Copy link
Contributor Author

Closing because can be addressed by this existing PR: #2101

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant