Module: Labkit::Fields
- Defined in:
- lib/labkit/fields.rb
Overview
Fields is intended to be a SSOT for all of the common field names that we emit via any observability we add to our systems.
These fields should span multiple services. This is
The goal of this package is to reduce the likelihood for typos or subtly different naming conventions. This will help to ensure we are able to marry up logs between different systems as a request is being processed.
Usage:
require 'labkit/fields'
...
data[Labkit::Fields::GL_USER_ID] = user.id
...
Labkit (Go): gitlab.com/gitlab-org/labkit/-/tree/master/fields?ref_type=heads
For Engineers Looking to add fields:
These fields are derived from the Go Labkit variant. Please ensure that you’ve made the respective changes in that repository prior to including the fields in this package.
Please see the handbook page for more information handbook.gitlab.com/handbook/engineering/architecture/design-documents/observability_field_standardisation/
Constant Summary collapse
- CORRELATION_ID =
correlation_id - string
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.
"correlation_id"- GL_USER_ID =
GitLabUserID - an integer field that captures the user’s numeric ID for logging purposes.
"gl_user_id"- GL_USER_NAME =
GitLabUserName - a string field that captures the user’s username for logging purposes.
"gl_user_name"