opentelemetry-instrumentation-aws_sdk 0.9.1 → 0.10.0

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: 8d042cf96a48a860701f9dacde39e897805cbd5ae893f33825602c387a4d0fd6
4
- data.tar.gz: '019efe3b866f2f2cef4351d296fb75f4b4fbb646cca5fb6d5ab37c19a7d9ad25'
3
+ metadata.gz: 3c52a6dc94b8a1989bb49631f727cacc5030b29d82bbe23c4ab5114b82c58231
4
+ data.tar.gz: '01192196710eedde6f837a099381c4262740bdbf54ca08748b60305caac1bdff'
5
5
  SHA512:
6
- metadata.gz: 77c2fcaa0ed74675bdb27f364218fdff5a723e40efefbfd8cc05f8aca1e2db7614b2d1c126d7b972c7c030b7d2800fd941a6a46401634d0fe66f103520063e6e
7
- data.tar.gz: 8a1054b1214809bfbb6552ac08fe5cb438fa0e31e9ab48492bf5104e39f6416cffeef71edf9d5937e498233bacf33960e51019ee769068c31b43a8c2aebb6350
6
+ metadata.gz: 8f79b39d4fb8cbedc956853e40be7a6fb4b679bb5c917201e32614a61cc549927261b2a6560c3b1c533325357f62b355f42e586fa9e1b29566f7d923c2a31985
7
+ data.tar.gz: 03533bd5bbcc70f4497684b53f3887232cdabfb45527a79f31cb21799cee65a7e171ed7d620d499bae0a1b47d84423adc6ace10ba74e8a0d6f93071076c5ce01
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History: opentelemetry-instrumentation-aws_sdk
2
2
 
3
+ ### v0.10.0 / 2025-10-11
4
+
5
+ * BREAKING CHANGE: Suppress internal spans by default
6
+
7
+ * ADDED: Suppress internal spans by default
8
+
3
9
  ### v0.9.1 / 2025-09-30
4
10
 
5
11
  * FIXED: Min OTel Ruby API 1.7
data/README.md CHANGED
@@ -20,7 +20,7 @@ To install the instrumentation, call `use` with the name of the instrumentation.
20
20
  OpenTelemetry::SDK.configure do |c|
21
21
  c.use 'OpenTelemetry::Instrumentation::AwsSdk', {
22
22
  inject_messaging_context: true,
23
- suppress_internal_instrumentation: true
23
+ enable_internal_instrumentation: true
24
24
  }
25
25
  end
26
26
  ```
@@ -36,8 +36,10 @@ end
36
36
  This instrumentation offers the following configuration options:
37
37
  * `:inject_messaging_context` (default: `false`): When set to `true`, adds context key/value
38
38
  to Message Attributes for SQS/SNS messages.
39
- * `suppress_internal_instrumentation` (default: `false`): When set to `true`, any spans with
40
- span kind of `internal` are suppressed from traces.
39
+ * `:enable_internal_instrumentation` (default: `false`): When set to `true`, any spans with
40
+ span kind of `internal` are traced.
41
+ * `:suppress_internal_instrumentation`: **Deprecated**. This configuration has been
42
+ deprecated in a favor of `:enable_internal_instrumentation`
41
43
 
42
44
  ## Integration with SDK V3's Telemetry support
43
45
  AWS SDK for Ruby V3 added support for Observability which includes a new configuration,
@@ -23,7 +23,7 @@ module OpenTelemetry
23
23
  ) do |span|
24
24
  MessagingHelper.inject_context_if_supported(context, client_method, service_id)
25
25
 
26
- if HandlerHelper.instrumentation_config[:suppress_internal_instrumentation]
26
+ if HandlerHelper.skip_internal_instrumentation?
27
27
  OpenTelemetry::Common::Utilities.untraced { super }
28
28
  else
29
29
  super
@@ -32,7 +32,6 @@ module OpenTelemetry
32
32
  OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE,
33
33
  context.http_response.status_code
34
34
  )
35
-
36
35
  if (err = response.error)
37
36
  span.record_exception(err)
38
37
  span.status = Trace::Status.error(err.to_s)
@@ -14,6 +14,10 @@ module OpenTelemetry
14
14
  AwsSdk::Instrumentation.instance.config
15
15
  end
16
16
 
17
+ def skip_internal_instrumentation?
18
+ instrumentation_config[:enable_internal_instrumentation] == false
19
+ end
20
+
17
21
  def client_method(service_id, context)
18
22
  "#{service_id}.#{context.operation.name}".delete(' ')
19
23
  end
@@ -19,24 +19,27 @@ module OpenTelemetry
19
19
  # - `false` **(default)** - Context key/value will not be added.
20
20
  # - `true` - Context key/value will be added.
21
21
  #
22
- # ### `:suppress_internal_instrumentation`
22
+ # ### `:enable_internal_instrumentation`
23
+ # Enables tracing of spans of `internal` span kind.
23
24
  #
24
- # Disables tracing of spans of `internal` span kind.
25
+ # - `false` **(default)** - Internal spans are not traced
26
+ # - `true` - Internal spans are traced.
25
27
  #
26
- # - `false` **(default)** - Internal spans are traced.
27
- # - `true` - Internal spans are not traced.
28
+ # ### `:suppress_internal_instrumentation` (deprecated)
29
+ # This configuration has been deprecated in a favor of `:enable_internal_instrumentation`
28
30
  #
29
- # @example An explicit default configuration
31
+ # @example An explicit default configurations
30
32
  # OpenTelemetry::SDK.configure do |c|
31
33
  # c.use 'OpenTelemetry::Instrumentation::AwsSdk', {
32
34
  # inject_messaging_context: false,
33
- # suppress_internal_instrumentation: false
35
+ # enable_internal_instrumentation: false
34
36
  # }
35
37
  # end
36
38
  class Instrumentation < OpenTelemetry::Instrumentation::Base
37
39
  MINIMUM_VERSION = Gem::Version.new('2.0.0')
38
40
 
39
- install do |_config|
41
+ install do |config|
42
+ resolve_config(config)
40
43
  require_dependencies
41
44
  patch_telemetry_plugin if telemetry_plugin?
42
45
  add_plugins(Seahorse::Client::Base, *loaded_service_clients)
@@ -52,6 +55,7 @@ module OpenTelemetry
52
55
 
53
56
  option :inject_messaging_context, default: false, validate: :boolean
54
57
  option :suppress_internal_instrumentation, default: false, validate: :boolean
58
+ option :enable_internal_instrumentation, default: false, validate: :boolean
55
59
 
56
60
  def gem_version
57
61
  if Gem.loaded_specs['aws-sdk']
@@ -65,6 +69,15 @@ module OpenTelemetry
65
69
 
66
70
  private
67
71
 
72
+ def resolve_config(config)
73
+ return unless config[:suppress_internal_instrumentation]
74
+
75
+ OpenTelemetry.logger.warn(
76
+ 'Instrumentation AwsSdk configuration option suppress_internal_instrumentation has been deprecated,' \
77
+ 'use enable_internal_instrumentation option instead'
78
+ )
79
+ end
80
+
68
81
  def require_dependencies
69
82
  require_relative 'handler'
70
83
  require_relative 'handler_helper'
@@ -26,7 +26,7 @@ module OpenTelemetry
26
26
  ) do |span|
27
27
  MessagingHelper.inject_context_if_supported(context, client_method, service_id)
28
28
 
29
- if HandlerHelper.instrumentation_config[:suppress_internal_instrumentation]
29
+ if HandlerHelper.skip_internal_instrumentation?
30
30
  OpenTelemetry::Common::Utilities.untraced { super }
31
31
  else
32
32
  yield span
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module AwsSdk
10
- VERSION = '0.9.1'
10
+ VERSION = '0.10.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-aws_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-01 00:00:00.000000000 Z
11
+ date: 2025-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-instrumentation-base
@@ -49,10 +49,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
49
49
  licenses:
50
50
  - Apache-2.0
51
51
  metadata:
52
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.9.1/file/CHANGELOG.md
52
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.10.0/file/CHANGELOG.md
53
53
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/aws_sdk
54
54
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
55
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.9.1
55
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.10.0
56
56
  post_install_message:
57
57
  rdoc_options: []
58
58
  require_paths: