gatekeeper icon indicating copy to clipboard operation
gatekeeper copied to clipboard

Provide a metric with OPA runtime errors

Open stek29 opened this issue 1 year ago • 9 comments

Describe the solution you'd like I'd like to have a metric to monitor gatekeeper having OPA Runtime errors like this one:

libs[\"lib_1\"]:45: eval_conflict_error: functions must not produce multiple outputs for same inputs

Currently there seems to be no way to differentiate between evaluations which returned a violation and evaluations which ended with a runtime error -- both are considered a violation.

Anything else you would like to add: It might be a simple counter, probably labeled by enforcement action both audit and webhook should have it

Environment:

  • Gatekeeper version: v3.11.0

stek29 avatar May 02 '23 16:05 stek29

Hi,

Thanks for the suggestion!

I agree that we should have a metric that shows runtime errors when evaluating rego.

However, doing so will require some work as the Constraint Framework would need to be modified in order for it to know how to which Constraint Template failed (currently it will just return a runtime error that is not specific to particular constraint).

The next related, but technically orthogonal, problem would be to figure out how to give the user control over the enforcement action when these runtime errors are encountered. At first glance, we could expose an extra field in a Constraint to specify what enforcement action should be taken on runtime failure, maybe something like spec.failureEnforcementAction (name TBD).

davis-haba avatar May 11 '23 03:05 davis-haba

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '23 04:07 stale[bot]

this is still an issue

stek29 avatar Jul 10 '23 10:07 stek29

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 08 '23 23:09 stale[bot]

afaik -- this is still an issue

stek29 avatar Sep 09 '23 00:09 stek29

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 08 '23 00:11 stale[bot]

still an issue as far as I know

stek29 avatar Nov 08 '23 07:11 stek29

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 08 '24 16:01 stale[bot]

still an issue as far as I know

stek29 avatar Jan 21 '24 22:01 stek29

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 22 '24 02:03 stale[bot]