File tree Expand file tree Collapse file tree 5 files changed +29
-1
lines changed
opentelemetry-api/src/opentelemetry/_metrics
opentelemetry-sdk/src/opentelemetry/sdk/_metrics Expand file tree Collapse file tree 5 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ def __init__(
98
98
99
99
100
100
class Synchronous (Instrument ):
101
- pass
101
+ """Base class for all synchronous instruments"""
102
102
103
103
104
104
class Asynchronous (Instrument ):
105
+ """Base class for all asynchronous instruments"""
106
+
105
107
@abstractmethod
106
108
def __init__ (
107
109
self ,
Original file line number Diff line number Diff line change 55
55
56
56
57
57
class Meter (APIMeter ):
58
+ """See `opentelemetry._metrics.Meter`."""
59
+
58
60
def __init__ (
59
61
self ,
60
62
instrumentation_scope : InstrumentationScope ,
Original file line number Diff line number Diff line change 35
35
36
36
37
37
class MetricExportResult (Enum ):
38
+ """Result of exporting a metric
39
+
40
+ Can be any of the following values:"""
41
+
38
42
SUCCESS = 0
39
43
FAILURE = 1
40
44
Original file line number Diff line number Diff line change 23
23
24
24
@dataclass (frozen = True )
25
25
class Measurement :
26
+ """
27
+ Represents a data point reported via the metrics API to the SDK.
28
+ """
29
+
26
30
value : Union [int , float ]
27
31
instrument : "_Instrument"
28
32
attributes : Attributes = None
Original file line number Diff line number Diff line change 23
23
24
24
25
25
class AggregationTemporality (IntEnum ):
26
+ """
27
+ The temporality to use when aggregating data.
28
+
29
+ Can be one of the following values:
30
+ """
31
+
26
32
UNSPECIFIED = 0
27
33
DELTA = 1
28
34
CUMULATIVE = 2
29
35
30
36
31
37
@dataclass (frozen = True )
32
38
class Sum :
39
+ """Represents the type of a scalar metric that is calculated as a sum of
40
+ all reported measurements over a time interval."""
41
+
33
42
aggregation_temporality : AggregationTemporality
34
43
is_monotonic : bool
35
44
start_time_unix_nano : int
@@ -39,12 +48,19 @@ class Sum:
39
48
40
49
@dataclass (frozen = True )
41
50
class Gauge :
51
+ """Represents the type of a scalar metric that always exports the current
52
+ value for every data point. It should be used for an unknown
53
+ aggregation."""
54
+
42
55
time_unix_nano : int
43
56
value : Union [int , float ]
44
57
45
58
46
59
@dataclass (frozen = True )
47
60
class Histogram :
61
+ """Represents the type of a metric that is calculated by aggregating as a
62
+ histogram of all reported measurements over a time interval."""
63
+
48
64
aggregation_temporality : AggregationTemporality
49
65
bucket_counts : Sequence [int ]
50
66
explicit_bounds : Sequence [float ]
You can’t perform that action at this time.
0 commit comments