diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ca46dd342c2a4a26520ddc32ac959d144e28553..1c8d02886c9624f4b8461e7680bef222115c52be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,7 +55,7 @@ variables: - GO_FIPS_VERSION: ["1.23", "1.24", "1.25"] backwards_compat: - image: registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bookworm-golang-1.23-rust-1.73:git-2.45 + image: registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bookworm-golang-1.24-rust-1.73:git-2.45 parallel: matrix: - REPO_AND_DIR: diff --git a/README.md b/README.md index 3cbc02502fedfdeed087031d2e5b9ac06ce506ba..d82237a37e56a3341511ca3aa88a3cca579abddb 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,18 @@ import ( ) ``` +### Fields + +[![](https://godoc.org/gitlab.com/gitlab-org/labkit/fields?status.svg)](http://godoc.org/gitlab.com/gitlab-org/labkit/fields) + +```go +import ( + "gitlab.com/gitlab-org/labkit/fields" +) + +// fields.GitLabUserID - returns the constant field name you should use to represent this data. +``` + ## Developing LabKit Anyone can contribute! diff --git a/fields/doc.go b/fields/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..505b2b7154963bc62228f3b423fea02cb297d874 --- /dev/null +++ b/fields/doc.go @@ -0,0 +1,8 @@ +/* +Package fields is intended to be the SSOT for Go applications for all +of the field names used within our observability setup. + +This is intended to help enforce consistency across components when it +comes to field names. +*/ +package fields diff --git a/fields/fields.go b/fields/fields.go new file mode 100644 index 0000000000000000000000000000000000000000..930a4ee88d5a689a6cdff0f23d8a5c64632007a0 --- /dev/null +++ b/fields/fields.go @@ -0,0 +1,18 @@ +package fields + +const ( + // correlation_id - string + // This field is used to correlate + // the logs emitted by all of our systems. + // This should be present in all log line + // emissions. + CorrelationID = "correlation_id" + + // GitLabUserID - an integer field that + // captures the user's numeric ID for logging purposes. + GitLabUserID = "gl_user_id" + + // GitLabUserName - a string field that + // captures the user's username for logging purposes. + GitLabUserName = "gl_user_name" +)