Commit 2b6f2615 authored by Kamil Trzciński's avatar Kamil Trzciński
Browse files

Merge branch 'ef-add-further-doc-to-fields-package' into 'master'

Improves the Labkit Fields package documentation

See merge request !203

Merged-by: default avatarKamil Trzciński <ayufan@ayufan.eu>
Approved-by: default avatarKamil Trzciński <ayufan@ayufan.eu>
Co-authored-by: Elliot Forbes's avatare_forbes <eforbes@gitlab.com>
parents d8839b16 edeb45d5
Loading
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
@@ -18,24 +18,37 @@ module Labkit
  #   data[Labkit::Fields::GL_USER_ID] = user.id
  #   ...
  #
  # Labkit (Go): https://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
  # https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/observability_field_standardisation/
  module Fields
    # 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 = "correlation_id"

    # We'll need to add the rest of the top
    # level fields here:
    # [endpoint_id, duration_s, status_code]

    # gl_user_id - integer
    # GitLabUserID - an integer field that
    # captures the user's numeric ID for logging purposes.
    GL_USER_ID = "gl_user_id"

    # gl_user_name - string
    # GitLabUserName - a string field that
    # captures the user's username for logging purposes.
    GL_USER_NAME = "gl_user_name"

    # New fields being added to this section should have
    # the appropriate doc comments added above. These
    # should clearly indicate what the intended use of the
    # field is and should be replicated across the labkit
    # variations.
  end
end