question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Context "leaking" between Flask apps

See original GitHub issue

(After a few exchanges with support, I was told to post my issue here and tag @untitaker)

Our application serves multiple flask apps via subdomain dispatching.

I am noticing that the context/tags set in one app are occasionally “leaking” over into the others, as if the sentry context is not always isolated between apps. Hopefully I am just configuring something wrong, but I don’t believe our set-up is especially complicated.

A brief example/summary: One Flask app runs our API routes/logic and another runs our web admin interface. Both apps have before_request hooks that set a Sentry tag called “interface” to either "api" or "admin". In general, all issues/errors triggered in the API app show up in Sentry with the correct “interface” tag value (api), and same with the admin issues. However, occasionally, there are, for example, issues triggered in the admin app that appear in Sentry tagged with "api". Additionally, the transaction value is completely mismatched with the url value (for that given event).

Any guidance here? Let me know what other details I can provide to help debug. I can provide links to relevant Sentry issues/events in private communication.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
untitakercommented, Aug 1, 2020

@michaelbukachi this was a bug in the SDK and has been resolved in 0.6.3. I am quite certain your issue is unrelated. Please file a new issue or ask on StackOverflow.

0reactions
michaelbukachicommented, Aug 1, 2020

@ibushong I’m curious to know how you implemented sentry for each app. Currently doing a similar setup and but we are kinda stuck. We keep getting a

Warning: Integration <class 'sentry_sdk.integrations.stdlib.StdlibIntegration'> attempted to run but it was only enabled on init() but not the client that was bound to the current flow.  Earlier versions of the SDK would consider these integrations enabled but this is no longer the case.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Flask App Memory Leak caused by each API call
Flask App Memory Leak caused by each API call · Pull some data from MongoDB based on an ID provided. · From what's...
Read more >
The Request Context — Flask Documentation (1.1.x)
When the Flask application handles a request, it creates a Request object based on the environment it received from the WSGI server. Because...
Read more >
Deployment Blues : Why Won't My Flask Web App Just @# ...
If you see this message frequently, you may have a memory leak in your application or may be using an instance with insufficient...
Read more >
flask.stream_with_context — Flask API - GitHub Pages
Request contexts disappear when the response is started on the server. This is done for efficiency reasons and to make it less likely...
Read more >
Detecting Memory Leak in Python - Superuser
To give bit more context on application which was leaking memory, it was a flask app with traffic mostly on one API endpoint...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found