Skip to main content

Review policy runs

Review execution metadata to assess evaluation freshness, run statistics, and job diagnostics.

Find the Policy Run​

Use PolicyRun to review an evaluation's timing and outcome counts. Use PolicyRunJob to investigate the BigQuery work behind that evaluation.

With BigQuery access, replace the project, dataset, and policy ID below:

SELECT policyId, policyName, runTime, snapshotTime, completed, stats
FROM `YOUR_PROJECT.YOUR_CE_DATASET.PolicyRun`
WHERE policyId = '/ce/YOUR_ORG/YOUR_POLICY'
AND runTime >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
AND runTime < CURRENT_TIMESTAMP()
ORDER BY runTime DESC
LIMIT 20;

Choose the relevant row and retain its exact policyId and runTime for investigation. If none appears, confirm identifiers, available history, and expected evaluation timing with your Technical Account Manager (TAM).

Compare Run Time and Snapshot Time​

runTime identifies when evaluation executed; snapshotTime identifies its input snapshot. Compare both with the configuration change or incident you are investigating. A recent execution can still use an earlier snapshot.

If timing is unexpected, confirm collection, export, and evaluation behavior with your TAM before treating the result as evidence of a recent change.

Review Counts and Execution Status​

completed indicates whether the policy execution completed successfully. The nested stats record counts resources by outcome:

FieldOutcome Count
stats.compliantRequirements satisfied
stats.incompliantViolations
stats.inapplicableRequirements not applicable
stats.undeterminedInconclusive outcomes
stats.disappearedResources no longer present at their source

Successful execution does not mean every resource passed. Compare counts across runs in context: inventory and policy logic can change. Follow Find your first policy result to inspect individual outcomes.

Inspect Job Metadata and Query Cost​

Filter PolicyRunJob by the selected policyId and exact runTime. Inspect each returned jobId; do not assume there is only one job per run. Field types are listed in the dataset schema.

FieldWhat to Inspect
jobStatusRecorded BigQuery execution state
scriptCreationTimeScript creation time
scriptStartTime, scriptEndTimeExecution timing and elapsed interval
totalBytesProcessedData processed, in bytes
totalBytesBilledData billed, in bytes

Use these values to compare execution workloads. Byte counts are volumes, not currency charges. A job state such as DONE is not a resource compliance status; investigate errors through the available job diagnostics.

When requesting assistance, provide the policy ID, run time, job ID, observed state, and expected behavior. Confirm which job details your account can access.

Inspect Captured YAML and SQL​

Where available, inspect policyYaml for the captured policy definition and policySql for the executed SQL. Compare these with the implementation you intended to evaluate when investigating unexpected outcomes.

Keep the job identifiers with any saved excerpts. Captured content provides execution context; it does not by itself establish a Git commit ID. Coordinate revision verification with your TAM when reviewing a deployment.

Continue with Review resource results for resource evidence, or Test and debug policies to investigate logic behavior.