@@ -36,7 +36,7 @@ def __init__(self, name: str, documentation: str, typ: str, unit: str = ''):
3636 self .type : str = typ
3737 self .samples : List [Sample ] = []
3838
39- def add_sample (self , name : str , labels : Dict [str , str ], value : Union [ int , float ] , timestamp : Optional [Union [Timestamp , float ]] = None , exemplar : Optional [Exemplar ] = None ) -> None :
39+ def add_sample (self , name : str , labels : Dict [str , str ], value : float , timestamp : Optional [Union [Timestamp , float ]] = None , exemplar : Optional [Exemplar ] = None ) -> None :
4040 """Add a sample to the metric.
4141
4242 Internal-only, do not use."""
@@ -77,7 +77,7 @@ class UnknownMetricFamily(Metric):
7777 def __init__ (self ,
7878 name : str ,
7979 documentation : str ,
80- value : Optional [Union [ int , float ] ] = None ,
80+ value : Optional [float ] = None ,
8181 labels : Optional [Sequence [str ]] = None ,
8282 unit : str = '' ,
8383 ):
@@ -90,7 +90,7 @@ def __init__(self,
9090 if value is not None :
9191 self .add_metric ([], value )
9292
93- def add_metric (self , labels : Sequence [str ], value : Union [ int , float ] , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
93+ def add_metric (self , labels : Sequence [str ], value : float , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
9494 """Add a metric to the metric family.
9595 Args:
9696 labels: A list of label values
@@ -112,7 +112,7 @@ class CounterMetricFamily(Metric):
112112 def __init__ (self ,
113113 name : str ,
114114 documentation : str ,
115- value : Optional [Union [ int , float ] ] = None ,
115+ value : Optional [float ] = None ,
116116 labels : Sequence [str ] = None ,
117117 created : Optional [float ] = None ,
118118 unit : str = '' ,
@@ -131,7 +131,7 @@ def __init__(self,
131131
132132 def add_metric (self ,
133133 labels : Sequence [str ],
134- value : Union [ int , float ] ,
134+ value : float ,
135135 created : Optional [float ] = None ,
136136 timestamp : Optional [Union [Timestamp , float ]] = None ,
137137 ) -> None :
@@ -156,7 +156,7 @@ class GaugeMetricFamily(Metric):
156156 def __init__ (self ,
157157 name : str ,
158158 documentation : str ,
159- value : Optional [Union [ int , float ] ] = None ,
159+ value : Optional [float ] = None ,
160160 labels : Optional [Sequence [str ]] = None ,
161161 unit : str = '' ,
162162 ):
@@ -169,7 +169,7 @@ def __init__(self,
169169 if value is not None :
170170 self .add_metric ([], value )
171171
172- def add_metric (self , labels : Sequence [str ], value : Union [ int , float ] , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
172+ def add_metric (self , labels : Sequence [str ], value : float , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
173173 """Add a metric to the metric family.
174174
175175 Args:
@@ -189,7 +189,7 @@ def __init__(self,
189189 name : str ,
190190 documentation : str ,
191191 count_value : Optional [int ] = None ,
192- sum_value : Optional [Union [ int , float ] ] = None ,
192+ sum_value : Optional [float ] = None ,
193193 labels : Optional [Sequence [str ]] = None ,
194194 unit : str = '' ,
195195 ):
@@ -208,7 +208,7 @@ def __init__(self,
208208 def add_metric (self ,
209209 labels : Sequence [str ],
210210 count_value : int ,
211- sum_value : Union [ int , float ] ,
211+ sum_value : float ,
212212 timestamp :
213213 Optional [Union [float , Timestamp ]] = None
214214 ) -> None :
@@ -233,7 +233,7 @@ def __init__(self,
233233 name : str ,
234234 documentation : str ,
235235 buckets : Optional [Sequence [Union [Tuple [str , float ], Tuple [str , float , Exemplar ]]]] = None ,
236- sum_value : Optional [Union [ int , float ] ] = None ,
236+ sum_value : Optional [float ] = None ,
237237 labels : Optional [Sequence [str ]] = None ,
238238 unit : str = '' ,
239239 ):
@@ -251,7 +251,7 @@ def __init__(self,
251251 def add_metric (self ,
252252 labels : Sequence [str ],
253253 buckets : Sequence [Union [Tuple [str , float ], Tuple [str , float , Exemplar ]]],
254- sum_value : Optional [Union [ int , float ] ],
254+ sum_value : Optional [float ],
255255 timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
256256 """Add a metric to the metric family.
257257
@@ -295,7 +295,7 @@ def __init__(self,
295295 name : str ,
296296 documentation : str ,
297297 buckets : Optional [Sequence [Tuple [str , float ]]] = None ,
298- gsum_value : Optional [Union [ int , float ] ] = None ,
298+ gsum_value : Optional [float ] = None ,
299299 labels : Optional [Sequence [str ]] = None ,
300300 unit : str = '' ,
301301 ):
@@ -311,7 +311,7 @@ def __init__(self,
311311 def add_metric (self ,
312312 labels : Sequence [str ],
313313 buckets : Sequence [Tuple [str , float ]],
314- gsum_value : Optional [Union [ int , float ] ],
314+ gsum_value : Optional [float ],
315315 timestamp : Optional [Union [float , Timestamp ]] = None ,
316316 ) -> None :
317317 """Add a metric to the metric family.
0 commit comments