You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current topdown.Query interface only allows callers to supply one tracer at a time. This is fine for simple cases but it has some limitations. For example, if a user wants to enable tracing and profiling, they can't.
We could extend topdown.Query (and rego.Rego) to support multiple tracers by maintaining a set of tracers in the implementation instead of a single one. For example:
r:=rego.New(rego.Tracer(tracer1), rego.Tracer(tracer2), ...)
r.Eval(ctx)
// do something with tracer1// do something with tracer2
The same applies to topdown.Query:
q := topdown.NewQuery(ast.MustParseQuery("true")).WithTracer(tracer1).WithTracer(tracer2)
rs, err := q.Run()
// do something with tracer1
// do something with tracer2
This could be used immediately in the REPL as well as the eval and test subcommands where profiling and coverage may be used in conjunction with tracing (respectively).
The text was updated successfully, but these errors were encountered:
The current topdown.Query interface only allows callers to supply one tracer at a time. This is fine for simple cases but it has some limitations. For example, if a user wants to enable tracing and profiling, they can't.
We could extend topdown.Query (and rego.Rego) to support multiple tracers by maintaining a set of tracers in the implementation instead of a single one. For example:
The same applies to topdown.Query:
This could be used immediately in the REPL as well as the
eval
andtest
subcommands where profiling and coverage may be used in conjunction with tracing (respectively).The text was updated successfully, but these errors were encountered: