By using AWS re:Post, you agree to the Terms of Use
/How do I query X-ray using a http URL, where that URL is not the first part of the request?/

How do I query X-ray using a http URL, where that URL is not the first part of the request?

0

Hello.

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 X vs A.

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.

1 Answers
0

Hi Dilski,

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!

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions