How do I query X-ray using a http URL, where that URL is not the first part of the request?
Suppose that I have the following architecture:
API Gateway (service name: gateway api) -> Lambda Function (service name: gateway handler) -> API Gateway (service name: internal service) -> Lambda Function (service name: internal service handler)
The "internal service" api gateway has 2 endpoints (
POST /endpointA and
POST /endpointX), which both proxy to the same "handler" lambda function. Depending on a feature flag, incoming requests are requests to the "gateway handler" are sent to either
POST /endpointA or
POST /endpointX. All of these services are set up for tracing with AWS X-ray.
I want to query X-Ray to gain insights into the performance of requests send to
I tried the following query
service("gateway handler") AND service("internal service") AND http.url ENDSWITH "/endpointX" // and also // service("gateway handler") AND service("internal service") AND http.url ENDSWITH "/endpointA"
However this does not seem to work. In general I cannot query using http.url, when that http request is not the first request in a trace.
Is there a way around this? Bonus points if it does not require me to add additional code to annotate traces for the xray system.
As you observed, all of the
http filters are scoped to only the root segment of the trace. This means that it is not possible to filter on
http.url for a downstream segment. In your case, I would suggest that the
internal service node be split into two, one for each API. This would let you view the aggregated statistics of each endpoint separately on the service graph and to filter the traces with the expressions
service("gateway handler") AND service("internal service /endpointA") or service("gateway handler") AND service("internal service /endpointX")
Hope this helps!
Private API Gateway URL is not accessibleasked 3 years ago
How do I specify the data type of URL Query String Parameters in REST API Gateway Method Requests?Accepted Answerasked 5 months ago
How do I query X-ray using a http URL, where that URL is not the first part of the request?asked 2 months ago
I am having an issue in API Gateway that says " No integration defined for method" when I attempt to deployasked 3 months ago
Build a REST API with API Gateway private integration: TutorialAccepted Answerasked 4 months ago
Where do I find the URL to my DynamoDB API?asked 5 years ago
Setting up DCV connection gateway and a Session Resolver with the url that is not at the root?asked a month ago
Internal Server Error from API Gateway when sending queries through gateway to Lambda function connected to RDS databaseasked 3 months ago
Is there any AWS service that is able to log URL query string?asked 5 months ago
Protect HTTP Api Gateway with WAFasked 3 months ago