opentelemetry-instrumentation-action_view 0.7.2 → 0.7.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: c28d3572241854eb29990aa3dd9462faf0bf5d736d639399df7d80cc70e6cfdf
4
- data.tar.gz: b6853f4f4dad332b8a1173e82d0e7b3351b9ed4fde3d5f4eda1b1c1644da52bd
3
+ metadata.gz: 18a53eef07bc1740bec65105d872735c1abb73af8fadecb133b913972e345850
4
+ data.tar.gz: 7aa67e21dffcd7316c004c29b2dec55ac690c6ba690d8d73aa66ca036e619997
5
5
  SHA512:
6
- metadata.gz: 47c676cc5239ca45eeafd97d1b063620efb62e4230ed5e556798b53a29245cd567eefb5a730874af8caca5ecc289acb94e7c4e4fa62b4dcbb2621aae0ab56eb0
7
- data.tar.gz: ac9a11a474b52cd84835a3cc921166e2c92428a5b8cce0958362f49f1fb8c4ce16a5ffe02f0b992233b04db04d00e9efa24d2bcf21d71630da2586cdf1a5816d
6
+ metadata.gz: 8a68868ac6e2733f4c6d67aec38addac37c25a1873f0e4b438b60e71cf16401404e1d25f014dfd7720fe023830d075c86c0378375af8c6fd2d3ee21c7dfec1ae
7
+ data.tar.gz: d6d7f805673e416e5eadde80999a8260c26f2154281690859f3e8d6a4e97a5210caf561d0a30a19fd73f764f760438188d708f2dd27a7eb2347063319e9736d1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-action_view
2
2
 
3
+ ### v0.7.3 / 2024-08-23
4
+
5
+ * FIXED: ActionView Support Legacy Formats
6
+
3
7
  ### v0.7.2 / 2024-08-15
4
8
 
5
9
  * (No Significant Changes)
@@ -7,7 +7,42 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module ActionView
10
- # The Instrumentation class contains logic to detect and install the ActionView instrumentation
10
+ # The {OpenTelemetry::Instrumentation::ActionView::Instrumentation} class contains logic to detect and install the ActionView instrumentation
11
+ #
12
+ # Installation and configuration of this instrumentation is done within the
13
+ # {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry/SDK#configure-instance_method OpenTelemetry::SDK#configure}
14
+ # block, calling {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry%2FSDK%2FConfigurator:use use()}
15
+ # or {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry%2FSDK%2FConfigurator:use_all use_all()}.
16
+ #
17
+ # ## Configuration keys and options
18
+ #
19
+ # ### `:disallowed_notification_payload_keys`
20
+ #
21
+ # Specifies an array of keys that should be excluded from the notification payload as span attributes.
22
+ #
23
+ # ### `:notification_payload_transform`
24
+ #
25
+ # - `proc` **default** `nil`
26
+ #
27
+ # Specifies custom proc used to extract span attributes form the notification payload.
28
+ # Use this to rename keys, extract nested values, or perform any other custom logic.
29
+ #
30
+ # ### `:legacy_span_names`
31
+ #
32
+ # - `boolean` **default** `false`
33
+ #
34
+ # Specifies whether spans names should use the legacy format where the subscription was reverse ordered and white space separated. (Ex. `action_view render_template`)
35
+ # If set to `true`, the span name will match the name of the notification itself. (Ex. `render_template.action_view`)
36
+ #
37
+ # @example An explicit default configuration
38
+ # OpenTelemetry::SDK.configure do |c|
39
+ # c.use_all({
40
+ # 'OpenTelemetry::Instrumentation::ActionView' => {
41
+ # disallowed_notification_payload_keys: [],
42
+ # legacy_span_names: true,
43
+ # },
44
+ # })
45
+ # end
11
46
  class Instrumentation < OpenTelemetry::Instrumentation::Base
12
47
  MINIMUM_VERSION = Gem::Version.new('6.1.0')
13
48
  install do |_config|
@@ -24,6 +59,7 @@ module OpenTelemetry
24
59
 
25
60
  option :disallowed_notification_payload_keys, default: [], validate: :array
26
61
  option :notification_payload_transform, default: nil, validate: :callable
62
+ option :legacy_span_names, default: false, validate: :boolean
27
63
 
28
64
  private
29
65
 
@@ -19,13 +19,16 @@ module OpenTelemetry
19
19
  config.after_initialize do
20
20
  ::OpenTelemetry::Instrumentation::ActiveSupport::Instrumentation.instance.install({})
21
21
 
22
+ instance = ::OpenTelemetry::Instrumentation::ActionView::Instrumentation.instance
23
+ span_name_formatter = instance.config[:legacy_span_names] ? ::OpenTelemetry::Instrumentation::ActiveSupport::LEGACY_NAME_FORMATTER : nil
24
+
22
25
  SUBSCRIPTIONS.each do |subscription_name|
23
- config = ActionView::Instrumentation.instance.config
24
26
  ::OpenTelemetry::Instrumentation::ActiveSupport.subscribe(
25
- ActionView::Instrumentation.instance.tracer,
27
+ instance.tracer,
26
28
  subscription_name,
27
- config[:notification_payload_transform],
28
- config[:disallowed_notification_payload_keys]
29
+ instance.config[:notification_payload_transform],
30
+ instance.config[:disallowed_notification_payload_keys],
31
+ span_name_formatter: span_name_formatter
29
32
  )
30
33
  end
31
34
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module ActionView
10
- VERSION = '0.7.2'
10
+ VERSION = '0.7.3'
11
11
  end
12
12
  end
13
13
  end
@@ -9,7 +9,7 @@ require 'opentelemetry-instrumentation-base'
9
9
 
10
10
  module OpenTelemetry
11
11
  module Instrumentation
12
- # Contains the OpenTelemetry instrumentation for the ActionView gem
12
+ # (see OpenTelemetry::Instrumentation::ActionView::Instrumentation)
13
13
  module ActionView
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-action_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-15 00:00:00.000000000 Z
11
+ date: 2024-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.1'
33
+ version: '0.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.1'
40
+ version: '0.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: opentelemetry-instrumentation-base
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -241,10 +241,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
241
241
  licenses:
242
242
  - Apache-2.0
243
243
  metadata:
244
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-action_view/0.7.2/file/CHANGELOG.md
244
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-action_view/0.7.3/file/CHANGELOG.md
245
245
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/action_view
246
246
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
247
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-action_view/0.7.2
247
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-action_view/0.7.3
248
248
  post_install_message:
249
249
  rdoc_options: []
250
250
  require_paths: