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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/instrumentation/action_view/instrumentation.rb +37 -1
- data/lib/opentelemetry/instrumentation/action_view/railtie.rb +7 -4
- data/lib/opentelemetry/instrumentation/action_view/version.rb +1 -1
- data/lib/opentelemetry/instrumentation/action_view.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18a53eef07bc1740bec65105d872735c1abb73af8fadecb133b913972e345850
|
4
|
+
data.tar.gz: 7aa67e21dffcd7316c004c29b2dec55ac690c6ba690d8d73aa66ca036e619997
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a68868ac6e2733f4c6d67aec38addac37c25a1873f0e4b438b60e71cf16401404e1d25f014dfd7720fe023830d075c86c0378375af8c6fd2d3ee21c7dfec1ae
|
7
|
+
data.tar.gz: d6d7f805673e416e5eadde80999a8260c26f2154281690859f3e8d6a4e97a5210caf561d0a30a19fd73f764f760438188d708f2dd27a7eb2347063319e9736d1
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
@@ -9,7 +9,7 @@ require 'opentelemetry-instrumentation-base'
|
|
9
9
|
|
10
10
|
module OpenTelemetry
|
11
11
|
module Instrumentation
|
12
|
-
#
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
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:
|