gitlab-labkit 1.10.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/labkit/fields.rb +38 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce9130ded76934b6e21e82724c7371548b9e790e451179a7e70cd14f545969d7
4
- data.tar.gz: 1463999f63f123911a57a45d6943fb68e25daa07338cc2afd49f9592cb71ffb0
3
+ metadata.gz: d63e4f781c8e316f19c419a52485bd751cef83e713f7da971e3285709760a669
4
+ data.tar.gz: a13c2d6a3b9f217f0d65c5a755ff213db29b21dad1e20d2cc5ea17a5bea3dda5
5
5
  SHA512:
6
- metadata.gz: df940f5abe8e939c2bb84440ed9ad340dc2e4a359dddc330d752f778e1d9c7c5aa2a6d19ee233081a7fc0cfd512e7cf5e54ad44fd419d11b2d0f85030ad6fd56
7
- data.tar.gz: eee7205f950d1c9bf59060d25d0e5e7a196dadc98b521064813014129e022b2e3c9a5adfad68332b4ba1e2b9f75cbe6a6e8625cc228daa9d2976edbc05a31c25
6
+ metadata.gz: 5e5983bc819202df660c1965efb7d26dd74f89c7479d01974a3d4f56e5a2c09a4d9fa01cac41719d80048d6737a676cc3fb3d9492cfb1619eb715932cf2ad6ff
7
+ data.tar.gz: 44d1210ee82ef16a99150316f73b76be43942fedaad296b78c925a3e270a8e6b39e4e3cbf43e63488048b11f7d69b40ad3dcfdcc514b8d6bbb4dfe805a28173a
data/lib/labkit/fields.rb CHANGED
@@ -80,6 +80,28 @@ module Labkit
80
80
  # request receipt to first response byte written.
81
81
  TTFB_S = "ttfb_s"
82
82
 
83
+ # GitLab project numeric ID.
84
+ GL_PROJECT_ID = "gl_project_id"
85
+
86
+ # GitLab pipeline numeric ID.
87
+ GL_PIPELINE_ID = "gl_pipeline_id"
88
+
89
+ # Log event timestamp in ISO 8601 format (e.g. "2026-04-02T12:00:00.000Z").
90
+ TIMESTAMP = "timestamp"
91
+
92
+ # Log severity level (e.g. "info", "warn", "error").
93
+ SEVERITY = "severity"
94
+
95
+ # Human-readable log message describing the event.
96
+ LOG_MESSAGE = "message"
97
+
98
+ # Class name associated with a log event (e.g. exception class or worker
99
+ # class).
100
+ CLASS_NAME = "class_name"
101
+
102
+ # Name of the service or component emitting the log event.
103
+ SERVICE_NAME = "service_name"
104
+
83
105
  # Get the constant name for a field value
84
106
  # @param field_value [String] The field value (e.g., "gl_user_id")
85
107
  # @return [String, nil] The constant name (e.g., "GL_USER_ID") or nil if not found
@@ -97,8 +119,22 @@ module Labkit
97
119
  # to identify and track usage of deprecated fields in the codebase.
98
120
 
99
121
  MAPPINGS = {
100
- Fields::GL_USER_ID => %w[user_id userid],
101
- Fields::HTTP_STATUS_CODE => %w[status_code extra.status status_text],
122
+ Fields::CORRELATION_ID => %w[tags.correlation_id],
123
+ Fields::GL_USER_ID => %w[user_id userid extra.user_id extra.current_user_id meta.user_id],
124
+ Fields::GL_USER_NAME => %w[username extra.user meta.user],
125
+ Fields::ERROR_MESSAGE => %w[error err error.message exception.message graphql_errors],
126
+ Fields::HTTP_STATUS_CODE => %w[status_code extra.status status_text http_status],
127
+ Fields::HTTP_URL => %w[req_url],
128
+ Fields::DURATION_S => %w[duration duration_ms elapsed_time actual_duration time_ms total_time gitaly.duration],
129
+ Fields::REMOTE_IP => %w[ip source_ip ip_address meta.remote_ip],
130
+ Fields::HTTP_HOST => %w[hostname request_host gitlab_host kubernetes.host],
131
+ Fields::GL_PROJECT_ID => %w[extra.project_id meta.project_id meta.search.project_id job_project_id target_project_id],
132
+ Fields::GL_PIPELINE_ID => %w[extra.pipeline_id meta.pipeline_id root_pipeline_id],
133
+ Fields::TIMESTAMP => %w[start_time],
134
+ Fields::SEVERITY => %w[level],
135
+ Fields::LOG_MESSAGE => %w[msg custom_message extra.message fields.message graphql.message reason color_message exception.gitaly],
136
+ Fields::CLASS_NAME => %w[class author_class exception.class extra.class extra.class_name],
137
+ Fields::SERVICE_NAME => %w[service grpc.service_name auth_service type component subcomponent],
102
138
  }.freeze
103
139
 
104
140
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-labkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newdigate