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

Missing type stubs for instrumentation #3021

Open
vikigenius opened this issue Nov 15, 2024 · 3 comments
Open

Missing type stubs for instrumentation #3021

vikigenius opened this issue Nov 15, 2024 · 3 comments

Comments

@vikigenius
Copy link

Describe your environment

OS: Void Linux
Python version: Python 3.12
SDK version: 1.28.1
API version: 1.28.1

What happened?

Pyright type checker complains about missing type stubs for

Stub file not found for "opentelemetry.instrumentation.asgi"

And

Stub file not found for "opentelemetry.instrumentation.sqlalchemy"

These are the two I checked presumably there could be more missing type stubs.

Steps to Reproduce

Just import

    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
    from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor

And run pyright in strict mode. Or use basedpyright that is strict by default.

Expected Result

No complaints from pyright about missing type stubs

Actual Result

complaints from pyright about missing type stubs

Additional context

No response

Would you like to implement a fix?

None

@vikigenius vikigenius added the bug Something isn't working label Nov 15, 2024
@aabmass aabmass transferred this issue from open-telemetry/opentelemetry-python Nov 18, 2024
@aabmass aabmass added feature-request and removed bug Something isn't working labels Nov 18, 2024
@aabmass
Copy link
Member

aabmass commented Nov 18, 2024

I think in most cases, we are simply missing type stubs for most of this repo. PRs are always welcome to improve typing!

@Kludex
Copy link
Contributor

Kludex commented Nov 19, 2024

Can I enforce with a type checker on the files I improve them?

@xrmx
Copy link
Contributor

xrmx commented Nov 19, 2024

Can I enforce with a type checker on the files I improve them?

Sure, we are already doing partial type checking in the core repo

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

4 participants