gitlab-labkit 1.7.0 → 1.8.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.
- checksums.yaml +4 -4
- data/lib/labkit/fields.rb +56 -65
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83ec781fd3b5955bb25dd8b3beb5719bd39fbb624db27ce3166227c9cc295aa7
|
|
4
|
+
data.tar.gz: 0d710400cece77eb16ab725ee1cb0b3eb0bfc833618a5218681865e72fd07aa6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 576fc58fe5c6319f2a35a3ac3b83ad64f56e187ee0f5844b88e2fa37f8a0f2a7d0d0a1ea0e85640941d50331b187139b99033a4c5a5804b478aa3640108d48d7
|
|
7
|
+
data.tar.gz: b7fe82edce2720772c26f2f2057b139be363dc34adf77d860fdf11614500e45a9abff07319a912accf1f6e38f1833bbaa19d55b4217befe72e960821ea975a35
|
data/lib/labkit/fields.rb
CHANGED
|
@@ -1,93 +1,84 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Code generated by labkit-spec. DO NOT EDIT.
|
|
4
|
+
#
|
|
5
|
+
# Source: schema/fields.yaml (version 1.0)
|
|
6
|
+
|
|
3
7
|
module Labkit
|
|
4
|
-
##
|
|
5
|
-
# Fields is intended to be a SSOT for all of the common field names that
|
|
6
|
-
# we emit via any observability we add to our systems.
|
|
7
|
-
#
|
|
8
|
-
# These fields should span multiple services.
|
|
9
|
-
#
|
|
10
|
-
# The goal of this package is to reduce the likelihood for typos or
|
|
11
|
-
# subtly different naming conventions. This will help to ensure we
|
|
12
|
-
# are able to marry up logs between different systems as a request
|
|
13
|
-
# is being processed.
|
|
14
|
-
#
|
|
15
|
-
# Usage:
|
|
16
|
-
# require 'labkit/fields'
|
|
17
|
-
# ...
|
|
18
|
-
# data[Labkit::Fields::GL_USER_ID] = user.id
|
|
19
|
-
# ...
|
|
20
|
-
#
|
|
21
|
-
# Labkit (Go): https://gitlab.com/gitlab-org/labkit/-/tree/master/fields?ref_type=heads
|
|
22
|
-
#
|
|
23
|
-
# For Engineers Looking to add fields:
|
|
24
|
-
#
|
|
25
|
-
# These fields are derived from the Go Labkit variant. Please ensure that you've made the
|
|
26
|
-
# respective changes in that repository prior to including the fields in this package.
|
|
27
|
-
#
|
|
28
|
-
# Please see the handbook page for more information
|
|
29
|
-
# https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/observability_field_standardisation/
|
|
30
8
|
module Fields
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
# This field is used to correlate
|
|
34
|
-
# the logs emitted by all of our systems.
|
|
35
|
-
# This should be present in all log line
|
|
36
|
-
# emissions.
|
|
9
|
+
# Unique identifier for correlating requests across services. Should be
|
|
10
|
+
# present in all log line emissions.
|
|
37
11
|
CORRELATION_ID = "correlation_id"
|
|
38
12
|
|
|
39
|
-
#
|
|
40
|
-
# captures the user's numeric ID for logging purposes.
|
|
13
|
+
# GitLab user numeric ID.
|
|
41
14
|
GL_USER_ID = "gl_user_id"
|
|
42
15
|
|
|
43
|
-
#
|
|
44
|
-
# captures the user's username for logging purposes.
|
|
16
|
+
# GitLab username.
|
|
45
17
|
GL_USER_NAME = "gl_user_name"
|
|
46
18
|
|
|
47
|
-
#
|
|
48
|
-
#
|
|
19
|
+
# Duo Workflow definition identifier (e.g. "analytics_agent/v1"). Identifies
|
|
20
|
+
# which Duo Workflow agent originated a request, enabling per-agent
|
|
21
|
+
# filtering in Kibana and Grafana.
|
|
22
|
+
DUO_WORKFLOW_DEFINITION = "duo_workflow_definition"
|
|
23
|
+
|
|
24
|
+
# Error type or classification (e.g. "NoMethodError", "ValidationError").
|
|
49
25
|
ERROR_TYPE = "error_type"
|
|
50
26
|
|
|
51
|
-
#
|
|
52
|
-
# (e.g., "undefined method `boom!' for nil").
|
|
27
|
+
# Detailed error message (e.g. "undefined method 'boom!' for nil").
|
|
53
28
|
ERROR_MESSAGE = "error_message"
|
|
54
29
|
|
|
55
|
-
#
|
|
56
|
-
# captures the HTTP status code of requests for logging purposes.
|
|
30
|
+
# HTTP response status code.
|
|
57
31
|
HTTP_STATUS_CODE = "status"
|
|
58
32
|
|
|
59
|
-
#
|
|
60
|
-
# (e.g., "GET", "POST") of a request for logging purposes.
|
|
33
|
+
# HTTP method (e.g. "GET", "POST").
|
|
61
34
|
HTTP_METHOD = "method"
|
|
62
35
|
|
|
63
|
-
#
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
# (e.g. "https://example.com/foo") Query strings and fragments (anchors)
|
|
67
|
-
# must be omitted to avoid logging sensitive information such as tokens
|
|
68
|
-
# or passwords that may appear in query parameters.
|
|
36
|
+
# URL of an HTTP request containing only scheme, host, and path (e.g.
|
|
37
|
+
# "https://example.com/foo"). Query strings and fragments must be omitted to
|
|
38
|
+
# avoid logging sensitive information.
|
|
69
39
|
HTTP_URL = "url"
|
|
70
40
|
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
#
|
|
74
|
-
# jobs, external API calls).
|
|
41
|
+
# Duration of any operation in seconds. Not limited to HTTP requests; can be
|
|
42
|
+
# used for database queries, background jobs, external API calls. Uses
|
|
43
|
+
# float64 for sub-second precision (e.g. 0.032 for 32ms).
|
|
75
44
|
DURATION_S = "duration_s"
|
|
76
45
|
|
|
77
|
-
#
|
|
78
|
-
# address of a request for logging purposes.
|
|
46
|
+
# Remote IP address of a request.
|
|
79
47
|
REMOTE_IP = "remote_ip"
|
|
80
48
|
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
# (e.g. "0.0.0.0:8080" or "127.0.0.1:9090").
|
|
49
|
+
# TCP address a service is listening on, in "host:port" format (e.g.
|
|
50
|
+
# "0.0.0.0:8080").
|
|
84
51
|
TCP_ADDRESS = "tcp_address"
|
|
85
52
|
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
#
|
|
53
|
+
# Request URI including path and query string with sensitive parameters
|
|
54
|
+
# masked (e.g. "?password=[FILTERED]").
|
|
55
|
+
HTTP_URI = "uri"
|
|
56
|
+
|
|
57
|
+
# HTTP Host header of a request (e.g. "api.gitlab.com").
|
|
58
|
+
HTTP_HOST = "host"
|
|
59
|
+
|
|
60
|
+
# HTTP protocol version (e.g. "HTTP/1.1", "HTTP/2.0").
|
|
61
|
+
HTTP_PROTO = "proto"
|
|
62
|
+
|
|
63
|
+
# Raw remote socket address in "host:port" format (e.g. "10.0.0.1:54321").
|
|
64
|
+
# Use remote_ip when only the IP is needed.
|
|
65
|
+
REMOTE_ADDR = "remote_addr"
|
|
66
|
+
|
|
67
|
+
# HTTP Referer header with sensitive query parameters masked.
|
|
68
|
+
HTTP_REFERRER = "referrer"
|
|
69
|
+
|
|
70
|
+
# HTTP User-Agent header.
|
|
71
|
+
HTTP_USER_AGENT = "user_agent"
|
|
72
|
+
|
|
73
|
+
# Number of bytes written to the HTTP response body.
|
|
74
|
+
WRITTEN_BYTES = "written_bytes"
|
|
75
|
+
|
|
76
|
+
# Content-Type of an HTTP response (e.g. "application/json").
|
|
77
|
+
CONTENT_TYPE = "content_type"
|
|
78
|
+
|
|
79
|
+
# Time to first byte of an HTTP response in seconds. Measures duration from
|
|
80
|
+
# request receipt to first response byte written.
|
|
81
|
+
TTFB_S = "ttfb_s"
|
|
91
82
|
|
|
92
83
|
# Get the constant name for a field value
|
|
93
84
|
# @param field_value [String] The field value (e.g., "gl_user_id")
|
|
@@ -107,7 +98,7 @@ module Labkit
|
|
|
107
98
|
|
|
108
99
|
MAPPINGS = {
|
|
109
100
|
Fields::GL_USER_ID => %w[user_id userid],
|
|
110
|
-
Fields::HTTP_STATUS_CODE => %w[status_code extra.status status_text]
|
|
101
|
+
Fields::HTTP_STATUS_CODE => %w[status_code extra.status status_text],
|
|
111
102
|
}.freeze
|
|
112
103
|
|
|
113
104
|
class << self
|