python-flask icon indicating copy to clipboard operation
python-flask copied to clipboard

Allow to have the app set late for FlaskTracing.

Open carlosalberto opened this issue 6 years ago • 8 comments

Addresses #22

carlosalberto avatar Oct 26 '18 16:10 carlosalberto

Hey @denisdubovitskiy does this looks fine to you? Does this solve your needs? Let me know ;)

carlosalberto avatar Oct 29 '18 17:10 carlosalberto

@carlosalberto seems better enough ;-). But what if you need to initialize a tracer by configuring it from the app.config (I mean host, port, service name, etc?

denisdubovitskiy avatar Nov 02 '18 22:11 denisdubovitskiy

Init_app approach actually allows you to defer actual object creation/initialization. It means that if I call FlaskTracer() without any args and then pass an app in init_app() - the tracer will be initialized using app.conf vars during app creation, not on any other level. As an example you can see how other useful modules provide such a functionality. To get an idea, I recommend you to look into the sources of FlaskRedis or FlaskSQLAlchemy - most widely used ones

denisdubovitskiy avatar Nov 02 '18 22:11 denisdubovitskiy

I see. I'm going to rename the name to init_app to make it more Flask-esque.

About the configuration being taken from app.conf I will cook later some another PR, as this would be needed on the base case as well (that is, Flask(app=app), and consume both the passed arguments and the ones in app.conf, if any).

carlosalberto avatar Nov 06 '18 16:11 carlosalberto

Hi there! Is there a timeline for when this will be merged into master? This functionality is definitely super handy!

etmitchell avatar Nov 28 '18 18:11 etmitchell

@etmitchell @carlosalberto Yeah! We're also waiting for this PR to be merged!

denisdubovitskiy avatar Nov 28 '18 18:11 denisdubovitskiy

Any changes?

denisdubovitskiy avatar Jun 26 '19 19:06 denisdubovitskiy

Did this ever get merged? Seems like it passes checks, code is complete, etc.

tcopple avatar May 07 '20 17:05 tcopple

This package is no longer being maintained, users should migrate to the opentelemetry-api package.

Closing.

ptmcg avatar Feb 29 '24 22:02 ptmcg