Skip to content

Commit 024db25

Browse files
Addressing Ruben's feedback
1 parent aeaf6ff commit 024db25

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

aws_lambda_powertools/tracing/provider/xray/xray_tracer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ def set_attribute(
2929
**kwargs,
3030
) -> None:
3131
"""
32-
Set attribute on this span with a key-value pair.
32+
Set an attribute on this span with a key-value pair.
3333
3434
Parameters
3535
----------
36-
key : str
36+
key: str
3737
attribute key
38-
value : Any
38+
value: Any
3939
Value for attribute
40-
category : Literal["Annotation","Metadata","Auto"] = "Auto"
40+
category: Literal["Annotation","Metadata","Auto"] = "Auto"
4141
This parameter specifies the category of attribute to set.
4242
- **"Annotation"**: Sets the attribute as an Annotation.
4343
- **"Metadata"**: Sets the attribute as Metadata.
@@ -94,15 +94,15 @@ def set_attribute(
9494
**kwargs,
9595
) -> None:
9696
"""
97-
Set attribute on the current active span with a key-value pair.
97+
Set an attribute on the current active span with a key-value pair.
9898
9999
Parameters
100100
----------
101-
key : str
101+
key: str
102102
attribute key
103-
value : Any
103+
value: Any
104104
Value for attribute
105-
category : Literal["Annotation","Metadata","Auto"] = "Auto"
105+
category: Literal["Annotation","Metadata","Auto"] = "Auto"
106106
This parameter specifies the type of attribute to set.
107107
- **"Annotation"**: Sets the attribute as an Annotation.
108108
- **"Metadata"**: Sets the attribute as Metadata.

aws_lambda_powertools/tracing/tracer.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,20 @@ def __init__(
179179
self._disable_xray_trace_batching()
180180

181181
def set_attribute(self, key: str, value: Any, **kwargs):
182-
"""Set attribute on current active span with a key-value pair.
182+
"""Set an attribute on current active span with a key-value pair.
183183
184184
Parameters
185185
----------
186-
key : str
186+
key: str
187187
attribute key
188-
value : Any
188+
value: Any
189189
Value for attribute
190190
kwargs: Optional[dict]
191191
Optional parameters to be passed to provider.set_attributes
192192
193193
Example
194194
-------
195-
Set attribute for a pseudo service named payment
195+
Set an attribute for a pseudo service named payment
196196
197197
tracer = Tracer(service="payment")
198198
tracer.set_attribute("PaymentStatus", "CONFIRMED")
@@ -846,13 +846,7 @@ def _reset_config(cls):
846846
cls._config = copy.copy(cls._default_config)
847847

848848
def _patch_xray_provider(self):
849-
# Due to Lazy Import, we need to activate `core` attrib via import
850-
# we also need to include `patch`, `patch_all` methods
851-
# to ensure patch calls are done via the provider
852-
853-
provider = XrayProvider()
854-
855-
return provider
849+
return XrayProvider()
856850

857851
def _disable_xray_trace_batching(self):
858852
"""Configure X-Ray SDK to send subsegment individually over batching

0 commit comments

Comments
 (0)