zalando/skipper

OPA: Enable evaluation trace to spans

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
When trying to pin point performance issues for specific requests, it would be helpful to get more insights into which rules take how much time.

Describe the solution you would like
OPA allows to configure a query tracer via the rego.EvalQueryTracer() evaluation option. We could introduce a query tracer the adds all events to the Span via LogKV. Since this can create some overhead, this should be hidden behind a command line flag s.t. it can for example only be enabled in test clusters.

Describe alternatives you've considered (optional)
We can replicate the issue locally and run opa eval --profile if we can replicate the whole http request

Additional context (optional)
This requires an upgrade to OPA v0.70 as the corresponding envoy plugin was changed to allow passing evaluation options to the Eval method.

Would you like to work on it?
Yes