mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
databroker: add tracing for rego evaluation and databroker sync, fix bug in databroker config source (#1367)
This commit is contained in:
parent
5488e6d5fa
commit
49d1a71ff2
2 changed files with 21 additions and 7 deletions
|
@ -8,6 +8,8 @@ import (
|
|||
|
||||
"github.com/open-policy-agent/opa/rego"
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/telemetry/trace"
|
||||
)
|
||||
|
||||
// A CustomEvaluatorRequest is the data needed to evaluate a custom rego policy.
|
||||
|
@ -42,6 +44,9 @@ func NewCustomEvaluator(store storage.Store) *CustomEvaluator {
|
|||
|
||||
// Evaluate evaluates the custom rego policy.
|
||||
func (ce *CustomEvaluator) Evaluate(ctx context.Context, req *CustomEvaluatorRequest) (*CustomEvaluatorResponse, error) {
|
||||
_, span := trace.StartSpan(ctx, "authorize.evaluator.custom.Evaluate")
|
||||
defer span.End()
|
||||
|
||||
q, err := ce.getPreparedEvalQuery(ctx, req.RegoPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue