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개 답변
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!

AWS
lexgu
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠