Skip to content

Commit a7b9d02

Browse files
jmacdMrAliasevantorrieAneurysm9
authored
Rename metric instruments to match feature-freeze API specification (#2202)
* s/ValueRecorder/Histogram/g * s/ValueObserver/GaugeObserver/g * s/UpDownSumObserver/UpDownCounterObserver/g * s/SumObserver/CounterObserver/g * changelog * pr num * unstable->experimental * Apply suggestions from code review Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> * Apply suggestions from code review * apply feedback from @evantorrie by hand * Apply suggestions from code review Thanks Co-authored-by: ET <evantorrie@users.noreply.github.com> * Update sdk/export/metric/metric.go * Apply suggestions from code review Thank you @evantorrie ! Co-authored-by: ET <evantorrie@users.noreply.github.com> * revert getting-started fix let tyler's update remove this text * more variable name fixes * test repair Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: ET <evantorrie@users.noreply.github.com> Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
1 parent 1f527a5 commit a7b9d02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+548
-542
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1717

1818
### Changed
1919

20+
- Metric instruments have been renamed to match the (feature-frozen) metric API specification:
21+
- ValueRecorder becomes Histogram
22+
- ValueObserver becomes Gauge
23+
- SumObserver becomes CounterObserver
24+
- UpDownSumObserver becomes UpDownCounterObserver
25+
The API exported from this project is still considered experimental. (#2202)
2026
- Metric SDK/API implementation type `InstrumentKind` moves into `sdkapi` sub-package. (#2091)
2127
- The Metrics SDK export record no longer contains a Resource pointer, the SDK `"go.opentelemetry.io/otel/sdk/trace/export/metric".Exporter.Export()` function for push-based exporters now takes a single Resource argument, pull-based exporters use `"go.opentelemetry.io/otel/sdk/metric/controller/basic".Controller.Resource()`. (#2120)
2228
- The JSON output of the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` is harmonized now such that the output is "plain" JSON objects after each other of the form `{ ... } { ... } { ... }`. Earlier the JSON objects describing a span were wrapped in a slice for each `Exporter.ExportSpans` call, like `[ { ... } ][ { ... } { ... } ]`. Outputting JSON object directly after each other is consistent with JSON loggers, and a bit easier to parse and read. (#2196)

bridge/opencensus/exporter.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ func convertDescriptor(ocDescriptor metricdata.Descriptor) (metric.Descriptor, e
142142
switch ocDescriptor.Type {
143143
case metricdata.TypeGaugeInt64:
144144
nkind = number.Int64Kind
145-
ikind = sdkapi.ValueObserverInstrumentKind
145+
ikind = sdkapi.GaugeObserverInstrumentKind
146146
case metricdata.TypeGaugeFloat64:
147147
nkind = number.Float64Kind
148-
ikind = sdkapi.ValueObserverInstrumentKind
148+
ikind = sdkapi.GaugeObserverInstrumentKind
149149
case metricdata.TypeCumulativeInt64:
150150
nkind = number.Int64Kind
151-
ikind = sdkapi.SumObserverInstrumentKind
151+
ikind = sdkapi.CounterObserverInstrumentKind
152152
case metricdata.TypeCumulativeFloat64:
153153
nkind = number.Float64Kind
154-
ikind = sdkapi.SumObserverInstrumentKind
154+
ikind = sdkapi.CounterObserverInstrumentKind
155155
default:
156156
// Includes TypeGaugeDistribution, TypeCumulativeDistribution, TypeSummary
157157
return metric.Descriptor{}, fmt.Errorf("%w; descriptor type: %v", errConversion, ocDescriptor.Type)

bridge/opencensus/exporter_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestExportMetrics(t *testing.T) {
7373
now := time.Now()
7474
basicDesc := metric.NewDescriptor(
7575
"",
76-
sdkapi.ValueObserverInstrumentKind,
76+
sdkapi.GaugeObserverInstrumentKind,
7777
number.Int64Kind,
7878
metric.WithInstrumentationName("OpenCensus Bridge"),
7979
)
@@ -395,7 +395,7 @@ func TestConvertDescriptor(t *testing.T) {
395395
desc: "empty descriptor",
396396
expected: metric.NewDescriptor(
397397
"",
398-
sdkapi.ValueObserverInstrumentKind,
398+
sdkapi.GaugeObserverInstrumentKind,
399399
number.Int64Kind,
400400
metric.WithInstrumentationName("OpenCensus Bridge"),
401401
),
@@ -410,7 +410,7 @@ func TestConvertDescriptor(t *testing.T) {
410410
},
411411
expected: metric.NewDescriptor(
412412
"foo",
413-
sdkapi.ValueObserverInstrumentKind,
413+
sdkapi.GaugeObserverInstrumentKind,
414414
number.Int64Kind,
415415
metric.WithInstrumentationName("OpenCensus Bridge"),
416416
metric.WithDescription("bar"),
@@ -427,7 +427,7 @@ func TestConvertDescriptor(t *testing.T) {
427427
},
428428
expected: metric.NewDescriptor(
429429
"foo",
430-
sdkapi.ValueObserverInstrumentKind,
430+
sdkapi.GaugeObserverInstrumentKind,
431431
number.Float64Kind,
432432
metric.WithInstrumentationName("OpenCensus Bridge"),
433433
metric.WithDescription("bar"),
@@ -444,7 +444,7 @@ func TestConvertDescriptor(t *testing.T) {
444444
},
445445
expected: metric.NewDescriptor(
446446
"foo",
447-
sdkapi.SumObserverInstrumentKind,
447+
sdkapi.CounterObserverInstrumentKind,
448448
number.Int64Kind,
449449
metric.WithInstrumentationName("OpenCensus Bridge"),
450450
metric.WithDescription("bar"),
@@ -461,7 +461,7 @@ func TestConvertDescriptor(t *testing.T) {
461461
},
462462
expected: metric.NewDescriptor(
463463
"foo",
464-
sdkapi.SumObserverInstrumentKind,
464+
sdkapi.CounterObserverInstrumentKind,
465465
number.Float64Kind,
466466
metric.WithInstrumentationName("OpenCensus Bridge"),
467467
metric.WithDescription("bar"),

example/prometheus/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ func main() {
7676
(*observerLock).RUnlock()
7777
result.Observe(value, labels...)
7878
}
79-
_ = metric.Must(meter).NewFloat64ValueObserver("ex.com.one", cb,
80-
metric.WithDescription("A ValueObserver set to 1.0"),
79+
_ = metric.Must(meter).NewFloat64GaugeObserver("ex.com.one", cb,
80+
metric.WithDescription("A GaugeObserver set to 1.0"),
8181
)
8282

83-
valuerecorder := metric.Must(meter).NewFloat64ValueRecorder("ex.com.two")
83+
histogram := metric.Must(meter).NewFloat64Histogram("ex.com.two")
8484
counter := metric.Must(meter).NewFloat64Counter("ex.com.three")
8585

8686
commonLabels := []attribute.KeyValue{lemonsKey.Int(10), attribute.String("A", "1"), attribute.String("B", "2"), attribute.String("C", "3")}
@@ -95,7 +95,7 @@ func main() {
9595
meter.RecordBatch(
9696
ctx,
9797
commonLabels,
98-
valuerecorder.Measurement(2.0),
98+
histogram.Measurement(2.0),
9999
counter.Measurement(12.0),
100100
)
101101

@@ -108,7 +108,7 @@ func main() {
108108
meter.RecordBatch(
109109
ctx,
110110
notSoCommonLabels,
111-
valuerecorder.Measurement(2.0),
111+
histogram.Measurement(2.0),
112112
counter.Measurement(22.0),
113113
)
114114

@@ -121,7 +121,7 @@ func main() {
121121
meter.RecordBatch(
122122
ctx,
123123
commonLabels,
124-
valuerecorder.Measurement(12.0),
124+
histogram.Measurement(12.0),
125125
counter.Measurement(13.0),
126126
)
127127

exporters/otlp/otlpmetric/exporter_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ func TestNoGroupingExport(t *testing.T) {
212212
)
213213
}
214214

215-
func TestValuerecorderMetricGroupingExport(t *testing.T) {
215+
func TestHistogramMetricGroupingExport(t *testing.T) {
216216
r := record{
217-
"valuerecorder",
218-
sdkapi.ValueRecorderInstrumentKind,
217+
"histogram",
218+
sdkapi.HistogramInstrumentKind,
219219
number.Int64Kind,
220220
nil,
221221
append(baseKeyValues, cpuKey.Int(1)),
@@ -227,7 +227,7 @@ func TestValuerecorderMetricGroupingExport(t *testing.T) {
227227
{
228228
Metrics: []*metricpb.Metric{
229229
{
230-
Name: "valuerecorder",
230+
Name: "histogram",
231231
Data: &metricpb.Metric_Histogram{
232232
Histogram: &metricpb.Histogram{
233233
AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE,
@@ -606,8 +606,8 @@ func TestStatelessExportKind(t *testing.T) {
606606
for _, k := range []testcase{
607607
{"counter", sdkapi.CounterInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA, true},
608608
{"updowncounter", sdkapi.UpDownCounterInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA, false},
609-
{"sumobserver", sdkapi.SumObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, true},
610-
{"updownsumobserver", sdkapi.UpDownSumObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, false},
609+
{"counterobserver", sdkapi.CounterObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, true},
610+
{"updowncounterobserver", sdkapi.UpDownCounterObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, false},
611611
} {
612612
t.Run(k.name, func(t *testing.T) {
613613
runMetricExportTests(

exporters/otlp/otlpmetric/internal/metrictransform/metric_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestMinMaxSumCountValue(t *testing.T) {
122122
}
123123

124124
func TestMinMaxSumCountDatapoints(t *testing.T) {
125-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Int64Kind)
125+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Int64Kind)
126126
labels := attribute.NewSet(attribute.String("one", "1"))
127127
mmscs := minmaxsumcount.New(2, &metric.Descriptor{})
128128
mmsc, ckpt := &mmscs[0], &mmscs[1]
@@ -178,7 +178,7 @@ func TestMinMaxSumCountPropagatesErrors(t *testing.T) {
178178
}
179179

180180
func TestSumIntDataPoints(t *testing.T) {
181-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Int64Kind)
181+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Int64Kind)
182182
labels := attribute.NewSet(attribute.String("one", "1"))
183183
sums := sumAgg.New(2)
184184
s, ckpt := &sums[0], &sums[1]
@@ -218,7 +218,7 @@ func TestSumIntDataPoints(t *testing.T) {
218218
}
219219

220220
func TestSumFloatDataPoints(t *testing.T) {
221-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Float64Kind)
221+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Float64Kind)
222222
labels := attribute.NewSet(attribute.String("one", "1"))
223223
sums := sumAgg.New(2)
224224
s, ckpt := &sums[0], &sums[1]
@@ -256,7 +256,7 @@ func TestSumFloatDataPoints(t *testing.T) {
256256
}
257257

258258
func TestLastValueIntDataPoints(t *testing.T) {
259-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Int64Kind)
259+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Int64Kind)
260260
labels := attribute.NewSet(attribute.String("one", "1"))
261261
lvs := lvAgg.New(2)
262262
lv, ckpt := &lvs[0], &lvs[1]
@@ -291,7 +291,7 @@ func TestLastValueIntDataPoints(t *testing.T) {
291291
}
292292

293293
func TestExactIntDataPoints(t *testing.T) {
294-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Int64Kind)
294+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Int64Kind)
295295
labels := attribute.NewSet(attribute.String("one", "1"))
296296
arrs := arrAgg.New(2)
297297
e, ckpt := &arrs[0], &arrs[1]
@@ -326,7 +326,7 @@ func TestExactIntDataPoints(t *testing.T) {
326326
}
327327

328328
func TestExactFloatDataPoints(t *testing.T) {
329-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Float64Kind)
329+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Float64Kind)
330330
labels := attribute.NewSet(attribute.String("one", "1"))
331331
arrs := arrAgg.New(2)
332332
e, ckpt := &arrs[0], &arrs[1]
@@ -360,7 +360,7 @@ func TestExactFloatDataPoints(t *testing.T) {
360360
}
361361

362362
func TestSumErrUnknownValueType(t *testing.T) {
363-
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Kind(-1))
363+
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Kind(-1))
364364
labels := attribute.NewSet()
365365
s := &sumAgg.New(1)[0]
366366
record := export.NewRecord(&desc, &labels, s, intervalStart, intervalEnd)

exporters/otlp/otlpmetric/internal/otlpmetrictest/otlptest.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
5555
instruments := map[string]data{
5656
"test-int64-counter": {sdkapi.CounterInstrumentKind, number.Int64Kind, 1},
5757
"test-float64-counter": {sdkapi.CounterInstrumentKind, number.Float64Kind, 1},
58-
"test-int64-valuerecorder": {sdkapi.ValueRecorderInstrumentKind, number.Int64Kind, 2},
59-
"test-float64-valuerecorder": {sdkapi.ValueRecorderInstrumentKind, number.Float64Kind, 2},
60-
"test-int64-valueobserver": {sdkapi.ValueObserverInstrumentKind, number.Int64Kind, 3},
61-
"test-float64-valueobserver": {sdkapi.ValueObserverInstrumentKind, number.Float64Kind, 3},
58+
"test-int64-histogram": {sdkapi.HistogramInstrumentKind, number.Int64Kind, 2},
59+
"test-float64-histogram": {sdkapi.HistogramInstrumentKind, number.Float64Kind, 2},
60+
"test-int64-gaugeobserver": {sdkapi.GaugeObserverInstrumentKind, number.Int64Kind, 3},
61+
"test-float64-gaugeobserver": {sdkapi.GaugeObserverInstrumentKind, number.Float64Kind, 3},
6262
}
6363
for name, data := range instruments {
6464
data := data
@@ -72,19 +72,19 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
7272
default:
7373
assert.Failf(t, "unsupported number testing kind", data.nKind.String())
7474
}
75-
case sdkapi.ValueRecorderInstrumentKind:
75+
case sdkapi.HistogramInstrumentKind:
7676
switch data.nKind {
7777
case number.Int64Kind:
78-
metric.Must(meter).NewInt64ValueRecorder(name).Record(ctx, data.val, labels...)
78+
metric.Must(meter).NewInt64Histogram(name).Record(ctx, data.val, labels...)
7979
case number.Float64Kind:
80-
metric.Must(meter).NewFloat64ValueRecorder(name).Record(ctx, float64(data.val), labels...)
80+
metric.Must(meter).NewFloat64Histogram(name).Record(ctx, float64(data.val), labels...)
8181
default:
8282
assert.Failf(t, "unsupported number testing kind", data.nKind.String())
8383
}
84-
case sdkapi.ValueObserverInstrumentKind:
84+
case sdkapi.GaugeObserverInstrumentKind:
8585
switch data.nKind {
8686
case number.Int64Kind:
87-
metric.Must(meter).NewInt64ValueObserver(name,
87+
metric.Must(meter).NewInt64GaugeObserver(name,
8888
func(_ context.Context, result metric.Int64ObserverResult) {
8989
result.Observe(data.val, labels...)
9090
},
@@ -93,7 +93,7 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
9393
callback := func(v float64) metric.Float64ObserverFunc {
9494
return metric.Float64ObserverFunc(func(_ context.Context, result metric.Float64ObserverResult) { result.Observe(v, labels...) })
9595
}(float64(data.val))
96-
metric.Must(meter).NewFloat64ValueObserver(name, callback)
96+
metric.Must(meter).NewFloat64GaugeObserver(name, callback)
9797
default:
9898
assert.Failf(t, "unsupported number testing kind", data.nKind.String())
9999
}
@@ -131,13 +131,13 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
131131
seen[m.Name] = struct{}{}
132132

133133
switch data.iKind {
134-
case sdkapi.CounterInstrumentKind, sdkapi.ValueObserverInstrumentKind:
134+
case sdkapi.CounterInstrumentKind, sdkapi.GaugeObserverInstrumentKind:
135135
var dp []*metricpb.NumberDataPoint
136136
switch data.iKind {
137137
case sdkapi.CounterInstrumentKind:
138138
require.NotNil(t, m.GetSum())
139139
dp = m.GetSum().GetDataPoints()
140-
case sdkapi.ValueObserverInstrumentKind:
140+
case sdkapi.GaugeObserverInstrumentKind:
141141
require.NotNil(t, m.GetGauge())
142142
dp = m.GetGauge().GetDataPoints()
143143
}
@@ -151,7 +151,7 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
151151
assert.Equal(t, v, dp[0].Value, "invalid value for %q", m.Name)
152152
}
153153
}
154-
case sdkapi.ValueRecorderInstrumentKind:
154+
case sdkapi.HistogramInstrumentKind:
155155
require.NotNil(t, m.GetSummary())
156156
if dp := m.GetSummary().DataPoints; assert.Len(t, dp, 1) {
157157
count := dp[0].Count

exporters/prometheus/prometheus_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestPrometheusExporter(t *testing.T) {
109109
meter := exporter.MeterProvider().Meter("test")
110110
upDownCounter := metric.Must(meter).NewFloat64UpDownCounter("updowncounter")
111111
counter := metric.Must(meter).NewFloat64Counter("counter")
112-
valuerecorder := metric.Must(meter).NewFloat64ValueRecorder("valuerecorder")
112+
histogram := metric.Must(meter).NewFloat64Histogram("histogram")
113113

114114
labels := []attribute.KeyValue{
115115
attribute.Key("A").String("B"),
@@ -124,23 +124,23 @@ func TestPrometheusExporter(t *testing.T) {
124124

125125
expected = append(expected, expectCounter("counter", `counter{A="B",C="D",R="V"} 15.3`))
126126

127-
_ = metric.Must(meter).NewInt64ValueObserver("intobserver", func(_ context.Context, result metric.Int64ObserverResult) {
127+
_ = metric.Must(meter).NewInt64GaugeObserver("intobserver", func(_ context.Context, result metric.Int64ObserverResult) {
128128
result.Observe(1, labels...)
129129
})
130130

131131
expected = append(expected, expectGauge("intobserver", `intobserver{A="B",C="D",R="V"} 1`))
132132

133-
valuerecorder.Record(ctx, -0.6, labels...)
134-
valuerecorder.Record(ctx, -0.4, labels...)
135-
valuerecorder.Record(ctx, 0.6, labels...)
136-
valuerecorder.Record(ctx, 20, labels...)
137-
138-
expected = append(expected, expectHistogram("valuerecorder",
139-
`valuerecorder_bucket{A="B",C="D",R="V",le="-0.5"} 1`,
140-
`valuerecorder_bucket{A="B",C="D",R="V",le="1"} 3`,
141-
`valuerecorder_bucket{A="B",C="D",R="V",le="+Inf"} 4`,
142-
`valuerecorder_sum{A="B",C="D",R="V"} 19.6`,
143-
`valuerecorder_count{A="B",C="D",R="V"} 4`,
133+
histogram.Record(ctx, -0.6, labels...)
134+
histogram.Record(ctx, -0.4, labels...)
135+
histogram.Record(ctx, 0.6, labels...)
136+
histogram.Record(ctx, 20, labels...)
137+
138+
expected = append(expected, expectHistogram("histogram",
139+
`histogram_bucket{A="B",C="D",R="V",le="-0.5"} 1`,
140+
`histogram_bucket{A="B",C="D",R="V",le="1"} 3`,
141+
`histogram_bucket{A="B",C="D",R="V",le="+Inf"} 4`,
142+
`histogram_sum{A="B",C="D",R="V"} 19.6`,
143+
`histogram_count{A="B",C="D",R="V"} 4`,
144144
))
145145

146146
upDownCounter.Add(ctx, 10, labels...)

exporters/stdout/stdoutmetric/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var (
4040
)
4141

4242
loopCounter = metric.Must(meter).NewInt64Counter("function.loops")
43-
paramValue = metric.Must(meter).NewInt64ValueRecorder("function.param")
43+
paramValue = metric.Must(meter).NewInt64Histogram("function.param")
4444

4545
nameKey = attribute.Key("function.name")
4646
)

exporters/stdout/stdoutmetric/metric_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ func TestStdoutMinMaxSumCount(t *testing.T) {
169169
require.Equal(t, `[{"Name":"name.minmaxsumcount{R=V,instrumentation.name=test,A=B,C=D}","Min":123.456,"Max":876.543,"Sum":999.999,"Count":2}]`, fix.Output())
170170
}
171171

172-
func TestStdoutValueRecorderFormat(t *testing.T) {
172+
func TestStdoutHistogramFormat(t *testing.T) {
173173
fix := newFixture(t, stdoutmetric.WithPrettyPrint())
174174

175-
inst := metric.Must(fix.meter).NewFloat64ValueRecorder("name.histogram")
175+
inst := metric.Must(fix.meter).NewFloat64Histogram("name.histogram")
176176

177177
for i := 0; i < 1000; i++ {
178178
inst.Record(fix.ctx, float64(i)+0.5, attribute.String("A", "B"), attribute.String("C", "D"))

0 commit comments

Comments
 (0)