opentelemetry-instrumentation-botocore 0.50b0__py3-none-any.whl → 0.52b0__py3-none-any.whl

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.
@@ -12,9 +12,13 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ from __future__ import annotations
16
+
15
17
  import logging
16
18
  from typing import Any, Dict, Optional, Tuple
17
19
 
20
+ from opentelemetry._events import EventLogger
21
+ from opentelemetry.metrics import Instrument, Meter
18
22
  from opentelemetry.trace import SpanKind
19
23
  from opentelemetry.trace.span import Span
20
24
  from opentelemetry.util.types import AttributeValue
@@ -89,10 +93,35 @@ class _AwsSdkCallContext:
89
93
  return default
90
94
 
91
95
 
96
+ class _BotocoreInstrumentorContext:
97
+ def __init__(
98
+ self,
99
+ event_logger: EventLogger,
100
+ metrics: Dict[str, Instrument] | None = None,
101
+ ):
102
+ self.event_logger = event_logger
103
+ self.metrics = metrics or {}
104
+
105
+
92
106
  class _AwsSdkExtension:
93
107
  def __init__(self, call_context: _AwsSdkCallContext):
94
108
  self._call_context = call_context
95
109
 
110
+ @staticmethod
111
+ def tracer_schema_version() -> str:
112
+ """Returns the tracer OTel schema version the extension is following"""
113
+ return "1.11.0"
114
+
115
+ @staticmethod
116
+ def event_logger_schema_version() -> str:
117
+ """Returns the event logger OTel schema version the extension is following"""
118
+ return "1.30.0"
119
+
120
+ @staticmethod
121
+ def meter_schema_version() -> str:
122
+ """Returns the meter OTel schema version the extension is following"""
123
+ return "1.30.0"
124
+
96
125
  def should_trace_service_call(self) -> bool: # pylint:disable=no-self-use
97
126
  """Returns if the AWS SDK service call should be traced or not
98
127
 
@@ -101,13 +130,29 @@ class _AwsSdkExtension:
101
130
  """
102
131
  return True
103
132
 
133
+ def should_end_span_on_exit(self) -> bool: # pylint:disable=no-self-use
134
+ """Returns if the span should be closed automatically on exit
135
+
136
+ Extensions might override this function to disable automatic closing
137
+ of the span if they need to close it at a later time themselves.
138
+ """
139
+ return True
140
+
141
+ def setup_metrics(self, meter: Meter, metrics: Dict[str, Instrument]):
142
+ """Callback which gets invoked to setup metrics.
143
+
144
+ Extensions might override this function to add to the metrics dictionary all the metrics
145
+ they want to receive later in _BotocoreInstrumentorContext."""
146
+
104
147
  def extract_attributes(self, attributes: _AttributeMapT):
105
148
  """Callback which gets invoked before the span is created.
106
149
 
107
150
  Extensions might override this function to extract additional attributes.
108
151
  """
109
152
 
110
- def before_service_call(self, span: Span):
153
+ def before_service_call(
154
+ self, span: Span, instrumentor_context: _BotocoreInstrumentorContext
155
+ ):
111
156
  """Callback which gets invoked after the span is created but before the
112
157
  AWS SDK service is called.
113
158
 
@@ -115,7 +160,12 @@ class _AwsSdkExtension:
115
160
  a carrier.
116
161
  """
117
162
 
118
- def on_success(self, span: Span, result: _BotoResultT):
163
+ def on_success(
164
+ self,
165
+ span: Span,
166
+ result: _BotoResultT,
167
+ instrumentor_context: _BotocoreInstrumentorContext,
168
+ ):
119
169
  """Callback that gets invoked when the AWS SDK call returns
120
170
  successfully.
121
171
 
@@ -123,12 +173,19 @@ class _AwsSdkExtension:
123
173
  attributes on the span.
124
174
  """
125
175
 
126
- def on_error(self, span: Span, exception: _BotoClientErrorT):
176
+ def on_error(
177
+ self,
178
+ span: Span,
179
+ exception: _BotoClientErrorT,
180
+ instrumentor_context: _BotocoreInstrumentorContext,
181
+ ):
127
182
  """Callback that gets invoked when the AWS SDK service call raises a
128
183
  ClientError.
129
184
  """
130
185
 
131
- def after_service_call(self):
186
+ def after_service_call(
187
+ self, instrumentor_context: _BotocoreInstrumentorContext
188
+ ):
132
189
  """Callback that gets invoked after the AWS SDK service was called.
133
190
 
134
191
  Extensions might override this function to do some cleanup tasks.
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "0.50b0"
15
+ __version__ = "0.52b0"
@@ -1,10 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: opentelemetry-instrumentation-botocore
3
- Version: 0.50b0
3
+ Version: 0.52b0
4
4
  Summary: OpenTelemetry Botocore instrumentation
5
5
  Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-botocore
6
+ Project-URL: Repository, https://github.com/open-telemetry/opentelemetry-python-contrib
6
7
  Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
7
- License: Apache-2.0
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
8
10
  Classifier: Development Status :: 4 - Beta
9
11
  Classifier: Intended Audience :: Developers
10
12
  Classifier: License :: OSI Approved :: Apache Software License
@@ -15,11 +17,12 @@ Classifier: Programming Language :: Python :: 3.9
15
17
  Classifier: Programming Language :: Python :: 3.10
16
18
  Classifier: Programming Language :: Python :: 3.11
17
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
18
21
  Requires-Python: >=3.8
19
- Requires-Dist: opentelemetry-api~=1.12
20
- Requires-Dist: opentelemetry-instrumentation==0.50b0
22
+ Requires-Dist: opentelemetry-api~=1.30
23
+ Requires-Dist: opentelemetry-instrumentation==0.52b0
21
24
  Requires-Dist: opentelemetry-propagator-aws-xray~=1.0
22
- Requires-Dist: opentelemetry-semantic-conventions==0.50b0
25
+ Requires-Dist: opentelemetry-semantic-conventions==0.52b0
23
26
  Provides-Extra: instruments
24
27
  Requires-Dist: botocore~=1.0; extra == 'instruments'
25
28
  Description-Content-Type: text/x-rst
@@ -0,0 +1,18 @@
1
+ opentelemetry/instrumentation/botocore/__init__.py,sha256=3kgHjhP9dxM3ZsjPCYtLtZKwOwL5Rc16UM3K837qHmg,15368
2
+ opentelemetry/instrumentation/botocore/environment_variables.py,sha256=c1lrIEj5wwxZwLd5ppJsfGADBfQLnb_HuxXDLv7ul6s,114
3
+ opentelemetry/instrumentation/botocore/package.py,sha256=6xvfRpU_C3wlSO6pto7MhGtkPoCHDEiRO_Fh4DiC_50,622
4
+ opentelemetry/instrumentation/botocore/version.py,sha256=8ybzJrIcr5CRW9fxlL7vXcvj3IIncnVl6eHpEEIxEYk,608
5
+ opentelemetry/instrumentation/botocore/extensions/__init__.py,sha256=IqMWsCI0HL8gvL8-0Svn9Rp7dz2HKMcIuhRRM0twmCU,1857
6
+ opentelemetry/instrumentation/botocore/extensions/_messaging.py,sha256=ca2Uwyb1vxWu5qUkKTlfn9KJFN6k8HOTrrBYvwX4WzA,1636
7
+ opentelemetry/instrumentation/botocore/extensions/bedrock.py,sha256=fF_SdRGZzTyGDprlffh84bMVQhq3AZMcMAZAUTj1SDA,27814
8
+ opentelemetry/instrumentation/botocore/extensions/bedrock_utils.py,sha256=KMYlLigPaHxQq8nLQ0L0FHFEpwuVpYKIP9VugyKcysE,19430
9
+ opentelemetry/instrumentation/botocore/extensions/dynamodb.py,sha256=cmTzHnLCO731v8L5wN-rPRyVgQHmRvH3tuG5wrFhqyA,13745
10
+ opentelemetry/instrumentation/botocore/extensions/lmbd.py,sha256=mqPbgwDFy3XYg-pLo6A6eNu0iKSGa2-tPLwroJDuavY,4253
11
+ opentelemetry/instrumentation/botocore/extensions/sns.py,sha256=MfppfL91tAbAjp6CIiqvYIuXQRq-PeIYbB1ZKWO5kW4,5334
12
+ opentelemetry/instrumentation/botocore/extensions/sqs.py,sha256=9_LjlzQ0Sg92hgaL8P31cbpq_C71qCTucjj0SX1Ct5o,2916
13
+ opentelemetry/instrumentation/botocore/extensions/types.py,sha256=jCIJXt0Zvdn2qVwX6bLUaCLgBPy6XyJ-nYEwurxAZo8,6681
14
+ opentelemetry_instrumentation_botocore-0.52b0.dist-info/METADATA,sha256=NcL7-0rMyvxvjISr07Zc_N53vtBYr7UNwkXLEgnNXyg,2122
15
+ opentelemetry_instrumentation_botocore-0.52b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ opentelemetry_instrumentation_botocore-0.52b0.dist-info/entry_points.txt,sha256=v5hzQbZMJ61JuhBNq5jHYAapvv3C_486h9CTqxlkUTM,100
17
+ opentelemetry_instrumentation_botocore-0.52b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
18
+ opentelemetry_instrumentation_botocore-0.52b0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,15 +0,0 @@
1
- opentelemetry/instrumentation/botocore/__init__.py,sha256=GWNEAzPLwvBUhXGw0B6iAWKBgC9MjM5zHdHGquvEYcU,10223
2
- opentelemetry/instrumentation/botocore/package.py,sha256=6xvfRpU_C3wlSO6pto7MhGtkPoCHDEiRO_Fh4DiC_50,622
3
- opentelemetry/instrumentation/botocore/version.py,sha256=sBsbV8VQNTte60quPySrr3hMzVnRCO8AnGlwnGPP60o,608
4
- opentelemetry/instrumentation/botocore/extensions/__init__.py,sha256=nQGZ4Clq4d2eIeDK6v0IqQVJ6SIIBpzm57DJGXgL9TA,1665
5
- opentelemetry/instrumentation/botocore/extensions/_messaging.py,sha256=ca2Uwyb1vxWu5qUkKTlfn9KJFN6k8HOTrrBYvwX4WzA,1636
6
- opentelemetry/instrumentation/botocore/extensions/dynamodb.py,sha256=BA-zoY-Cr878t5Q3pYS3r1PKAd4FFBtdTCXZLoC3tLE,13554
7
- opentelemetry/instrumentation/botocore/extensions/lmbd.py,sha256=Fm4_Pq9Wl2BPsHBo6iTJtof4QZTvG1XRBLrf6t-JoWM,4153
8
- opentelemetry/instrumentation/botocore/extensions/sns.py,sha256=Y0P3r_9msd33UFUFeitS01QBF4Aivqo4yPIDDy-qeLw,5360
9
- opentelemetry/instrumentation/botocore/extensions/sqs.py,sha256=2-ifTjtMQXayKQ-fEdxS_R7ckPXl7Givq3JESFz-Ou0,2791
10
- opentelemetry/instrumentation/botocore/extensions/types.py,sha256=JWSXOP3KC6WRXbWG4EQczDDjaYhpq2HzTisUZn9e0m4,4857
11
- opentelemetry_instrumentation_botocore-0.50b0.dist-info/METADATA,sha256=sWhBdeN9IzCUuEZ2P8SIo9PhIkUkvh_wnsHbfeRFgWM,1950
12
- opentelemetry_instrumentation_botocore-0.50b0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
13
- opentelemetry_instrumentation_botocore-0.50b0.dist-info/entry_points.txt,sha256=v5hzQbZMJ61JuhBNq5jHYAapvv3C_486h9CTqxlkUTM,100
14
- opentelemetry_instrumentation_botocore-0.50b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
- opentelemetry_instrumentation_botocore-0.50b0.dist-info/RECORD,,