aspecto-opentelemetry-instrumentation-aws_sdk 0.1.8 → 0.4.2
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 +17 -1
- data/README.md +1 -1
- data/lib/opentelemetry/instrumentation/aws_sdk/handler.rb +14 -3
- data/lib/opentelemetry/instrumentation/aws_sdk/instrumentation.rb +4 -2
- data/lib/opentelemetry/instrumentation/aws_sdk/messaging_helper.rb +5 -9
- data/lib/opentelemetry/instrumentation/aws_sdk/version.rb +1 -1
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e06be223969bfa905a6ea8b8f8dad2c8efd7532df475e35f862c25dd103dd30
|
4
|
+
data.tar.gz: 6e21b2bb8abd75b523f5a3ca56f53b01fdd065bf187a4fc8a9b23a35db9f2e69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf2d059c6f60d808c248b211560012f3633c34ce7dd925d786e60f6b1aa2f8e7514042ad966933f5d70615758dc3dcead7bfda9ea935f3f228f01cb577da4f86
|
7
|
+
data.tar.gz: c8649583f19d785df378fa1b661ee9092436e54c08067c2e14c4974f922c82f2169f044d72ee40db1fb5d594545da93082adc763eb286d2118ee3fba17e52b1b
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,20 @@
|
|
1
|
-
# Release History: opentelemetry-instrumentation-aws_sdk
|
1
|
+
# Release History: opentelemetry-instrumentation-aws_sdk
|
2
|
+
|
3
|
+
### v0.2.3 / 2022-05-02
|
4
|
+
|
5
|
+
* FIXED: RubyGems Fallback
|
6
|
+
|
7
|
+
### v0.2.2 / 2022-01-26
|
8
|
+
|
9
|
+
* (No significant changes)
|
10
|
+
|
11
|
+
### v0.2.1 / 2022-01-21
|
12
|
+
|
13
|
+
* ADDED: attach HTTP status code to AWS spans
|
14
|
+
|
15
|
+
### v0.2.0 / 2022-01-20
|
16
|
+
|
17
|
+
* ADDED: SQS / SNS messaging attributes and context propagation
|
2
18
|
|
3
19
|
### v0.1.0 / 2021-12-01
|
4
20
|
|
data/README.md
CHANGED
@@ -19,8 +19,8 @@ To install the instrumentation, call `use` with the name of the instrumentation.
|
|
19
19
|
```ruby
|
20
20
|
OpenTelemetry::SDK.configure do |c|
|
21
21
|
c.use 'OpenTelemetry::Instrumentation::AwsSdk', {
|
22
|
-
extract_messaging_context: true,
|
23
22
|
inject_messaging_context: true,
|
23
|
+
extract_messaging_context: true,
|
24
24
|
suppress_internal_instrumentation: true
|
25
25
|
}
|
26
26
|
end
|
@@ -17,7 +17,7 @@ module OpenTelemetry
|
|
17
17
|
def call(context) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
18
18
|
return super unless context
|
19
19
|
|
20
|
-
service_name =
|
20
|
+
service_name = service_name(context)
|
21
21
|
operation = context.operation&.name
|
22
22
|
client_method = "#{service_name}.#{operation}"
|
23
23
|
attributes = {
|
@@ -39,12 +39,15 @@ module OpenTelemetry
|
|
39
39
|
else
|
40
40
|
super
|
41
41
|
end.tap do |response|
|
42
|
+
span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE,
|
43
|
+
context.http_response.status_code)
|
44
|
+
|
42
45
|
if (err = response.error)
|
43
46
|
span.record_exception(err)
|
44
47
|
span.status = Trace::Status.error(err.to_s)
|
45
48
|
end
|
46
49
|
|
47
|
-
MessagingHelper.create_sqs_processing_spans(context, tracer, response.messages) if client_method == SQS_RECEIVE_MESSAGE && response.respond_to?(:messages)
|
50
|
+
MessagingHelper.create_sqs_processing_spans(context, tracer, response.messages) if instrumentation_config[:extract_messaging_context] && client_method == SQS_RECEIVE_MESSAGE && response.respond_to?(:messages)
|
48
51
|
end
|
49
52
|
end
|
50
53
|
end
|
@@ -59,8 +62,16 @@ module OpenTelemetry
|
|
59
62
|
AwsSdk::Instrumentation.instance.config
|
60
63
|
end
|
61
64
|
|
65
|
+
def service_name(context) # rubocop:disable Metrics/AbcSize
|
66
|
+
# Support aws-sdk v2.0.x, which 'metadata' has a setter method only
|
67
|
+
return context.client.class.to_s.split('::')[1] if ::Seahorse::Model::Api.instance_method(:metadata).parameters.length.positive?
|
68
|
+
|
69
|
+
context.client.class.api.metadata['serviceId'] || context.client.class.to_s.split('::')[1]
|
70
|
+
end
|
71
|
+
|
72
|
+
SEND_MESSAGE_CLIENT_METHODS = [SQS_SEND_MESSAGE, SQS_SEND_MESSAGE_BATCH, SNS_PUBLISH].freeze
|
62
73
|
def inject_context(context, client_method)
|
63
|
-
return unless
|
74
|
+
return unless SEND_MESSAGE_CLIENT_METHODS.include? client_method
|
64
75
|
return unless instrumentation_config[:inject_messaging_context]
|
65
76
|
|
66
77
|
if client_method == SQS_SEND_MESSAGE_BATCH
|
@@ -9,7 +9,7 @@ module OpenTelemetry
|
|
9
9
|
module AwsSdk
|
10
10
|
# Instrumentation class that detects and installs the AwsSdk instrumentation
|
11
11
|
class Instrumentation < OpenTelemetry::Instrumentation::Base
|
12
|
-
MINIMUM_VERSION = Gem::Version.new('2.0')
|
12
|
+
MINIMUM_VERSION = Gem::Version.new('2.0.0')
|
13
13
|
|
14
14
|
install do |_config|
|
15
15
|
require_dependencies
|
@@ -21,7 +21,7 @@ module OpenTelemetry
|
|
21
21
|
end
|
22
22
|
|
23
23
|
compatible do
|
24
|
-
gem_version >= MINIMUM_VERSION
|
24
|
+
!gem_version.nil? && gem_version >= MINIMUM_VERSION
|
25
25
|
end
|
26
26
|
|
27
27
|
option :extract_messaging_context, default: false, validate: :boolean
|
@@ -33,6 +33,8 @@ module OpenTelemetry
|
|
33
33
|
Gem.loaded_specs['aws-sdk'].version
|
34
34
|
elsif Gem.loaded_specs['aws-sdk-core']
|
35
35
|
Gem.loaded_specs['aws-sdk-core'].version
|
36
|
+
elsif defined?(::Aws::CORE_GEM_VERSION)
|
37
|
+
Gem::Version.new(::Aws::CORE_GEM_VERSION)
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -10,23 +10,19 @@ module OpenTelemetry
|
|
10
10
|
# MessagingHelper class provides methods for calculating messaging span attributes
|
11
11
|
class MessagingHelper
|
12
12
|
class << self
|
13
|
-
def destination_name(context)
|
13
|
+
def destination_name(context)
|
14
14
|
topic_arn = context.params[:topic_arn]
|
15
15
|
target_arn = context.params[:target_arn]
|
16
|
-
phone_number = context.params[:phone_number]
|
17
|
-
queue_url = context.params[:queue_url]
|
18
16
|
|
19
17
|
if topic_arn || target_arn
|
20
18
|
arn = topic_arn || target_arn
|
21
|
-
|
22
|
-
return arn.split(':')[-1]
|
23
|
-
rescue StandardError
|
24
|
-
return arn
|
25
|
-
end
|
19
|
+
return arn.split(':')[-1]
|
26
20
|
end
|
27
21
|
|
22
|
+
phone_number = context.params[:phone_number]
|
28
23
|
return 'phone_number' if phone_number
|
29
24
|
|
25
|
+
queue_url = context.params[:queue_url]
|
30
26
|
return queue_url.split('/')[-1] if queue_url
|
31
27
|
|
32
28
|
'unknown'
|
@@ -36,7 +32,7 @@ module OpenTelemetry
|
|
36
32
|
attributes[SemanticConventions::Trace::MESSAGING_SYSTEM] = 'aws.sqs'
|
37
33
|
attributes[SemanticConventions::Trace::MESSAGING_DESTINATION_KIND] = 'queue'
|
38
34
|
attributes[SemanticConventions::Trace::MESSAGING_DESTINATION] = destination_name(context)
|
39
|
-
attributes[SemanticConventions::Trace::MESSAGING_URL] = context.params[:queue_url]
|
35
|
+
attributes[SemanticConventions::Trace::MESSAGING_URL] = context.params[:queue_url] if context.params[:queue_url]
|
40
36
|
|
41
37
|
attributes[SemanticConventions::Trace::MESSAGING_OPERATION] = 'receive' if client_method == 'SQS.ReceiveMessage'
|
42
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspecto-opentelemetry-instrumentation-aws_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- OpenTelemetry Authors
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -100,14 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.1'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.1'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: opentelemetry-test-helpers
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: pry
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,7 +236,7 @@ dependencies:
|
|
222
236
|
version: 0.1.6
|
223
237
|
description: AWS SDK instrumentation for the OpenTelemetry framework
|
224
238
|
email:
|
225
|
-
-
|
239
|
+
- cncf-opentelemetry-contributors@lists.cncf.io
|
226
240
|
executables: []
|
227
241
|
extensions: []
|
228
242
|
extra_rdoc_files: []
|
@@ -240,15 +254,15 @@ files:
|
|
240
254
|
- lib/opentelemetry/instrumentation/aws_sdk/messaging_helper.rb
|
241
255
|
- lib/opentelemetry/instrumentation/aws_sdk/services.rb
|
242
256
|
- lib/opentelemetry/instrumentation/aws_sdk/version.rb
|
243
|
-
homepage: https://
|
257
|
+
homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
244
258
|
licenses:
|
245
259
|
- Apache-2.0
|
246
260
|
metadata:
|
247
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-aws_sdk/v0.
|
261
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-aws_sdk/v0.4.2/file.CHANGELOG.html
|
248
262
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/aws_sdk
|
249
263
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
250
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-aws_sdk/v0.
|
251
|
-
post_install_message:
|
264
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-aws_sdk/v0.4.2
|
265
|
+
post_install_message:
|
252
266
|
rdoc_options: []
|
253
267
|
require_paths:
|
254
268
|
- lib
|
@@ -256,15 +270,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
270
|
requirements:
|
257
271
|
- - ">="
|
258
272
|
- !ruby/object:Gem::Version
|
259
|
-
version: 2.
|
273
|
+
version: 2.6.0
|
260
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
275
|
requirements:
|
262
276
|
- - ">="
|
263
277
|
- !ruby/object:Gem::Version
|
264
278
|
version: '0'
|
265
279
|
requirements: []
|
266
|
-
rubygems_version: 3.
|
267
|
-
signing_key:
|
280
|
+
rubygems_version: 3.1.4
|
281
|
+
signing_key:
|
268
282
|
specification_version: 4
|
269
283
|
summary: AWS SDK instrumentation for the OpenTelemetry framework
|
270
284
|
test_files: []
|