add analytics to APIGW NextGen REST API handler chain#11860
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 26m 27s ⏱️ - 1h 17m 34s Results for commit cb1fc52. ± Comparison against base commit 5b44747. This pull request removes 2718 tests. |
cloutierMat
left a comment
There was a problem hiding this comment.
Thanks for adding this! So awesome how clean it is to add this as a handler! 🚀
I have a couple questions as to the relevancy of some of the captured data point. If you feel those are important, let's merge. But if not, we might be better to eliminate some noise? 🤔
| # if the invocation does not have an integration attached, it probably failed before routing the request, | ||
| # hence we should count it as a NOT_FOUND invocation | ||
| invocation_type = "NOT_FOUND" |
There was a problem hiding this comment.
Question: I wonder if this is a relevant data point? On it's own, what intel can we gather from it, except for maybe knowing the total amount of requests sent to apigw? But is it relevant?
There was a problem hiding this comment.
I think it would be good to know the total amount of requests sent to the endpoint. Not very relevant directly, but I think relevant if we do the sum of all types regardless of their value?
There was a problem hiding this comment.
Maybe @thrau could chime in too, I also see the point, so yeah I think it depends on expectations!
There was a problem hiding this comment.
Btw, I am OK either way! 👍 I was simply raising a question, to make sure we are deliberate with logging 😉
| if not integration_uri: | ||
| return "null" | ||
|
|
||
| if len(split_arn := integration_uri.split(":", maxsplit=5)) < 4: | ||
| return "null" |
There was a problem hiding this comment.
Question: Same here. It seems we are we just capturing misconfigured Api? Is it relevant?
There was a problem hiding this comment.
The check is mostly to avoid exceptions, making sure we have a proper value to send
Motivation
As part of our effort to improve our analytics, this PR implements usage counters for API Gateway.
We can now properly have usage data on APIGW invocations, with the integration type (
AWS_PROXY,MOCKetc), and in case of theAWSintegration, the service the integration is targeting (dynamodb,sqsetc..)Changes