gitlab-labkit 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eed1c5eae7363851222a82aaeae8088a5227912d0d01d1f1b30e3e0514a25e2
|
4
|
+
data.tar.gz: 44167dc3c31083dcb58028c7851106ba47dcd8ac590a02e3306d3f8ef741fd41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44f99cd2425d95c738d522c496d37319f318360d5c79be3ab3822f38bd95c7aec7f40fb307c2435c28bb43642539d7c84f5501d1f83c4f1905f5cc6fd645f0f9
|
7
|
+
data.tar.gz: 5603763f8cee8f7fff87d963ef87e66989a5860d4d6dc58d35c5530383bfd7c99f88a62e768982e87e1b7a9fc56f20f0101db9a140a2765818d39807c9f2e14a
|
@@ -28,6 +28,12 @@ module Labkit
|
|
28
28
|
""
|
29
29
|
end
|
30
30
|
|
31
|
+
def self.sql_fingerprint(normalized_sql)
|
32
|
+
PgQuery.parse(normalized_sql)&.fingerprint
|
33
|
+
rescue PgQuery::ParseError
|
34
|
+
""
|
35
|
+
end
|
36
|
+
|
31
37
|
# Ensures that URLS are sanitized to hide credentials
|
32
38
|
def self.mask_url(url)
|
33
39
|
url = url.to_s.strip
|
@@ -14,7 +14,11 @@ module Labkit
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def tags(payload)
|
17
|
-
|
17
|
+
if Labkit::Tracing.sampled? && payload[:sql]
|
18
|
+
sql = Labkit::Logging::Sanitizer.sanitize_sql(payload[:sql])
|
19
|
+
fingerprint = Labkit::Logging::Sanitizer.sql_fingerprint(sql)
|
20
|
+
end
|
21
|
+
|
18
22
|
{
|
19
23
|
"component" => COMPONENT_TAG,
|
20
24
|
"span.kind" => "client",
|
@@ -22,6 +26,7 @@ module Labkit
|
|
22
26
|
"db.connection_id" => payload[:connection_id],
|
23
27
|
"db.cached" => payload[:cached] || false,
|
24
28
|
"db.statement" => sql,
|
29
|
+
"db.statement_fingerprint" => fingerprint,
|
25
30
|
}
|
26
31
|
end
|
27
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-labkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Newdigate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|