...libmetric.MeterOption) (libmetric.Int64Counter, error) { cfg := libmetric.NewMeterOption(options...) opts := []metric.Int64CounterOption{ metric.WithUnit(cfg.Unit().String()), } if v := cfg.Description(); v != "" { opts = append(opts, metric.WithDescription(v)) } counter, err := m.provider.Meter(m.service).Int64Counter(m.metricName(name), opts...) if err != nil { return nil, fmt.Errorf("create int64 counter: %w", err) } return &int64Counter{ c: counter, }, nil } // ... ------------------------------------------ lib/metric.go: ------------------------------------------ type Meter interface { // NOTE: If you want to add more metrics, add them here. Int64Counter(name string, options ...MeterOption) (Int64Counter, error) Int64Gauge(name string, options ...MeterOption) (Int64Gauge, error) Float64Counter(name string, options ...MeterOption) (Float64Counter, error) Float64Gauge(name string, options ...MeterOption) (Float64Gauge, error) } type ( Int64Counter interface { Add(ctx context.Context, incr int64, opts ...MeasurementOption) } Int64Gauge interface { Record(ctx context.Context, value int64, opts ...MeasurementOption) } Float64Counter interface { Add(ctx context.Context, incr float64, opts ...MeasurementOption) } Float64Gauge interface { Record(ctx context.Context, value float64, opts ...MeasurementOption) } ) // ... Developer Platform • ຊͬͱछྨ͕ͨ͘͞Μ͋Δ • େମͷ߹͜ΕͰࣄΓΔ • provider ͱ͔Βͳ͍͍ͯ͘ Platform Team Ͱ Wrap ͯ͠ఏڙ͢Δ͜ͱͰඞཁ࠷ݶͷࣝͰ࣮Մೳ