Inject HTTPStatusCode

I am using below query to display data:

SELECT rate(count(*), 1 second) from Span where aws.lambda.arn = ‘arn:aws:lambda:us-east-1:414362371211:function:iam-login’ FACET request.uri WHERE request.uri =’/auth’ TIMESERIES limit max

I want to customize the data to display according to
Number of 200 responses from /auth vs number of 401 responses from /auth


Hi, @sjadhav2: Try this:

SELECT count(*)
FROM Span 
WHERE aws.lambda.arn = 'arn:aws:lambda:us-east-1:414362371211:function:iam-login' 
  AND request.uri = '/auth' 
FACET response.statusCode

Thanks Phil for replying to the topic.
However, looks like FACET condition not working. The above query returns “No Chart Data Available”

OK. Will you please post the New Relic account ID containing the data in question? I believe a support engineer will need to look at your data. Thank you!

OK, it looks like your data does not include response codes. You may use the following query to see available attributes:

SELECT keyset() 
FROM Span 
WHERE aws.lambda.arn = 'your-aws-arn'

Without response codes, you cannot facet by response code. :slight_smile:

According to our documentation, both Span and AwsLambdaInvocation events should include a response.status or response.statusCode attribute, so I am not sure why yours do not.

You may be able to modify your Lambda function to capture the response code as a custom attribute.