Replies: 3 comments 10 replies
-
So glad you brought this up! It's definitely a pain point. Some color:
So pain points from my end are scaling (how many auditable resources do we really want) and UX (how many audit log lines do we really want; how can we make associations between log items clear; how do we handle filtering). |
Beta Was this translation helpful? Give feedback.
-
In the RFC, we set this as a requirement, and the proposed solution was to generate a RequestID that would tie together multiple logs if the request resulted in multiple actions. |
Beta Was this translation helpful? Give feedback.
-
Another reason for this is we log If we can link audit log actions, then we could have a |
Beta Was this translation helpful? Give feedback.
-
Problem
Currently audit logging is initiated per route. This means that each route has at most 1 audit event created. However, single http request can cause multiple changes to multiple entities. This is currently not being tracked.
Examples
Create workspace
Create workspace has multiple db changes;
workspace
,parameters
,provisioner_job
, andworkspace_build
. Onlyworkspace
is logged even though 4 different db changes are made.These tables can be updated in other routes and generate different audit log events (eg
workspace_build
). But because it is a side effect in thecreate workspace
route, it is not logged the same as it is inupdate workspace
.Question
Should we design/implement a way to audit log side effects?
Example
Create workspace
An audit log for the create workspace should be made, as that is the user action. Side effects of the provisioner job and workspace build should also be logged so that they can be tracked in the context of the original user action.
Now a
provisioner
can be searched to see what jobs it ran and see the original context for each job. Without the linking and side effect audit logs, these jobs are impossible to track the origin because only theworkspace
diff and id are logged.Proposal
Linked audit logs (parent -> child or primary -> secondary)
Allow creating linked audit logs with an optional
parent_id
field. Setting aparent_id
of an audit log allows relating to a primary action. In the UI only parent logs should be shown. Children logs should be hidden under some sort of "toggle" to see all side effects of a primary action.We should not allow infinite nesting, and only allow 1 level of "children" logs. We do not want to build full tracing here.
Linked audit log table
A new audit log table for these secondary audit logs would be created.
Other ideas?
You got any?
Beta Was this translation helpful? Give feedback.
All reactions