# Uow monitoring Lambda


A lambda that selects ACTIVE unit of work and checks how long this UoW is in the ACTIVE state.
If UoW stays in ACTIVE state more than configured hours then Lambda trigger monitor on DataDog side. 

When triggered UoW changed status to not ACTIVE the Lambda resolve previously triggered monitor.

No data in payload is required. Just run with empty `{}`

These env variables required to be set:
1. "ENVIRONMENT"
2. "RDS_SECRETS_KEY" - PG connection creds
3. "DSP_CONFIG_PATH" - config with uow_active_hours_threshold
4. "DATADOG_SECRETS_KEY" - Datadog creds
