Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query metrics to decision logs #1033

Closed
ekarlso opened this issue Oct 24, 2018 · 2 comments
Closed

Add query metrics to decision logs #1033

ekarlso opened this issue Oct 24, 2018 · 2 comments

Comments

@ekarlso
Copy link

ekarlso commented Oct 24, 2018

It would be a nice addition to get the query logs that you can get via the http query in the decision logs instead or in addition.

@tsandall
Copy link
Member

tsandall commented Oct 25, 2018

OPA automatically records parse, compile, and evaluation latency for all decisions and the decision log events internal to the server currently have the metrics object on them--however, we don't copy the metrics onto the event struct that's eventually serialized and uploaded.

We need to update the plugins/logs/plugin.go#EventV1 struct to include a Metrics field of type map[string]interface{} (omitempty) and populate in the plugins/logs/plugin.go#Plugin.Log function.

We should add a test case as well that verifies the metrics show up in the batched events.

@BenderScript
Copy link
Contributor

It should be straightforward after #1089 is merged. I will work on it next

tsandall pushed a commit to tsandall/opa that referenced this issue Jan 16, 2019
Fixes open-policy-agent#1033

Signed-off-by: repenno <rapenno@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants