scout_apm_logging 0.0.8 → 0.0.9

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: b613ee5835fad514e57720ba9349bb90bc2eea19821891998655353d50447f3c
4
- data.tar.gz: 29a0dda4469c4a4a2465816cc3cacfd332ae545af37f0b694c7aa3b6afb83ca6
3
+ metadata.gz: 55f7d2c11024d2dba505a31f9a95face612da9befd41e70cce442655e5647711
4
+ data.tar.gz: 0d4b6f542d73fd0b435296e465f814b1593d7d52ae5dd31d7b07965c3e52e2a6
5
5
  SHA512:
6
- metadata.gz: 991c4af38d8027255b65a0e1225f0b3f295a3f6e76f2dbcb46a13b91644420b684f8c9ab343eb04708ed3dc499a46e38ea1ee8b2924e78361ea469a033d63d22
7
- data.tar.gz: 667b91726ad60e9415d90db45fcef50f73f317308d42d1b17686bb1ae2de791ba75903e4bd5d9fbbcbe7009809b187fc468d6ebf18945edc5c6fa2f6e637b674
6
+ metadata.gz: 35c113e4c84c336657d4a312385f7b23328518112be3f7a0a234eca56fd66422d264121dd0dbd19bf206ef309904ab9b3a4d40a4b50741185966979a8cb4c1a3
7
+ data.tar.gz: 6e196f2c3625af8ecc6d898a653be40f1e61511e9e20a4b7a30f5a9efa93c3eba6fda5f6bbcb3d43546800ae64b5b1fdd879d697a57f9e4e740e82b4ee350a3e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.9
2
+ * Add Scout Transaction ID to log attributes.
3
+
1
4
  ## 0.0.8
2
5
  * Fix internal method names for proxy logger to prevent accidental overriding.
3
6
  * Re-broadcast to console in development for the proxy logger.
@@ -12,7 +12,7 @@ module ScoutApm
12
12
  class Formatter < ::Logger::Formatter
13
13
  DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%LZ'
14
14
 
15
- def call(severity, time, progname, msg)
15
+ def call(severity, time, progname, msg) # rubocop:disable Metrics/AbcSize
16
16
  attributes_to_log = {
17
17
  severity: severity,
18
18
  time: format_datetime(time),
@@ -23,6 +23,7 @@ module ScoutApm
23
23
  attributes_to_log[:progname] = progname if progname
24
24
  attributes_to_log['service.name'] = service_name
25
25
 
26
+ attributes_to_log.merge!(scout_transaction_id)
26
27
  attributes_to_log.merge!(scout_layer)
27
28
  attributes_to_log.merge!(scout_context)
28
29
  # Naive local benchmarks show this takes around 200 microseconds. As such, we only apply it to WARN and above.
@@ -66,6 +67,10 @@ module ScoutApm
66
67
  user_context.transform_keys { |key| "user.#{key}" }.merge(extra_context)
67
68
  end
68
69
 
70
+ def scout_transaction_id
71
+ { "scout_transaction_id": ScoutApm::RequestManager.lookup.transaction_id }
72
+ end
73
+
69
74
  def local_log_location
70
75
  # Should give us the last local stack which called the log within just the last couple frames.
71
76
  last_local_location = caller[0..15].find { |path| path.include?(Rails.root.to_s) }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ScoutApm
4
4
  module Logging
5
- VERSION = '0.0.8'
5
+ VERSION = '0.0.9'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scout APM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-22 00:00:00.000000000 Z
11
+ date: 2024-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scout_apm