I'm using Open Policy Agent (https://www.openpolicyagent.org/docs/latest/). I'm using it in kubernetes. I have various user traffic going on. I have such container logs:
{"client_addr":"[::1]:52362","level":"info","msg":"Received request.","req_body":"","req_id":21,"req_method":"GET","req_params":{},"req_path":"/v1/policies","time":"2022-04-26T15:39:57Z"}
{"client_addr":"[::1]:52362","level":"info","msg":"Sent response.","req_id":21,"req_method":"GET","req_path":"/v1/policies","resp_body":"","resp_bytes":28883,"resp_duration":4.901654,"resp_status":200,"time":"2022-04-26T15:39:57Z"}
I would like to use these logs for monitoring, because they show response status request details, duration and so on. Does anyone has any idea how to get these logs on regular basis? I would like to persist them in my database.
I tried the /metrics endpoint: https://www.openpolicyagent.org/docs/latest/monitoring/ but it has little details, not rich enough for my need.
I also tried decision logs: https://www.openpolicyagent.org/docs/latest/management-decision-logs/ they are good, but they don't cover all the requests made to OPA.
In my use case, I would like to populate requests database of Azure App Insights
Is there a way to capture all the requests?