Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename metric instruments to match feature-freeze API specification #2202

Merged
merged 18 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed

- Metric instruments have been renamed to match the (stable) metric API speciication:
jmacd marked this conversation as resolved.
Show resolved Hide resolved
- ValueRecorder becomes Histogram
- ValueObserver becomes Gauge
- SumObserver becomes CounterObserver
- UpDownSumObserver becomes UpDownCounterObserver
The API is still considered experimental. (#2202)
jmacd marked this conversation as resolved.
Show resolved Hide resolved
- Metric SDK/API implementation type `InstrumentKind` moves into `sdkapi` sub-package. (#2091)
- 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)
- 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)
Expand Down
8 changes: 4 additions & 4 deletions bridge/opencensus/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ func convertDescriptor(ocDescriptor metricdata.Descriptor) (metric.Descriptor, e
switch ocDescriptor.Type {
case metricdata.TypeGaugeInt64:
nkind = number.Int64Kind
ikind = sdkapi.ValueObserverInstrumentKind
ikind = sdkapi.GaugeObserverInstrumentKind
case metricdata.TypeGaugeFloat64:
nkind = number.Float64Kind
ikind = sdkapi.ValueObserverInstrumentKind
ikind = sdkapi.GaugeObserverInstrumentKind
case metricdata.TypeCumulativeInt64:
nkind = number.Int64Kind
ikind = sdkapi.SumObserverInstrumentKind
ikind = sdkapi.CounterObserverInstrumentKind
case metricdata.TypeCumulativeFloat64:
nkind = number.Float64Kind
ikind = sdkapi.SumObserverInstrumentKind
ikind = sdkapi.CounterObserverInstrumentKind
default:
// Includes TypeGaugeDistribution, TypeCumulativeDistribution, TypeSummary
return metric.Descriptor{}, fmt.Errorf("%w; descriptor type: %v", errConversion, ocDescriptor.Type)
Expand Down
12 changes: 6 additions & 6 deletions bridge/opencensus/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestExportMetrics(t *testing.T) {
now := time.Now()
basicDesc := metric.NewDescriptor(
"",
sdkapi.ValueObserverInstrumentKind,
sdkapi.GaugeObserverInstrumentKind,
number.Int64Kind,
metric.WithInstrumentationName("OpenCensus Bridge"),
)
Expand Down Expand Up @@ -395,7 +395,7 @@ func TestConvertDescriptor(t *testing.T) {
desc: "empty descriptor",
expected: metric.NewDescriptor(
"",
sdkapi.ValueObserverInstrumentKind,
sdkapi.GaugeObserverInstrumentKind,
number.Int64Kind,
metric.WithInstrumentationName("OpenCensus Bridge"),
),
Expand All @@ -410,7 +410,7 @@ func TestConvertDescriptor(t *testing.T) {
},
expected: metric.NewDescriptor(
"foo",
sdkapi.ValueObserverInstrumentKind,
sdkapi.GaugeObserverInstrumentKind,
number.Int64Kind,
metric.WithInstrumentationName("OpenCensus Bridge"),
metric.WithDescription("bar"),
Expand All @@ -427,7 +427,7 @@ func TestConvertDescriptor(t *testing.T) {
},
expected: metric.NewDescriptor(
"foo",
sdkapi.ValueObserverInstrumentKind,
sdkapi.GaugeObserverInstrumentKind,
number.Float64Kind,
metric.WithInstrumentationName("OpenCensus Bridge"),
metric.WithDescription("bar"),
Expand All @@ -444,7 +444,7 @@ func TestConvertDescriptor(t *testing.T) {
},
expected: metric.NewDescriptor(
"foo",
sdkapi.SumObserverInstrumentKind,
sdkapi.CounterObserverInstrumentKind,
number.Int64Kind,
metric.WithInstrumentationName("OpenCensus Bridge"),
metric.WithDescription("bar"),
Expand All @@ -461,7 +461,7 @@ func TestConvertDescriptor(t *testing.T) {
},
expected: metric.NewDescriptor(
"foo",
sdkapi.SumObserverInstrumentKind,
sdkapi.CounterObserverInstrumentKind,
number.Float64Kind,
metric.WithInstrumentationName("OpenCensus Bridge"),
metric.WithDescription("bar"),
Expand Down
6 changes: 3 additions & 3 deletions example/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ func main() {
(*observerLock).RUnlock()
result.Observe(value, labels...)
}
_ = metric.Must(meter).NewFloat64ValueObserver("ex.com.one", cb,
metric.WithDescription("A ValueObserver set to 1.0"),
_ = metric.Must(meter).NewFloat64GaugeObserver("ex.com.one", cb,
metric.WithDescription("A GaugeObserver set to 1.0"),
)

valuerecorder := metric.Must(meter).NewFloat64ValueRecorder("ex.com.two")
valuerecorder := metric.Must(meter).NewFloat64Histogram("ex.com.two")
jmacd marked this conversation as resolved.
Show resolved Hide resolved
counter := metric.Must(meter).NewFloat64Counter("ex.com.three")

commonLabels := []attribute.KeyValue{lemonsKey.Int(10), attribute.String("A", "1"), attribute.String("B", "2"), attribute.String("C", "3")}
Expand Down
6 changes: 3 additions & 3 deletions exporters/otlp/otlpmetric/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func TestNoGroupingExport(t *testing.T) {
func TestValuerecorderMetricGroupingExport(t *testing.T) {
r := record{
"valuerecorder",
jmacd marked this conversation as resolved.
Show resolved Hide resolved
sdkapi.ValueRecorderInstrumentKind,
sdkapi.HistogramInstrumentKind,
number.Int64Kind,
nil,
append(baseKeyValues, cpuKey.Int(1)),
Expand Down Expand Up @@ -606,8 +606,8 @@ func TestStatelessExportKind(t *testing.T) {
for _, k := range []testcase{
{"counter", sdkapi.CounterInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA, true},
{"updowncounter", sdkapi.UpDownCounterInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA, false},
{"sumobserver", sdkapi.SumObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, true},
{"updownsumobserver", sdkapi.UpDownSumObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, false},
{"sumobserver", sdkapi.CounterObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, true},
jmacd marked this conversation as resolved.
Show resolved Hide resolved
{"updownsumobserver", sdkapi.UpDownCounterObserverInstrumentKind, metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, false},
jmacd marked this conversation as resolved.
Show resolved Hide resolved
} {
t.Run(k.name, func(t *testing.T) {
runMetricExportTests(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestMinMaxSumCountValue(t *testing.T) {
}

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

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

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

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

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

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

func TestSumErrUnknownValueType(t *testing.T) {
desc := metric.NewDescriptor("", sdkapi.ValueRecorderInstrumentKind, number.Kind(-1))
desc := metric.NewDescriptor("", sdkapi.HistogramInstrumentKind, number.Kind(-1))
labels := attribute.NewSet()
s := &sumAgg.New(1)[0]
record := export.NewRecord(&desc, &labels, s, intervalStart, intervalEnd)
Expand Down
26 changes: 13 additions & 13 deletions exporters/otlp/otlpmetric/internal/otlpmetrictest/otlptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
instruments := map[string]data{
"test-int64-counter": {sdkapi.CounterInstrumentKind, number.Int64Kind, 1},
"test-float64-counter": {sdkapi.CounterInstrumentKind, number.Float64Kind, 1},
"test-int64-valuerecorder": {sdkapi.ValueRecorderInstrumentKind, number.Int64Kind, 2},
"test-float64-valuerecorder": {sdkapi.ValueRecorderInstrumentKind, number.Float64Kind, 2},
"test-int64-valueobserver": {sdkapi.ValueObserverInstrumentKind, number.Int64Kind, 3},
"test-float64-valueobserver": {sdkapi.ValueObserverInstrumentKind, number.Float64Kind, 3},
"test-int64-valuerecorder": {sdkapi.HistogramInstrumentKind, number.Int64Kind, 2},
"test-float64-valuerecorder": {sdkapi.HistogramInstrumentKind, number.Float64Kind, 2},
"test-int64-valueobserver": {sdkapi.GaugeObserverInstrumentKind, number.Int64Kind, 3},
"test-float64-valueobserver": {sdkapi.GaugeObserverInstrumentKind, number.Float64Kind, 3},
jmacd marked this conversation as resolved.
Show resolved Hide resolved
}
for name, data := range instruments {
data := data
Expand All @@ -72,19 +72,19 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
default:
assert.Failf(t, "unsupported number testing kind", data.nKind.String())
}
case sdkapi.ValueRecorderInstrumentKind:
case sdkapi.HistogramInstrumentKind:
switch data.nKind {
case number.Int64Kind:
metric.Must(meter).NewInt64ValueRecorder(name).Record(ctx, data.val, labels...)
metric.Must(meter).NewInt64Histogram(name).Record(ctx, data.val, labels...)
case number.Float64Kind:
metric.Must(meter).NewFloat64ValueRecorder(name).Record(ctx, float64(data.val), labels...)
metric.Must(meter).NewFloat64Histogram(name).Record(ctx, float64(data.val), labels...)
default:
assert.Failf(t, "unsupported number testing kind", data.nKind.String())
}
case sdkapi.ValueObserverInstrumentKind:
case sdkapi.GaugeObserverInstrumentKind:
switch data.nKind {
case number.Int64Kind:
metric.Must(meter).NewInt64ValueObserver(name,
metric.Must(meter).NewInt64GaugeObserver(name,
func(_ context.Context, result metric.Int64ObserverResult) {
result.Observe(data.val, labels...)
},
Expand All @@ -93,7 +93,7 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
callback := func(v float64) metric.Float64ObserverFunc {
return metric.Float64ObserverFunc(func(_ context.Context, result metric.Float64ObserverResult) { result.Observe(v, labels...) })
}(float64(data.val))
metric.Must(meter).NewFloat64ValueObserver(name, callback)
metric.Must(meter).NewFloat64GaugeObserver(name, callback)
default:
assert.Failf(t, "unsupported number testing kind", data.nKind.String())
}
Expand Down Expand Up @@ -131,13 +131,13 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
seen[m.Name] = struct{}{}

switch data.iKind {
case sdkapi.CounterInstrumentKind, sdkapi.ValueObserverInstrumentKind:
case sdkapi.CounterInstrumentKind, sdkapi.GaugeObserverInstrumentKind:
var dp []*metricpb.NumberDataPoint
switch data.iKind {
case sdkapi.CounterInstrumentKind:
require.NotNil(t, m.GetSum())
dp = m.GetSum().GetDataPoints()
case sdkapi.ValueObserverInstrumentKind:
case sdkapi.GaugeObserverInstrumentKind:
require.NotNil(t, m.GetGauge())
dp = m.GetGauge().GetDataPoints()
}
Expand All @@ -151,7 +151,7 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlpmetric.Exporter
assert.Equal(t, v, dp[0].Value, "invalid value for %q", m.Name)
}
}
case sdkapi.ValueRecorderInstrumentKind:
case sdkapi.HistogramInstrumentKind:
require.NotNil(t, m.GetSummary())
if dp := m.GetSummary().DataPoints; assert.Len(t, dp, 1) {
count := dp[0].Count
Expand Down
4 changes: 2 additions & 2 deletions exporters/prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestPrometheusExporter(t *testing.T) {
meter := exporter.MeterProvider().Meter("test")
upDownCounter := metric.Must(meter).NewFloat64UpDownCounter("updowncounter")
counter := metric.Must(meter).NewFloat64Counter("counter")
valuerecorder := metric.Must(meter).NewFloat64ValueRecorder("valuerecorder")
valuerecorder := metric.Must(meter).NewFloat64Histogram("valuerecorder")
jmacd marked this conversation as resolved.
Show resolved Hide resolved

labels := []attribute.KeyValue{
attribute.Key("A").String("B"),
Expand All @@ -124,7 +124,7 @@ func TestPrometheusExporter(t *testing.T) {

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

_ = metric.Must(meter).NewInt64ValueObserver("intobserver", func(_ context.Context, result metric.Int64ObserverResult) {
_ = metric.Must(meter).NewInt64GaugeObserver("intobserver", func(_ context.Context, result metric.Int64ObserverResult) {
result.Observe(1, labels...)
})

Expand Down
2 changes: 1 addition & 1 deletion exporters/stdout/stdoutmetric/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
)

loopCounter = metric.Must(meter).NewInt64Counter("function.loops")
paramValue = metric.Must(meter).NewInt64ValueRecorder("function.param")
paramValue = metric.Must(meter).NewInt64Histogram("function.param")

nameKey = attribute.Key("function.name")
)
Expand Down
4 changes: 2 additions & 2 deletions exporters/stdout/stdoutmetric/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ func TestStdoutMinMaxSumCount(t *testing.T) {
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())
}

func TestStdoutValueRecorderFormat(t *testing.T) {
func TestStdoutHistogramFormat(t *testing.T) {
fix := newFixture(t, stdoutmetric.WithPrettyPrint())

inst := metric.Must(fix.meter).NewFloat64ValueRecorder("name.histogram")
inst := metric.Must(fix.meter).NewFloat64Histogram("name.histogram")

for i := 0; i < 1000; i++ {
inst.Record(fix.ctx, float64(i)+0.5, attribute.String("A", "B"), attribute.String("C", "D"))
Expand Down
14 changes: 7 additions & 7 deletions internal/metric/global/meter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ func TestDirect(t *testing.T) {
counter.Add(ctx, 1, labels1...)
counter.Add(ctx, 1, labels1...)

valuerecorder := Must(meter1).NewFloat64ValueRecorder("test.valuerecorder")
valuerecorder := Must(meter1).NewFloat64Histogram("test.valuerecorder")
jmacd marked this conversation as resolved.
Show resolved Hide resolved
valuerecorder.Record(ctx, 1, labels1...)
valuerecorder.Record(ctx, 2, labels1...)

_ = Must(meter1).NewFloat64ValueObserver("test.valueobserver.float", func(_ context.Context, result metric.Float64ObserverResult) {
_ = Must(meter1).NewFloat64GaugeObserver("test.valueobserver.float", func(_ context.Context, result metric.Float64ObserverResult) {
jmacd marked this conversation as resolved.
Show resolved Hide resolved
result.Observe(1., labels1...)
result.Observe(2., labels2...)
})

_ = Must(meter1).NewInt64ValueObserver("test.valueobserver.int", func(_ context.Context, result metric.Int64ObserverResult) {
_ = Must(meter1).NewInt64GaugeObserver("test.valueobserver.int", func(_ context.Context, result metric.Int64ObserverResult) {
jmacd marked this conversation as resolved.
Show resolved Hide resolved
result.Observe(1, labels1...)
result.Observe(2, labels2...)
})

second := Must(meter2).NewFloat64ValueRecorder("test.second")
second := Must(meter2).NewFloat64Histogram("test.second")
second.Record(ctx, 1, labels3...)
second.Record(ctx, 2, labels3...)

Expand Down Expand Up @@ -146,7 +146,7 @@ func TestBound(t *testing.T) {
boundC.Add(ctx, 1)
boundC.Add(ctx, 1)

valuerecorder := Must(glob).NewInt64ValueRecorder("test.valuerecorder")
valuerecorder := Must(glob).NewInt64Histogram("test.valuerecorder")
boundM := valuerecorder.Bind(labels1...)
jmacd marked this conversation as resolved.
Show resolved Hide resolved
boundM.Record(ctx, 1)
boundM.Record(ctx, 2)
Expand Down Expand Up @@ -188,7 +188,7 @@ func TestUnbind(t *testing.T) {
counter := Must(glob).NewFloat64Counter("test.counter")
boundC := counter.Bind(labels1...)

valuerecorder := Must(glob).NewInt64ValueRecorder("test.valuerecorder")
valuerecorder := Must(glob).NewInt64Histogram("test.valuerecorder")
boundM := valuerecorder.Bind(labels1...)
jmacd marked this conversation as resolved.
Show resolved Hide resolved

boundC.Unbind()
Expand Down Expand Up @@ -268,7 +268,7 @@ func TestImplementationIndirection(t *testing.T) {
require.False(t, ok)

// Async: no SDK yet
valueobserver := Must(meter1).NewFloat64ValueObserver(
valueobserver := Must(meter1).NewFloat64GaugeObserver(
"interface.valueobserver",
jmacd marked this conversation as resolved.
Show resolved Hide resolved
func(_ context.Context, result metric.Float64ObserverResult) {},
)
Expand Down
8 changes: 4 additions & 4 deletions internal/metric/global/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ var (
return unwrap(MeterProvider().Meter(libraryName).NewFloat64Counter(name))
},
"valuerecorder.int64": func(name, libraryName string) (metric.InstrumentImpl, error) {
jmacd marked this conversation as resolved.
Show resolved Hide resolved
return unwrap(MeterProvider().Meter(libraryName).NewInt64ValueRecorder(name))
return unwrap(MeterProvider().Meter(libraryName).NewInt64Histogram(name))
},
"valuerecorder.float64": func(name, libraryName string) (metric.InstrumentImpl, error) {
jmacd marked this conversation as resolved.
Show resolved Hide resolved
return unwrap(MeterProvider().Meter(libraryName).NewFloat64ValueRecorder(name))
return unwrap(MeterProvider().Meter(libraryName).NewFloat64Histogram(name))
},
"valueobserver.int64": func(name, libraryName string) (metric.InstrumentImpl, error) {
jmacd marked this conversation as resolved.
Show resolved Hide resolved
return unwrap(MeterProvider().Meter(libraryName).NewInt64ValueObserver(name, func(context.Context, metric.Int64ObserverResult) {}))
return unwrap(MeterProvider().Meter(libraryName).NewInt64GaugeObserver(name, func(context.Context, metric.Int64ObserverResult) {}))
},
"valueobserver.float64": func(name, libraryName string) (metric.InstrumentImpl, error) {
return unwrap(MeterProvider().Meter(libraryName).NewFloat64ValueObserver(name, func(context.Context, metric.Float64ObserverResult) {}))
return unwrap(MeterProvider().Meter(libraryName).NewFloat64GaugeObserver(name, func(context.Context, metric.Float64ObserverResult) {}))
},
}
)
Expand Down
8 changes: 4 additions & 4 deletions metric/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ The synchronous instrument names are:

Counter: additive, monotonic
UpDownCounter: additive
ValueRecorder: grouping
Histogram: grouping
jmacd marked this conversation as resolved.
Show resolved Hide resolved

and the asynchronous instruments are:

SumObserver: additive, monotonic
UpDownSumObserver: additive
ValueObserver: grouping
CounterObserver: additive, monotonic
UpDownCounterObserver: additive
GaugeObserver: grouping
jmacd marked this conversation as resolved.
Show resolved Hide resolved

All instruments are provided with support for either float64 or int64 input
values.
Expand Down
Loading