Getting exact correlated data from same instance?

Hi New Relic,

I currently have 2 line graphs in one graph by doing 2 queries. This is compare the lambda invocation duration and an external call duration in that lambda. When I do average(duration) and compare this to a specific time in the graph, it does not mean that that specific point was from the same request. What I would like to know is what can I put in the query so that the lambda invocation and the external call are from the same container instance?

In this screenshot, the pink line graph is lambda invocation duration and blue is the external call duration in that lambda. There is no way the lambda could have finished earlier (successfully) when the external call took longer which makes me think these are not coming from the same instance of request and I would like to know how I can make it so it’s from the same request.

Hope this makes sense :sweat_smile:

Thanks!

Bumping this up for more visibility :sweat_smile:

Hey @linh.nguyen.my,

I’m glad you posted about this! You’re probably looking at the same AWS request. because externalDuration can be out-of-process, which I believe means async. The external call might take longer than the function’s invocation and return on a subsequent invocation.

As to how to facet by container id, we don’t have a specific container id in AwsLambdaInvocation or Span events.

To make sure spans are happening in the same request, facet by aws.requestId.

1 Like

Thanks for your response!

Ah okay that makes sense then.

I tried doing FACET aws.requestId but it doesn’t like it. Perhaps because of TIMESERIES?

Bumping again for more visibility

Bumping again :sweat_smile::sweat_smile::sweat_smile::sweat_smile::sweat_smile::sweat_smile::sweat_smile::sweat_smile:

You have FACET twice in your query. You may FACET on multiple attributes by separating them with commas:

SELECT average(duration) ... FACET provider.functionName, aws.requestId TIMESERIES
1 Like

Opps!! My bad, this works now :smiley: thank you!

Do you also know if there is a metric to get the exact duration it took rather than min, max or average?

You might try latest(). You may see a complete list of NRQL clauses and functions here: NRQL syntax, clauses, and functions | New Relic Documentation.

1 Like