@@ -82,9 +82,11 @@ Example input from stdin:
82
82
Note that all numbers are encoded as strings. Some parsers want it
83
83
that way. Also, Prometheus allows sample values like ` NaN ` or ` +Inf ` ,
84
84
which cannot be encoded as JSON numbers.
85
- Native histograms are formated similarly as [ the query
86
- API] ( https://prometheus.io/docs/prometheus/latest/querying/api/#native-histograms )
87
- would return.
85
+
86
+ A histogram is formatted as a native histogram if it has at least one span. It
87
+ is then formatted in a similar way as [ the Prometehus query
88
+ API] ( https://prometheus.io/docs/prometheus/latest/querying/api/#native-histograms )
89
+ does it.
88
90
89
91
``` json
90
92
[
@@ -136,7 +138,7 @@ would return.
136
138
{
137
139
"name" : " http_request_duration_seconds" ,
138
140
"type" : " HISTOGRAM" ,
139
- "help" : " More HTTP request latencies in seconds ." ,
141
+ "help" : " This is a native histogram ." ,
140
142
"metrics" : [
141
143
{
142
144
"labels" : {
@@ -166,6 +168,39 @@ would return.
166
168
"sum" : " 29969.50000000001"
167
169
}
168
170
]
171
+ },
172
+ {
173
+ "name" : " some_weird_normal_distribution" ,
174
+ "type" : " HISTOGRAM" ,
175
+ "help" : " This is a classic histogram." ,
176
+ "metrics" : [
177
+ {
178
+ "buckets" : {
179
+ "-0.0001899999999999998" : " 17" ,
180
+ "-0.0002899999999999998" : " 6" ,
181
+ "-0.0003899999999999998" : " 2" ,
182
+ "-0.0004899999999999998" : " 2" ,
183
+ "-0.0005899999999999998" : " 0" ,
184
+ "-0.0006899999999999999" : " 0" ,
185
+ "-0.0007899999999999999" : " 0" ,
186
+ "-0.00089" : " 0" ,
187
+ "-0.00099" : " 0" ,
188
+ "-8.999999999999979e-05" : " 33" ,
189
+ "0.00011000000000000022" : " 75" ,
190
+ "0.00021000000000000023" : " 92" ,
191
+ "0.0003100000000000002" : " 100" ,
192
+ "0.0004100000000000002" : " 103" ,
193
+ "0.0005100000000000003" : " 105" ,
194
+ "0.0006100000000000003" : " 106" ,
195
+ "0.0007100000000000003" : " 107" ,
196
+ "0.0008100000000000004" : " 107" ,
197
+ "0.0009100000000000004" : " 107" ,
198
+ "1.0000000000000216e-05" : " 50"
199
+ },
200
+ "count" : " 107" ,
201
+ "sum" : " 0.001792103516591124"
202
+ }
203
+ ]
169
204
}
170
205
]
171
206
```
0 commit comments