opentelemetry-instrumentation-active_support 0.12.0 → 0.12.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21b7f28f097eb1e09ec11100267b5c37ea8b76d8cd059e25848ebb934280d464
|
|
4
|
+
data.tar.gz: 31c3e8851e7094bd5ffaecb9d21abfb82baa01b224d9ef46c410072b3dad3ca1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 715e78cd7b732276f4ca04f19d1b772f65f1006dd73e98c2419ba29b7542fae794b1bf488130a1dd49b2b18f5edf3b187ad41cf4a500b50f6ade84281130db37
|
|
7
|
+
data.tar.gz: 49558e4d3ffd8f32b39896c8c3db45591cef670a4c5ab6f3dcdf300294a44194fa184472f3f556a9f70a3ae493c5ba839bd9ac1df552e11828f30e2f7ceef1c9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -40,6 +40,29 @@ end
|
|
|
40
40
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
### Subscribe options
|
|
44
|
+
|
|
45
|
+
The `subscribe` method accepts optional payload-related arguments:
|
|
46
|
+
|
|
47
|
+
- **`notification_payload_transform`:** Custom `proc` used to extract span
|
|
48
|
+
attributes from the notification payload. The proc receives the notification
|
|
49
|
+
payload and must return a `Hash`. Use this to rename keys, extract nested
|
|
50
|
+
values, or perform any other custom logic.
|
|
51
|
+
- **`disallowed_notification_payload_keys`:** Array of string notification
|
|
52
|
+
payload keys that should not be recorded as span attributes. Keys are matched
|
|
53
|
+
before the remaining payload keys are converted to strings.
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
|
|
57
|
+
::OpenTelemetry::Instrumentation::ActiveSupport.subscribe(
|
|
58
|
+
tracer, # tracer
|
|
59
|
+
'bar.foo', # pattern
|
|
60
|
+
->(payload) { payload.merge('tenant' => payload['account_id']) }, # notification_payload_transform
|
|
61
|
+
['account_id'] # disallowed_notification_payload_keys
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
43
66
|
## Examples
|
|
44
67
|
|
|
45
68
|
Example usage can be seen in the [`./example/trace_demonstration.rb` file](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/active_support/example/trace_demonstration.rb)
|
|
@@ -14,6 +14,17 @@ module OpenTelemetry
|
|
|
14
14
|
# The SpanSubscriber is a special ActiveSupport::Notification subscription
|
|
15
15
|
# handler which turns notifications into generic spans, taking care to handle
|
|
16
16
|
# context appropriately.
|
|
17
|
+
#
|
|
18
|
+
# @param tracer [OpenTelemetry::Trace::Tracer] tracer used to create spans
|
|
19
|
+
# @param pattern [String, Regexp] ActiveSupport notification pattern
|
|
20
|
+
# @param notification_payload_transform [Callable, nil] optional callable
|
|
21
|
+
# that receives the notification payload and returns a Hash of span
|
|
22
|
+
# attributes
|
|
23
|
+
# @param disallowed_notification_payload_keys [Array<String>, nil] notification
|
|
24
|
+
# payload keys that should not be recorded as span attributes
|
|
25
|
+
# @param kind [Symbol, nil] span kind to use for generated spans
|
|
26
|
+
# @param span_name_formatter [Callable, nil] optional callable that receives
|
|
27
|
+
# the notification name and returns the span name
|
|
17
28
|
|
|
18
29
|
# A very hacky way to make sure that OpenTelemetry::Instrumentation::ActiveSupport::SpanSubscriber
|
|
19
30
|
# gets invoked first
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opentelemetry-instrumentation-active_support
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.12.
|
|
4
|
+
version: 0.12.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenTelemetry Authors
|
|
@@ -44,10 +44,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
|
44
44
|
licenses:
|
|
45
45
|
- Apache-2.0
|
|
46
46
|
metadata:
|
|
47
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_support/0.12.
|
|
48
|
-
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-active_support/v0.12.
|
|
47
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_support/0.12.1/file/CHANGELOG.md
|
|
48
|
+
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-active_support/v0.12.1/instrumentation/active_support
|
|
49
49
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
|
50
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_support/0.12.
|
|
50
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_support/0.12.1
|
|
51
51
|
rdoc_options: []
|
|
52
52
|
require_paths:
|
|
53
53
|
- lib
|
|
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
62
62
|
- !ruby/object:Gem::Version
|
|
63
63
|
version: '0'
|
|
64
64
|
requirements: []
|
|
65
|
-
rubygems_version: 4.0.
|
|
65
|
+
rubygems_version: 4.0.10
|
|
66
66
|
specification_version: 4
|
|
67
67
|
summary: ActiveSupport instrumentation for the OpenTelemetry framework
|
|
68
68
|
test_files: []
|