railswatch_gem 0.4.3 → 0.4.4
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/railswatch_gem/helpers.rb +14 -8
- data/lib/railswatch_gem/version.rb +1 -1
- 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: 9b3439fd5d48760c3599766306225ebbdd327aa788188610d0136ab1ab8ef77d
|
|
4
|
+
data.tar.gz: 7327398ee3169bf5977116e61105f0b670f3372283fe52bbf9485eaf0353c372
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f47c4d3e23c9a932c4d6d5ad9cda255cc3de07c9f4b5efb0c6948cc5b968311df35b25543b82f2c665f80121b12a1be49cd3d4eb4c7ef9c3bc29ab9d1b23ec6
|
|
7
|
+
data.tar.gz: 41a360ebcc864aee64941cee57d2bbc565931ebf6a158b82076a07ce438c92c443817a9da8ea074d85df05ffe441ade6120c8ec67950eb1479cb7a8cd7bd72e7
|
|
@@ -9,18 +9,24 @@ module RailswatchGem
|
|
|
9
9
|
MAX_PAYLOAD_SIZE = 4096
|
|
10
10
|
|
|
11
11
|
def railswatch_dump(*args)
|
|
12
|
-
|
|
13
|
-
return return_value(args) unless
|
|
12
|
+
tracer = OpenTelemetry.tracer_provider.tracer('railswatch')
|
|
13
|
+
return return_value(args) unless tracer
|
|
14
14
|
|
|
15
15
|
file, line = parse_caller_location
|
|
16
|
+
location = "#{file}:#{line}"
|
|
16
17
|
|
|
17
18
|
json_content = serialize_args(args)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
19
|
+
values = args.map { |arg| sanitize_arg(arg) }
|
|
20
|
+
|
|
21
|
+
# Create a new span for the dump (not just an event on the current span)
|
|
22
|
+
tracer.in_span("railswatch.dump") do |span|
|
|
23
|
+
span.set_attribute("code.filepath", file)
|
|
24
|
+
span.set_attribute("code.lineno", line.to_i)
|
|
25
|
+
span.set_attribute("location", location)
|
|
26
|
+
span.set_attribute("railswatch.dump.content", truncate_payload(json_content))
|
|
27
|
+
# Also set values as an attribute for easier extraction
|
|
28
|
+
span.set_attribute("dump.values", truncate_payload(values.to_json))
|
|
29
|
+
end
|
|
24
30
|
|
|
25
31
|
return_value(args)
|
|
26
32
|
rescue => e
|