@@ -38,7 +38,7 @@ class NumberDataPoint:
38
38
value : Union [int , float ]
39
39
exemplars : Sequence [Exemplar ] = field (default_factory = list )
40
40
41
- def to_json (self , indent = 4 ) -> str :
41
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
42
42
return dumps (asdict (self ), indent = indent )
43
43
44
44
@@ -59,7 +59,7 @@ class HistogramDataPoint:
59
59
max : float
60
60
exemplars : Sequence [Exemplar ] = field (default_factory = list )
61
61
62
- def to_json (self , indent = 4 ) -> str :
62
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
63
63
return dumps (asdict (self ), indent = indent )
64
64
65
65
@@ -90,7 +90,7 @@ class ExponentialHistogramDataPoint:
90
90
max : float
91
91
exemplars : Sequence [Exemplar ] = field (default_factory = list )
92
92
93
- def to_json (self , indent = 4 ) -> str :
93
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
94
94
return dumps (asdict (self ), indent = indent )
95
95
96
96
@@ -105,7 +105,7 @@ class ExponentialHistogram:
105
105
"opentelemetry.sdk.metrics.export.AggregationTemporality"
106
106
)
107
107
108
- def to_json (self , indent = 4 ) -> str :
108
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
109
109
return dumps (
110
110
{
111
111
"data_points" : [
@@ -129,7 +129,7 @@ class Sum:
129
129
)
130
130
is_monotonic : bool
131
131
132
- def to_json (self , indent = 4 ) -> str :
132
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
133
133
return dumps (
134
134
{
135
135
"data_points" : [
@@ -151,7 +151,7 @@ class Gauge:
151
151
152
152
data_points : Sequence [NumberDataPoint ]
153
153
154
- def to_json (self , indent = 4 ) -> str :
154
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
155
155
return dumps (
156
156
{
157
157
"data_points" : [
@@ -173,7 +173,7 @@ class Histogram:
173
173
"opentelemetry.sdk.metrics.export.AggregationTemporality"
174
174
)
175
175
176
- def to_json (self , indent = 4 ) -> str :
176
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
177
177
return dumps (
178
178
{
179
179
"data_points" : [
@@ -203,7 +203,7 @@ class Metric:
203
203
unit : Optional [str ]
204
204
data : DataT
205
205
206
- def to_json (self , indent = 4 ) -> str :
206
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
207
207
return dumps (
208
208
{
209
209
"name" : self .name ,
@@ -223,7 +223,7 @@ class ScopeMetrics:
223
223
metrics : Sequence [Metric ]
224
224
schema_url : str
225
225
226
- def to_json (self , indent = 4 ) -> str :
226
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
227
227
return dumps (
228
228
{
229
229
"scope" : loads (self .scope .to_json (indent = indent )),
@@ -245,7 +245,7 @@ class ResourceMetrics:
245
245
scope_metrics : Sequence [ScopeMetrics ]
246
246
schema_url : str
247
247
248
- def to_json (self , indent = 4 ) -> str :
248
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
249
249
return dumps (
250
250
{
251
251
"resource" : loads (self .resource .to_json (indent = indent )),
@@ -265,7 +265,7 @@ class MetricsData:
265
265
266
266
resource_metrics : Sequence [ResourceMetrics ]
267
267
268
- def to_json (self , indent = 4 ) -> str :
268
+ def to_json (self , indent : Optional [ int ] = 4 ) -> str :
269
269
return dumps (
270
270
{
271
271
"resource_metrics" : [
0 commit comments