-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replica Function support (Lambda@Edge) #364
Comments
So I take it deploying this monitor to all regions that could have edge function executions doesn't work (yet)? Targeting region functions log groups shouldn't be hard. Why do you want to disable monitoring for those functions? Is it more broken than simply not working? What issues are you seeing? As I said this service works great for us, but we are not currently using edge lambda function. |
No, as is, it seems to be fully broken as I think the Dummy Custom Resources that initially calls those subscribe functions are failing and causing the deploy to fail and roll back. This is maybe to do with it trying to locate a replica's associated log group and failing? Deploying to all regions might work but is a bit overkill in my mind, especially since the regions that are “likely to have edge functions” is all of them. That’s how they work, they get replicated to all edge locations and sit there ready anytime an end user visits from that area. So it would be impossible to predict. I'm going to dive into the code a bit more and see if I can see exactly what the issue might be. But let me know if you have any ideas. I'm very happy to test them. |
I'd love to see what the cloudformation template / resource lambda function logs look like (you need to be quick to find them before everything is torn down). Also I'm sure @MacMcIrish has some input here in what would be interesting to look at! |
AFK, for 1hr then will look for ya. lambda-monitor/src/logic/util/lambda.js Line 28 in 04e8d5e
|
@iDVB Failing on the post deploy hook via a dummy resource is a frustrating issue that I plan to make much easier to understand :) up until now, I was the only one suffering from this, so I'm sorry to put you through my pain. Fortunately this is only an issue on the very first deploy of the stack, as when the initial deploy fails the teardown of the stack also deletes the log group. To examine the log group before the teardown happens:
Once you have this info, it'll be a lot easier to track down the reason that this is failing to stabilise on deploy. Looking forward to hearing back from you! |
Thanks! Actually, it seems to successfully send the error to Rollbar... so I CAN see that its due to
which led me to hypothesize about it not being able to fine the replica log groups. Testing your steps to catch the logs though...
|
Looks like I can see pretty much the same thing in the Rollbar logs |
@iDVB Looks like this is exactly the problem that you anticipated. There are two things to do here: Note: At that point (2) it might be desirable to also prevent subscription if already subscribed (that's #361), but that could also happen later. |
@MacMcIrish @simlu Any reason |
@iDVB Not really. That should probably be changed if the tests just continue working. I've already done that in other places last night. |
Working on a PR for this now... |
Task outline: (1) (2) (3) I would start by figuring out what the lambda event for the CloudTrail log group creation event looks like (i.e. how much meta information is available). |
Going to test to see what we can see in the CT event by letting it trigger a function with |
I'm still in the process of testing out what exactly the issue might be but I have a good hunch that the service does not know how to deal with edge function logs.
Likely this is because they're located in the region that the end user was closest to. (edge location)
This means that when an end user makes a request near Oregon.... then the logs for that lambda will end up in the Oregon region.
Additionally, the log prefix is different as well in that its:
/aws/lambda/us-east-1.demo-stack-proxy-dev-originRequest
vs the traditional...
/aws/lambda/demo-stack-proxy-dev-originRequest
I thought I might be able to shim the issue by running around and putting
MONITORED=0
on all the replica functions... but as it appears (from the console anyway) you can't tag replica functions.I'm not sure how you can even programmatically detect if they are replica functions.... looking into that now.
UPDATE:
You can't seem to see the function when you make a
aws lambda list-functions
but you can see it when youaws lambda get-function
directly. However, there does not seem to be anyreplica
identifying traits other then all replica function names start withus-east-1.
regardless of what region a developer usually uses. Edge function masters always get created inus-east-1
.I'm going to start looking into your source to see if I can just add a check for
us-east-1.
as a prefix in the function name and exclude it for now. Later, maybe there is a way to even have these logging by adding subscription filters to the region related logs.The text was updated successfully, but these errors were encountered: