Skip to content

Commit fc50678

Browse files
committed
jobs: add user to status change event log
Informs #153276 Release note (ops change): In an upcoming release, we're deprecating the bespoke restore and import event logs. For any customer that relies on those logs, we can maintain UX parity by plumbing the sql user that owns the job to the status change event log.
1 parent 4c6b4ce commit fc50678

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

docs/generated/eventlog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ An event of type `status_change` is recorded when a job changes statuses.
660660
| `RunNum` | The run number of the job. | no |
661661
| `Error` | An error that may have occurred while the job was running. | yes |
662662
| `FinalResumeErr` | An error that occurred that requires the job to be reverted. | yes |
663+
| `User` | User is the owner of the job. | yes |
663664

664665

665666
#### Common fields

pkg/jobs/structured_log.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func LogStateChangeStructured(
4343

4444
if payload.Error != "" {
4545
out.Error = payload.Error
46+
out.User = payload.UsernameProto.Decode().Normalized()
4647
}
4748
}
4849

pkg/util/log/eventpb/job_events.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ message StatusChange {
6767

6868
// An error that occurred that requires the job to be reverted.
6969
string final_resume_err = 9 [(gogoproto.jsontag) = ",omitempty"];
70+
71+
// User is the owner of the job.
72+
string user = 10 [(gogoproto.jsontag) = ",omitempty"];
7073
}

pkg/util/log/eventpb/json_encode_generated.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)