Skip to content

Flask instrumentation example doesn't work #550

Closed
@AntonKueltz

Description

Describe your environment
Running on MacOS against the latest mater version of the opentelemetry-* packages.

Steps to reproduce
Instrument the app as described in the docs and docstring -

from flask import Flask
from opentelemetry.ext.flask import instrument_app
    
app = Flask(__name__)
instrument_app(app)

What is the expected behavior?
I would expect the flask app to start without any errors when running it locally.

What is the actual behavior?
I get an error running the app -

    from opentelemetry.ext.flask import instrument_app
E   ImportError: cannot import name 'instrument_app'

This is consistent with the fact that the instrument_app symbol no longer appears to be in opentelemetry.ext.flask.


The last time I ran this code was against v0.3 of the packages, so I imagine a lot has changed since then. It would be helpful to document the new correct way to instrument flask apps as it isn't currently clear to me what the correct way to do this is from looking at the docs and the code. Thanks!

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginstrumentationRelated to the instrumentation of third party libraries or frameworks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions