Unified view for all edge function errors?

Howdy. I have many edge functions and would like the ability to view (and maybe even be notified) if one of them ran into an error. Currently I visit each edge function's logs and filter for errors, but that's no fun. I looked for a solution in the logs explorer and found a template for Errors - but it doesn't include the function name. Couldn't find a way to add the function name. Any ideas?
5 Replies
silentworks
silentworks2w ago
There is no unified view at the moment. You just have to check them individually. I haven’t tested this but maybe on the reports section of the dashboard you could get information on all of them.
Michael | Brand Visibility in AI
i would pay $10/mo for a tool that will check all of them every 2 minutes and notify me if there is a problem. my system is in production - got users depending on it
silentworks
silentworks2w ago
Hopefully someone comes along and create such a tool for you. You can also make the suggestion of this feature to Supabase on their GitHub repository.
inder
inder2w ago
You can use the function_id to query function logs
select id, function_edge_logs.timestamp, event_message, response.status_code, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from function_edge_logs
cross join unnest(metadata) as m
cross join unnest(m.response) as response
cross join unnest(m.request) as request
WHERE m.function_id = '1bc9be2f-77a5-4008-b37c-4421ac7be305' AND status_code >=500
order by timestamp desc
limit 100
select id, function_edge_logs.timestamp, event_message, response.status_code, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from function_edge_logs
cross join unnest(metadata) as m
cross join unnest(m.response) as response
cross join unnest(m.request) as request
WHERE m.function_id = '1bc9be2f-77a5-4008-b37c-4421ac7be305' AND status_code >=500
order by timestamp desc
limit 100
and you can use management api to get your function_id based on function name https://supabase.com/docs/reference/api/v1-get-a-function
inder
inder2w ago
No description

Did you find this page helpful?