File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ def overload(x: "T") -> "T":
7070 "last_event_id" ,
7171 "new_scope" ,
7272 "push_scope" ,
73+ "remove_attribute" ,
74+ "set_attribute" ,
7375 "set_context" ,
7476 "set_extra" ,
7577 "set_level" ,
@@ -287,6 +289,28 @@ def push_scope( # noqa: F811
287289 return _ScopeManager ()
288290
289291
292+ @scopemethod
293+ def set_attribute (key : str , value : "Any" ) -> None :
294+ """
295+ Set an attribute.
296+
297+ Any attributes-based telemetry (logs, metrics) captured in this scope will
298+ include this attribute.
299+ """
300+ return get_isolation_scope ().set_attribute (key , value )
301+
302+
303+ @scopemethod
304+ def remove_attribute (key : str ) -> None :
305+ """
306+ Remove an attribute.
307+
308+ If the attribute doesn't exist, this function will not have any effect and
309+ it will also not raise an exception.
310+ """
311+ return get_isolation_scope ().remove_attribute (key )
312+
313+
290314@scopemethod
291315def set_tag (key : str , value : "Any" ) -> None :
292316 return get_isolation_scope ().set_tag (key , value )
You can’t perform that action at this time.
0 commit comments