opentelemetry-instrumentation-grape 0.6.0 → 0.7.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: 4b521e56d7e7aeb77eda0d3c450fba0d1d6c2d269589b3c0943d4b5f1f3bdc03
4
- data.tar.gz: 5dae78834628135998a5951be2905c88247fad4b7c9c0879b5f58e3bff28d6dd
3
+ metadata.gz: 76f844ae214dda861b260b1645b7287b2883b7546458ef98c9aa7efcf9635a3e
4
+ data.tar.gz: 9bc20831e6454efcf520bdba125426345ade8fa740e95961e6a6aee9cca0ee78
5
5
  SHA512:
6
- metadata.gz: e536c3765a6ac4264a969f81824a1c2d22ffed185bbe735f3ecd242696daa190d731c46d6a9a7095e632e43f9b39e669b89564efc0212515c473a6daad32ff85
7
- data.tar.gz: ee417a713c22335b2c9d8957ec2315b7cd0003ef7aca90e4f2ff84a221e259658beb20abc9b13766f742c2d0978d4d3ea1223c387f989df521a20f70f5671a23
6
+ metadata.gz: 00bfa821e44d620ffb90ea81fcf1d7a64ea20084e979c8c1fca03eb548c3814c9e10b0161f3d59da8da5df4c249e42314eec2be5c35e386bd6de33b5f234af22
7
+ data.tar.gz: 02ef55b514b1e61f8659cc76824e72b85f0ea5f7e04933733386c8eed315287fd2e64db4b2d989c17d066c46597c9c7052892a2863c4b2a66c8dcac8d83f7236
data/CHANGELOG.md CHANGED
@@ -1,64 +1,74 @@
1
1
  # Release History: opentelemetry-instrumentation-grape
2
2
 
3
- ### v0.6.0 / 2026-03-17
3
+ ## v0.7.1 / 2026-07-14
4
4
 
5
- * BREAKING CHANGE: Default to stable HTTP semantic conventions (#2051)
6
- * ADDED: Default to stable HTTP semantic conventions (#2051)
5
+ - FIXED: Detect code namespace for API instance endpoints (#2407)
7
6
 
8
- ### v0.5.1 / 2026-02-11
7
+ ## v0.7.0 / 2026-04-14
9
8
 
10
- * FIXED: Support Grape 3.1.0 (#1969)
9
+ - BREAKING CHANGE: Min Ruby Version 3.3 (#2125)
10
+ - ADDED: Min Ruby Version 3.3 (#2125)
11
+ - ADDED: Add release tag into source code url of gem metadata (#1984)
11
12
 
12
- ### v0.5.0 / 2025-10-22
13
+ ## v0.6.0 / 2026-03-17
13
14
 
14
- * BREAKING CHANGE: Min Ruby Version 3.2
15
- * ADDED: Min Ruby Version 3.2
15
+ - BREAKING CHANGE: Default to stable HTTP semantic conventions (#2051)
16
+ - ADDED: Default to stable HTTP semantic conventions (#2051)
16
17
 
17
- ### v0.4.0 / 2025-09-30
18
+ ## v0.5.1 / 2026-02-11
18
19
 
19
- * ADDED: Bump minimum API Version to 1.7
20
+ - FIXED: Support Grape 3.1.0 (#1969)
20
21
 
21
- ### v0.3.0 / 2025-01-16
22
+ ## v0.5.0 / 2025-10-22
22
23
 
23
- * BREAKING CHANGE: Set minimum supported version to Ruby 3.1
24
- * ADDED: Set minimum supported version to Ruby 3.1
24
+ - BREAKING CHANGE: Min Ruby Version 3.2
25
+ - ADDED: Min Ruby Version 3.2
25
26
 
26
- ### v0.2.0 / 2024-07-02
27
+ ## v0.4.0 / 2025-09-30
27
28
 
28
- * ADDED: Make the install of rack instrumentation by grape instrumentation optional
29
+ - ADDED: Bump minimum API Version to 1.7
29
30
 
30
- ### v0.1.8 / 2024-05-14
31
+ ## v0.3.0 / 2025-01-16
31
32
 
32
- * DOCS: Instrumentation Authors Guide
33
+ - BREAKING CHANGE: Set minimum supported version to Ruby 3.1
34
+ - ADDED: Set minimum supported version to Ruby 3.1
33
35
 
34
- ### v0.1.7 / 2024-04-30
36
+ ## v0.2.0 / 2024-07-02
35
37
 
36
- * FIXED: Bundler conflict warnings
38
+ - ADDED: Make the install of rack instrumentation by grape instrumentation optional
37
39
 
38
- ### v0.1.6 / 2023-11-23
40
+ ## v0.1.8 / 2024-05-14
39
41
 
40
- * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
42
+ - DOCS: Instrumentation Authors Guide
41
43
 
42
- ### v0.1.5 / 2023-10-31
44
+ ## v0.1.7 / 2024-04-30
43
45
 
44
- * FIXED: Remove dependency on ActiveSupport core extensions from Grape instrumentation
46
+ - FIXED: Bundler conflict warnings
45
47
 
46
- ### v0.1.4 / 2023-08-02
48
+ ## v0.1.6 / 2023-11-23
47
49
 
48
- * FIXED: Fix opentelemetry-api version constraint in grape gemspec
50
+ - CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
49
51
 
50
- ### v0.1.3 / 2023-06-05
52
+ ## v0.1.5 / 2023-10-31
51
53
 
52
- * FIXED: Base config options
54
+ - FIXED: Remove dependency on ActiveSupport core extensions from Grape instrumentation
53
55
 
54
- ### v0.1.2 / 2023-05-02
56
+ ## v0.1.4 / 2023-08-02
55
57
 
56
- * FIXED: Grape Instrumentation handle status code symbol
58
+ - FIXED: Fix opentelemetry-api version constraint in grape gemspec
57
59
 
58
- ### v0.1.1 / 2023-04-26
60
+ ## v0.1.3 / 2023-06-05
59
61
 
60
- * FIXED: Set grape.formatter.type to 'custom' for non-Grape formatters
62
+ - FIXED: Base config options
61
63
 
62
- ### v0.1.0 / 2023-04-17
64
+ ## v0.1.2 / 2023-05-02
63
65
 
64
- * Initial release.
66
+ - FIXED: Grape Instrumentation handle status code symbol
67
+
68
+ ## v0.1.1 / 2023-04-26
69
+
70
+ - FIXED: Set grape.formatter.type to 'custom' for non-Grape formatters
71
+
72
+ ## v0.1.0 / 2023-04-17
73
+
74
+ - Initial release.
@@ -67,10 +67,12 @@ module OpenTelemetry
67
67
  end
68
68
 
69
69
  def attributes_from_grape_endpoint(endpoint)
70
- {
71
- OpenTelemetry::SemanticConventions::Trace::CODE_NAMESPACE => endpoint.options[:for]&.instance_variable_get(:@base)&.to_s,
70
+ attributes = {
72
71
  OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => path(endpoint)
73
72
  }
73
+ code_namespace = code_namespace(endpoint)
74
+ attributes[OpenTelemetry::SemanticConventions::Trace::CODE_NAMESPACE] = code_namespace if code_namespace
75
+ attributes
74
76
  end
75
77
 
76
78
  # ActiveSupport::Notifications will attach a `:exception_object` to the payload if there was
@@ -89,6 +91,14 @@ module OpenTelemetry
89
91
  endpoint.options[:method]&.first
90
92
  end
91
93
 
94
+ def code_namespace(endpoint)
95
+ owner = endpoint.options[:for]
96
+ return unless owner
97
+
98
+ base = owner.instance_variable_get(:@base)
99
+ [owner.name, base&.to_s, owner.to_s].find { |value| value && !value.empty? }
100
+ end
101
+
92
102
  def path(endpoint)
93
103
  return '' unless endpoint.routes
94
104
 
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Grape
10
10
  # Current gem version
11
- VERSION = '0.6.0'
11
+ VERSION = '0.7.1'
12
12
  end
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-grape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
@@ -45,10 +45,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
45
45
  licenses:
46
46
  - Apache-2.0
47
47
  metadata:
48
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-grape/0.6.0/file/CHANGELOG.md
49
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/grape
48
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-grape/0.7.1/file/CHANGELOG.md
49
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-grape/v0.7.1/instrumentation/grape
50
50
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
51
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-grape/0.6.0
51
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-grape/0.7.1
52
52
  rdoc_options: []
53
53
  require_paths:
54
54
  - lib
@@ -56,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: '3.2'
59
+ version: '3.3'
60
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 4.0.3
66
+ rubygems_version: 4.0.10
67
67
  specification_version: 4
68
68
  summary: Grape instrumentation for the OpenTelemetry framework
69
69
  test_files: []