175
func (m *otelProvider) Stop(log.Logger) {}
176
177
>
func (s Snapshot) getValue(name string, metricType dto.MetricType, tags ...metrics.Tag) (float64, error) {
metricstest.go
178
>
labelValues := map[string]string{}
179
>
for _, tag := range tags {
180
>
labelValues[tag.Key] = tag.Value
181
>
}
182
>
sample, ok := s.samples[name]
183
>
if !ok {
184
return 0, fmt.Errorf("%w: %q", ErrMetricNotFound, name)
185
}
187
return 0, fmt.Errorf("%w: %q is a %s, not a %s", ErrMetricTypeMismatch, name, sample.metricType, metricType)
188
}
189
>
if !maps.Equal(sample.labelValues, labelValues) {
metricstest.go
190
return 0, fmt.Errorf("%w: %q has %v, asked for %v", ErrMetricLabelMismatch, name, sample.labelValues, labelValues)
191
}
193
}
194