Skip to content

Conversation

@andremm
Copy link
Contributor

@andremm andremm commented Jun 11, 2025

Description

There's one instrumentation example inside asgi that doesn't run. This PR fixes the example, so it runs.

Type of change

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

How Has This Been Tested?

  1. Clone contrib repo: git clone https://github.com/open-telemetry/opentelemetry-python-contrib
  2. Clone OTel Python repo: git clone https://github.com/open-telemetry/opentelemetry-python
  3. Access the contrib repo: cd opentelemetry-python-contrib
  4. Create a virtual env: python3 -m venv otelvenv
  5. Activate the virtual env: source otelvenv/bin/activate
  6. Install common dependencies:
pip install opentelemetry-distro/ opentelemetry-instrumentation/ \
 ../opentelemetry-python/opentelemetry-semantic-conventions/ \
 ../opentelemetry-python/opentelemetry-api/ \
 ../opentelemetry-python/opentelemetry-sdk/ \
 ../opentelemetry-python/opentelemetry-proto/ \
 ../opentelemetry-python/exporter/opentelemetry-exporter-otlp-proto-common
  1. Install asgi specific requirements:
pip install -r instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt
  1. Copy the instrumentation examples inside the instrumentation main __init__.py file into different Python files and try to run them.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • 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

@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 13, 2025
@xrmx xrmx enabled auto-merge (squash) June 16, 2025 08:34
@xrmx xrmx disabled auto-merge June 16, 2025 08:35
@xrmx
Copy link
Contributor

xrmx commented Jun 16, 2025

Need to fix opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py:1:0: C0302: Too many lines in module (1012/1000) (too-many-lines)

@xrmx xrmx moved this to Reviewed PR that needs fixing in @xrmx's Python PR digest Jun 30, 2025
@xrmx xrmx merged commit 6977da3 into open-telemetry:main Jun 30, 2025
625 checks passed
@github-project-automation github-project-automation bot moved this from Reviewed PR that needs fixing to Done in @xrmx's Python PR digest Jun 30, 2025
@andremm andremm deleted the asgi-snippet branch July 11, 2025 17:35
devmonkey22 pushed a commit to devmonkey22/opentelemetry-python-contrib that referenced this pull request Aug 5, 2025
* Improve asgi instrumentation example

* Fix indentation of asgi instrumentation example

* Improve type hints of asgi instrumentation example

* Ignore pylint too-many-lines

---------

Co-authored-by: Riccardo Magliocchetti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants