2
2
import numbers
3
3
import traceback
4
4
from contextlib import contextmanager
5
- from typing import Any , Generator , List , NoReturn , Optional , Sequence , Union
5
+ from typing import Any , Generator , List , Optional , Sequence , Union
6
6
7
7
8
8
class BaseSegment (abc .ABC ):
@@ -28,7 +28,7 @@ def remove_subsegment(self, subsegment: Any):
28
28
"""Remove input subsegment from child subsegments."""
29
29
30
30
@abc .abstractmethod
31
- def put_annotation (self , key : str , value : Union [str , numbers .Number , bool ]) -> NoReturn :
31
+ def put_annotation (self , key : str , value : Union [str , numbers .Number , bool ]) -> None :
32
32
"""Annotate segment or subsegment with a key-value pair.
33
33
34
34
Note: Annotations will be indexed for later search query.
@@ -42,7 +42,7 @@ def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> N
42
42
"""
43
43
44
44
@abc .abstractmethod
45
- def put_metadata (self , key : str , value : Any , namespace : str = "default" ) -> NoReturn :
45
+ def put_metadata (self , key : str , value : Any , namespace : str = "default" ) -> None :
46
46
"""Add metadata to segment or subsegment. Metadata is not indexed
47
47
but can be later retrieved by BatchGetTraces API.
48
48
@@ -101,7 +101,7 @@ def in_subsegment_async(self, name=None, **kwargs) -> Generator[BaseSegment, Non
101
101
"""
102
102
103
103
@abc .abstractmethod
104
- def put_annotation (self , key : str , value : Union [str , numbers .Number , bool ]) -> NoReturn :
104
+ def put_annotation (self , key : str , value : Union [str , numbers .Number , bool ]) -> None :
105
105
"""Annotate current active trace entity with a key-value pair.
106
106
107
107
Note: Annotations will be indexed for later search query.
@@ -115,7 +115,7 @@ def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> N
115
115
"""
116
116
117
117
@abc .abstractmethod
118
- def put_metadata (self , key : str , value : Any , namespace : str = "default" ) -> NoReturn :
118
+ def put_metadata (self , key : str , value : Any , namespace : str = "default" ) -> None :
119
119
"""Add metadata to the current active trace entity.
120
120
121
121
Note: Metadata is not indexed but can be later retrieved by BatchGetTraces API.
@@ -131,7 +131,7 @@ def put_metadata(self, key: str, value: Any, namespace: str = "default") -> NoRe
131
131
"""
132
132
133
133
@abc .abstractmethod
134
- def patch (self , modules : Sequence [str ]) -> NoReturn :
134
+ def patch (self , modules : Sequence [str ]) -> None :
135
135
"""Instrument a set of supported libraries
136
136
137
137
Parameters
@@ -141,5 +141,5 @@ def patch(self, modules: Sequence[str]) -> NoReturn:
141
141
"""
142
142
143
143
@abc .abstractmethod
144
- def patch_all (self ) -> NoReturn :
144
+ def patch_all (self ) -> None :
145
145
"""Instrument all supported libraries"""
0 commit comments