Skip to content

Adjust the audit_log_ext column size to keep align with audit_log table #21678

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

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions make/migrations/postgresql/0160_2.13.0_schema.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ CREATE TABLE IF NOT EXISTS audit_log_ext
id BIGSERIAL PRIMARY KEY NOT NULL,
project_id BIGINT,
operation VARCHAR(50) NULL,
resource_type VARCHAR(50) NULL,
resource VARCHAR(50) NULL,
username VARCHAR(50) NULL,
op_desc VARCHAR(500) NULL,
resource_type VARCHAR(255) NULL,
resource VARCHAR(1024) NULL,
username VARCHAR(255) NULL,
op_desc VARCHAR(1024) NULL,
op_result BOOLEAN DEFAULT true,
payload TEXT NULL,
source_ip VARCHAR(50) NULL,
Expand Down
2 changes: 1 addition & 1 deletion src/controller/event/handler/auditlog/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (h *Handler) Handle(ctx context.Context, value interface{}) error {
if auditLog != nil && config.AuditLogEventEnabled(ctx, fmt.Sprintf("%v_%v", auditLog.Operation, auditLog.ResourceType)) {
_, err := auditext.Mgr.Create(ctx, auditLog)
if err != nil {
log.Debugf("add audit log err: %v", err)
log.Infof("add audit log err: %v", err)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/pkg/auditext/event/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func init() {
commonevent.RegisterResolver(`/api/v2.0/configurations`, configureEventResolver)
}

const payloadSizeLimit = 450
// payloadSizeLimit max size allowed in the op_desc
// the size of audit_log_ext's op_desc - 50
const payloadSizeLimit = 950

// resolver used to resolve the configuration event
type resolver struct {
Expand Down
Loading