From 44bb795e7885435bd4eba050945f467838aacacc Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 14 Dec 2021 13:15:53 -0800 Subject: [PATCH] nit: Change metrics configs to have funcs on pointers (#2451) This avoids copying the whole object, also consistent with trace. Signed-off-by: Bogdan Drutu Co-authored-by: Tyler Yahn --- metric/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metric/config.go b/metric/config.go index 4f856e567..686ca7c1a 100644 --- a/metric/config.go +++ b/metric/config.go @@ -25,12 +25,12 @@ type InstrumentConfig struct { } // Description describes the instrument in human-readable terms. -func (cfg InstrumentConfig) Description() string { +func (cfg *InstrumentConfig) Description() string { return cfg.description } // Unit describes the measurement unit for a instrument. -func (cfg InstrumentConfig) Unit() unit.Unit { +func (cfg *InstrumentConfig) Unit() unit.Unit { return cfg.unit } @@ -78,12 +78,12 @@ type MeterConfig struct { } // InstrumentationVersion is the version of the library providing instrumentation. -func (cfg MeterConfig) InstrumentationVersion() string { +func (cfg *MeterConfig) InstrumentationVersion() string { return cfg.instrumentationVersion } // SchemaURL is the schema_url of the library providing instrumentation. -func (cfg MeterConfig) SchemaURL() string { +func (cfg *MeterConfig) SchemaURL() string { return cfg.schemaURL }