#🔒 Need help with resolving issue in python middleware

4 messages · Page 1 of 1 (latest)

rocky wing
#

I’ve an issue in my python application :
Actually I'm creating an python middleware SDK, kind of a remote package, and I'll send it to my clients, so that they can install it in their environment and inject it in their controller (where endpoints are present ) py file of python application
its purpose :
if a call is made to any of endpoints in client's application, I'll add trace_id and parent_trace_id to its headers (for connecting nested calls) before request and
after request I'll call a endpoint (for getting and storing details), along with the current endpoint's request and response details. and same goes for the nested API calls made inside the endpoint.

the issue is:
for
incoming calls: I'm using before_request and after_request methods
outgoing calls: I've overrided request method of "requests.session"
and I'm using a thread variable to update every call's trace_id and parent_trace_id, I'm able to capture every request, but (parent-child) order gets messed up.
is there a way to capture and trace both incoming and outgoing request with a common method

clear ridgeBOT
#

@rocky wing

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

clear ridgeBOT
#

@rocky wing

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.