opentelemetry-instrumentation-aws_sdk 0.12.0 → 0.13.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: be010ebe132208c78615f1de510817a27f8bad82db753cd6092683719b20ca8d
4
- data.tar.gz: bd3a3cdc8c469a5f01dca2ec8c1a03e39ce030551bdf18219383c326aeedb33d
3
+ metadata.gz: 36475ac9d78a7aac349f55baeb62c15571fb1d4e641590178f92e3d4a7cdd1b0
4
+ data.tar.gz: 23f73c8044945ed782e9a10eb442f62e3f08661e91512dac617d7447a911927c
5
5
  SHA512:
6
- metadata.gz: b1028f438e8708df4263060aa1776324893fc0c662efac4f58bb856ed4ed88523d1786dab1a9c40c5c04d8b918ba15946494f13fee0491d192ad77b4a5be4860
7
- data.tar.gz: 2a7e7fe7b990e18518b451209c085097abdabfc6c09d996218c5064b05659bb2bc2404d60e534397624abbcd951756e21f60dc13f3ad7f92d122066a3cda1e4b
6
+ metadata.gz: 25c729e17716e933aebaed2d8fcf9fcb8b1841bf921b05bd1bdde464cd3e18acd55e4a72ffe1d554bdf47fc29bdb5b8acd673a2dc2735809a3d8f30dbf0b848c
7
+ data.tar.gz: a4b2a20ac429ee78c1b175a8366327168fd84e795f2c16751b986beea26748f4f83ff1477f498b16e4d899987f17530e8d2b5e5b70f7e946a49534143fa4f2e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-aws_sdk
2
2
 
3
+ ## v0.13.0 / 2026-08-18
4
+
5
+ - ADDED: Add `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable support for aws-sdk-dynamodb (#2135)
6
+
3
7
  ## v0.12.0 / 2026-04-14
4
8
 
5
9
  - BREAKING CHANGE: Min Ruby Version 3.3 (#2125)
data/README.md CHANGED
@@ -82,6 +82,20 @@ The `opentelemetry-instrumentation-aws_sdk` gem source is [on github][repo-githu
82
82
 
83
83
  The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our [GitHub Discussions][discussions-url], [Slack Channel][slack-channel] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
84
84
 
85
+ ## Database semantic convention stability
86
+
87
+ In the OpenTelemetry ecosystem, database semantic conventions have now reached a stable state. However, the initial aws-sdk instrumentation was introduced before this stability was achieved, which resulted in database attributes being based on an older version of the semantic conventions.
88
+
89
+ To facilitate the migration to stable semantic conventions, you can use the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable. This variable allows you to opt-in to the new stable conventions, ensuring compatibility and future-proofing your instrumentation.
90
+
91
+ When setting the value for `OTEL_SEMCONV_STABILITY_OPT_IN`, you can specify which conventions you wish to adopt:
92
+
93
+ - `database` - Emits the stable database and networking conventions and ceases emitting the old conventions previously emitted by the instrumentation.
94
+ - `database/dup` - Emits both the old and stable database and networking conventions, enabling a phased rollout of the stable semantic conventions.
95
+ - Default behavior (in the absence of either value) is to continue emitting the old database and networking conventions the instrumentation previously emitted.
96
+
97
+ For additional information on migration, please refer to our [documentation](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/).
98
+
85
99
  ## License
86
100
 
87
101
  Apache 2.0 license. See [LICENSE][license-github] for more information.
@@ -32,7 +32,7 @@ module OpenTelemetry
32
32
  OpenTelemetry::SemanticConventions::Trace::RPC_SYSTEM => 'aws-api'
33
33
  }.tap do |attrs|
34
34
  attrs[OpenTelemetry::SemanticConventions::Trace::CODE_NAMESPACE] = 'Aws::Plugins::AwsSdk' if legacy
35
- attrs[SemanticConventions::Trace::DB_SYSTEM] = 'dynamodb' if service_id == 'DynamoDB'
35
+ apply_dynamodb_attributes(attrs, context) if service_id == 'DynamoDB'
36
36
 
37
37
  MessagingHelper.apply_span_attributes(context, attrs, client_method, service_id) if MessagingHelper::SUPPORTED_SERVICES.include?(service_id)
38
38
  end
@@ -72,6 +72,25 @@ module OpenTelemetry
72
72
 
73
73
  private
74
74
 
75
+ def apply_dynamodb_attributes(attrs, context)
76
+ semconv_mode = OpenTelemetry::Instrumentation::AwsSdk::Instrumentation.instance.semconv_mode
77
+ table_name = context.params[:table_name]
78
+
79
+ case semconv_mode
80
+ when :stable
81
+ attrs['db.system.name'] = 'aws.dynamodb'
82
+ attrs['db.operation.name'] = context.operation.name
83
+ attrs['db.collection.name'] = table_name if table_name
84
+ when :dup
85
+ attrs[SemanticConventions::Trace::DB_SYSTEM] = 'dynamodb'
86
+ attrs['db.system.name'] = 'aws.dynamodb'
87
+ attrs['db.operation.name'] = context.operation.name
88
+ attrs['db.collection.name'] = table_name if table_name
89
+ else # :old (default)
90
+ attrs[SemanticConventions::Trace::DB_SYSTEM] = 'dynamodb'
91
+ end
92
+ end
93
+
75
94
  def legacy_service_id(context)
76
95
  # Support aws-sdk v2.0.x, which 'metadata' has a setter method only
77
96
  return context.client.class.to_s.split('::')[1] if ::Seahorse::Model::Api.instance_method(:metadata).parameters.length.positive?
@@ -67,6 +67,21 @@ module OpenTelemetry
67
67
  end
68
68
  end
69
69
 
70
+ # Returns the semconv mode based on OTEL_SEMCONV_STABILITY_OPT_IN env var
71
+ # @return [Symbol] :old, :stable, or :dup
72
+ def semconv_mode
73
+ @semconv_mode ||= begin
74
+ opt_in = ENV.fetch('OTEL_SEMCONV_STABILITY_OPT_IN', '')
75
+ if opt_in.include?('database/dup')
76
+ :dup
77
+ elsif opt_in.include?('database')
78
+ :stable
79
+ else
80
+ :old
81
+ end
82
+ end
83
+ end
84
+
70
85
  private
71
86
 
72
87
  def resolve_config(config)
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module AwsSdk
10
- VERSION = '0.12.0'
10
+ VERSION = '0.13.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-aws_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
@@ -48,10 +48,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
48
48
  licenses:
49
49
  - Apache-2.0
50
50
  metadata:
51
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.12.0/file/CHANGELOG.md
52
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-aws_sdk/v0.12.0/instrumentation/aws_sdk
51
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.13.0/file/CHANGELOG.md
52
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-aws_sdk/v0.13.0/instrumentation/aws_sdk
53
53
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
54
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.12.0
54
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_sdk/0.13.0
55
55
  rdoc_options: []
56
56
  require_paths:
57
57
  - lib
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubygems_version: 4.0.6
69
+ rubygems_version: 4.0.16
70
70
  specification_version: 4
71
71
  summary: AWS SDK instrumentation for the OpenTelemetry framework
72
72
  test_files: []