scout_apm_logging 1.0.1 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ae2b293e0878164b8284f41eccec9b5b803fd5af2f2a8097730b82ef96233f1
4
- data.tar.gz: aefbee4c67841da49a9feed784e285225d35c2af4d03bc8390e26699b337b2a8
3
+ metadata.gz: b0d9d5323e07f8b2fe838a030d93123d00a5fb6e289fe7bc78d7ac0bcc2ebc79
4
+ data.tar.gz: e00d25c837617410f02ec4d6523fd5afdbb37efa633b3ecaf625f5929a1b960f
5
5
  SHA512:
6
- metadata.gz: 7f956d681958cedf5ca9ed0fe4b943682b3146161ed1182342c3b3e4638d93f2c9fc25d748874965acaa662e53326901db84c4bdf4256e952cc7f02e2a8ed1c7
7
- data.tar.gz: 226a90d6cf105b4848e446bc14d6d1da1335cbb734ec360f8d5414c4768f12e02b3e9db7ace44a18fa726623bdf04a212f032dd93c1649c3b12f0db2d005d283
6
+ metadata.gz: 0d126cf0149770bb461251442e7cf2fdb40c536076d3d09131ad3d0df3763e10fb5ec4bb44ceb780b11851ab4c2276934b476033d77bcbb7fa8db7e89eed0339
7
+ data.tar.gz: 2c441b2bf745ca77aa154d44a536509de405051b8c363d9d8ccb95a6828fa77110b0bc3e196cf3044e7d0e1b837b295de855b428c64e8e6c7fa39d910fcb3d15
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.0.3
2
+ * Add capturing of queue for background jobs.
3
+ * Fix entrypoint name capturing for namespaced controllers.
4
+
5
+ ## 1.0.2
6
+ * Fix / Re-add logging of configuration values on startup.
7
+ * Remove raw_bytes from payload.
8
+
1
9
  ## 1.0.1
2
10
  * Update google-protobuf dependency to resolve to any version less than 4.x.x.
3
11
 
data/gems/rails.gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  eval_gemfile("../Gemfile")
2
2
 
3
3
  gem "rails"
4
+ gem "puma"
@@ -29,7 +29,6 @@ module ScoutApm
29
29
  attributes_to_log.merge!(local_log_location) if ::Logger::Severity.const_get(severity) >= ::Logger::Severity::WARN
30
30
 
31
31
  message = "#{attributes_to_log.to_json}\n"
32
- attributes_to_log['raw_bytes'] = message
33
32
 
34
33
  ScoutApm::Logging::Loggers::OpenTelemetry.logger_provider.logger(
35
34
  name: 'scout_apm',
@@ -57,11 +56,18 @@ module ScoutApm
57
56
 
58
57
  return {} unless layer
59
58
 
60
- name, action = layer.name.split('/')
59
+ layer_type = layer.type.downcase
61
60
 
62
- return {} unless name
61
+ layer_parts = layer.name.split('/')
62
+ name_parts, action = if layer_type == 'controller'
63
+ [layer_parts[0..-2], layer_parts[-1]]
64
+ else
65
+ [layer_parts, nil]
66
+ end
63
67
 
64
- updated_name = name.split('_').map(&:capitalize).join
68
+ return {} unless name_parts.any?
69
+
70
+ updated_name = name_parts.map(&:capitalize).map { |item| item.split('_').map(&:capitalize).join }.join('::')
65
71
 
66
72
  derived_key = "#{layer.type.downcase}_entrypoint".to_sym
67
73
 
@@ -69,10 +75,17 @@ module ScoutApm
69
75
  derived_value_of_scout_name = if action
70
76
  "#{updated_name}#{layer.type.capitalize}##{action}"
71
77
  else
72
- name
78
+ name_parts[0]
73
79
  end
74
80
 
75
- { derived_key => derived_value_of_scout_name }
81
+ {}.tap do |layer_attributes|
82
+ if layer_type == 'job'
83
+ queue = req.instance_variable_get('@layers').find { |lay| lay.type == 'Queue' }
84
+ layer_attributes[:job_queue] = queue.name if queue
85
+ end
86
+
87
+ layer_attributes[derived_key] = derived_value_of_scout_name
88
+ end
76
89
  end
77
90
 
78
91
  def scout_context
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ScoutApm
4
4
  module Logging
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.3'
6
6
  end
7
7
  end
@@ -17,6 +17,7 @@ module ScoutApm
17
17
  initializer 'scout_apm_logging.monitor', after: :initialize_logger, before: :initialize_cache do
18
18
  context = Context.new
19
19
  context.config = Config.with_file(context, context.config.value('config_file'))
20
+ context.config.log_settings(context.logger)
20
21
 
21
22
  Loggers::Capture.new(context).setup!
22
23
  end
@@ -36,7 +36,7 @@ describe ScoutApm::Logging do
36
36
  sleep 5
37
37
 
38
38
  # Call the app to generate the logs
39
- `curl localhost:8080`
39
+ `curl localhost:9292`
40
40
 
41
41
  sleep 5
42
42
 
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: 1.0.1
4
+ version: 1.0.3
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-10-09 00:00:00.000000000 Z
11
+ date: 2025-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: googleapis-common-protos-types
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  - !ruby/object:Gem::Version
249
249
  version: '0'
250
250
  requirements: []
251
- rubygems_version: 3.0.8
251
+ rubygems_version: 3.3.26
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: Ruby Logging Support