Closed zhammer closed 5 years ago
Maybe could set correlation id in header on delivery Then all communication methods (requests, queues, sns) could — if they find correlation id — add to their headers / metadata
Wow this is so cool. Lambda handles the xray logging of incoming requests & responses.. then you patch out (in delivery) all of your io libraries.
All of the io libraries i use (sqlalchemy, requests, boto3) already have built in support from the xray sdk!!
https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html
https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python-patching.html
The other difference between instrumenting Lambda functions and web applications is that the segment that Lambda creates and sends to X-Ray cannot be modified by your function code. You can create subsegments and record annotations and metadata on them, but you can't add annotations and metadata to the parent segment.
So all i have to do is “patch_all” in delivery, then use the xray sdk sqlalchemy client (not sure why i cant patch this out too)
from aws_xray_sdk.ext.sqlalchemy.query import XRaySessionMaker
Session = XRaySessionMaker(bind=engine)
session = Session()
setup basic x ray tracing. following up on the sns -> sqs following in #130
https://aws.amazon.com/xray/