zalando / spilo

Highly available elephant herd: HA PostgreSQL cluster using Docker
Apache License 2.0
1.53k stars 382 forks source link

add function to list last status of active cron jobs #824

Closed FxKu closed 1 year ago

FxKu commented 1 year ago

We want to alert on failing cron jobs. But robot_zmon user has no rights to query tables cron.job and cron.job_run_details. Even when granted USAGE and SELECT, the details are protected by a row level policy. Therefore, the PR suggests to add a wrapper function with SECURITY DEFINER to allow the invoker to list the last status of active cron jobs.

hughcapet commented 1 year ago

do we want this function to be accessible for all users or only for robot_zmon?

FxKu commented 1 year ago

all users that have access to metric_helpers schema, I would say

hughcapet commented 1 year ago

👍

FxKu commented 1 year ago

:+1: