Comments (6)
Hi, I answered this question in a stack overflow post here.
But I copy/paste my answer here regardless:
The node you see comes from this PR #19 for adding support to httplib. If you use patch_all
httplib operations will also be captured. In your case the dependency tree is boto3
-> botocore
-> vendored requests
-> httplib
. So your AWS subsegment will have children subsegments that representing operations executed by httplib
.
The service graph however will render a "remote" subsegment as a node which is what you see. The recommended way is to explicit patch the library you want to capture to avoid unexpected behavior.
from aws-xray-sdk-python.
Ok I understand what happens.
However, I do not think it is a good design to leave patch_all()
as it is now, for a user may imagine patch_all()
is a ready-to-use one-line patch that just traces every call exactly once.
Maybe we can do something to avoid this. For example, whenever a httplib
call is traced, the tracing code examines whether the xray_recorder
examines current tracing environment.
- context is
segment
, trace. - context is
subsegment
which islocal
, trace. - context is
subsegment
which isaws
orremote
, DO NOT trace.
from aws-xray-sdk-python.
Actually IMHO the SDK should ignore any new subsegment in a remote
subsegment context.
from aws-xray-sdk-python.
Thank you for the suggestions. These are very good points. There are use cases where user want to trace both boto3
and httplib
as boto3
tracing doesn't have as much granularity as httplib
(retries, establishing connection etc). In that case although the service graph is not in an ideal shape due to lack of a mechanism to do custom aggregation, but trace timeline has much more information on the lowest python level information.
But yes to your point the redundant nodes are confusing. I propose to have patch_all
takes a flag of supporting indirect dependency or not. By default if library A and B are both supported but A depends on B, patch_all()
will not patch B. But with a flag set to True
, if will patch all libraries regardless of their relationships.
Please let me know your thoughts on this.
from aws-xray-sdk-python.
Extra argument on patch_all
is great. I'd love to see that.
from aws-xray-sdk-python.
This is added in release 2.0.0 with default to not do double patching.
from aws-xray-sdk-python.
Related Issues (20)
- aws-xray-sdk 2.11.0 removes causes from exceptions HOT 1
- ERROR: cannot find the current segment/subsegment when segment is open and uploading file to s3. HOT 3
- Installing SDK without botocore and other transitive dependencies HOT 4
- Custom emitter based on boto3 creates an infinite loop in the SDK HOT 3
- Bug: nested subsegments don't work across threads HOT 4
- IndexError when using AWS X-Ray SDK with SQLAlchemy HOT 1
- EKSPlugin HOT 1
- Very rare ReferenceError HOT 2
- Support for psycopg3 HOT 2
- Link a Textract async operation with downstream process HOT 1
- Current tox versions do not like how testenv.passenv is set
- aws_xray_sdk.core.exceptions.exceptions.SegmentNameMissingException: Segment name is required. HOT 1
- Using psycopg2 connection_factory throws exceptions HOT 4
- Documentation for patch_all HOT 2
- Sampling configuration should discuss DefaultSampler vs. LocalSampler HOT 1
- Flask middleware errors when an earlier Flask extension throws an exception in a before_request method HOT 1
- Patched DB cursor and template may record outside of XRayMiddleware HOT 2
- Segment not propgated when subsegment metadata is sufficiently long HOT 4
- sqlalchemy_core patch errors for unencoded special characters in db url HOT 1
- Error when using AsyncContext in python 3.11.5 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-xray-sdk-python.