opentelemetry-instrumentation-action_pack 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +9 -2
- data/lib/opentelemetry/instrumentation/action_pack/instrumentation.rb +2 -1
- data/lib/opentelemetry/instrumentation/action_pack/patches/action_controller/metal.rb +7 -4
- data/lib/opentelemetry/instrumentation/action_pack/version.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: 99be35d64f5fd7d823eb70e181f5632085271225dfa5bbc10adb997f287581a8
|
4
|
+
data.tar.gz: b4df430eb2003fa5e5863ae9203bf77d4c8f34234579c7fbd11267d51f4e8b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d13b693131f8b6e64fead4308d30c67ad5b2a13320083a68abfba66c2d9cb235ac9e411eb9678df14616e4706e6920b6c55fcb706c7aae6487da66a55ab509a8
|
7
|
+
data.tar.gz: 8f6f5faf8b5466e2e745461636bdfb800f1adb134d9174790d94e2ef1ec8d832bf500c4699782de0e869de3be98d50b5f4fd0a1af485e128ae04d0b645b52ce5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-action_pack
|
2
2
|
|
3
|
+
### v0.3.2 / 2022-11-16
|
4
|
+
|
5
|
+
* * FIXED: Loosen dependency on Rack
|
6
|
+
|
7
|
+
### v0.3.1 / 2022-10-27
|
8
|
+
|
9
|
+
* FIXED: Declare span_naming option in action_pack instrumentation
|
10
|
+
|
3
11
|
### v0.3.0 / 2022-10-14
|
4
12
|
|
5
13
|
* ADDED: Name ActionPack spans with the HTTP method and route
|
data/README.md
CHANGED
@@ -32,11 +32,18 @@ end
|
|
32
32
|
|
33
33
|
### Configuration options
|
34
34
|
|
35
|
-
|
35
|
+
| Name | Default | Description |
|
36
|
+
| ----- | ------- | ----------- |
|
37
|
+
| `span_naming` | `:rails_route` | Configures the name for the Rack span. `:rails_route` is in the format of `HTTP_METHOD /rails/route(.:format)`, for example `GET /users/:id(.:format)`. `:controller_action` is in the format of `Controller#action`, for example `UsersController#show` |
|
38
|
+
| `enable_recognize_route` | `true` | Enables or disables adding the `http.route` attribute. |
|
39
|
+
|
40
|
+
The default configuration uses a [method from Rails to obtain the route for the request](https://github.com/rails/rails/blob/v6.1.3/actionpack/lib/action_dispatch/journey/router.rb#L65). The options above allow this behaviour to be opted out of if you have performance issues. If you wish to avoid using this method then set `span_naming: :controller_action, enable_recognize_route: false`.
|
41
|
+
|
36
42
|
```ruby
|
37
43
|
OpenTelemetry::SDK.configure do |c|
|
38
44
|
c.use 'OpenTelemetry::Instrumentation::ActionPack', {
|
39
|
-
|
45
|
+
span_naming: :controller_action,
|
46
|
+
enable_recognize_route: false
|
40
47
|
}
|
41
48
|
end
|
42
49
|
```
|
@@ -25,7 +25,8 @@ module OpenTelemetry
|
|
25
25
|
gem_version >= MINIMUM_VERSION
|
26
26
|
end
|
27
27
|
|
28
|
-
option :enable_recognize_route, default:
|
28
|
+
option :enable_recognize_route, default: true, validate: :boolean
|
29
|
+
option :span_naming, default: :rails_route, validate: %i[controller_action rails_route]
|
29
30
|
|
30
31
|
private
|
31
32
|
|
@@ -21,10 +21,13 @@ module OpenTelemetry
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
attributes_to_append = {
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
attributes_to_append = {
|
25
|
+
OpenTelemetry::SemanticConventions::Trace::CODE_NAMESPACE => self.class.name,
|
26
|
+
OpenTelemetry::SemanticConventions::Trace::CODE_FUNCTION => name
|
27
|
+
}
|
28
|
+
attributes_to_append[OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE] = rails_route(request) if instrumentation_config[:enable_recognize_route]
|
29
|
+
attributes_to_append[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] = request.filtered_path if request.filtered_path != request.fullpath
|
30
|
+
rack_span.add_attributes(attributes_to_append)
|
28
31
|
end
|
29
32
|
|
30
33
|
super(name, request, response)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-action_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.21
|
47
|
+
version: '0.21'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.21
|
54
|
+
version: '0.21'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: appraisal
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,10 +242,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-contrib
|
|
242
242
|
licenses:
|
243
243
|
- Apache-2.0
|
244
244
|
metadata:
|
245
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-action_pack/v0.3.
|
245
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-action_pack/v0.3.2/file.CHANGELOG.html
|
246
246
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/action_pack
|
247
247
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
248
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-action_pack/v0.3.
|
248
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-action_pack/v0.3.2
|
249
249
|
post_install_message:
|
250
250
|
rdoc_options: []
|
251
251
|
require_paths:
|