NewHistogram creates a new Histogram based on the provided HistogramOpts. It panics if the buckets in HistogramOpts are not in strictly increasing order. The returned implementation also implements ExemplarObserver. It is safe to perform the corresponding type assertion. Exemplars are tracked separ
(opts HistogramOpts)
| 521 | // perform the corresponding type assertion. Exemplars are tracked separately |
| 522 | // for each bucket. |
| 523 | func NewHistogram(opts HistogramOpts) Histogram { |
| 524 | return newHistogram( |
| 525 | NewDesc( |
| 526 | BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), |
| 527 | opts.Help, |
| 528 | nil, |
| 529 | opts.ConstLabels, |
| 530 | ), |
| 531 | opts, |
| 532 | ) |
| 533 | } |
| 534 | |
| 535 | func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogram { |
| 536 | if len(desc.variableLabels.names) != len(labelValues) { |