mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-03-03 14:52:56 +02:00
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 <bogdandrutu@gmail.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
parent
db762533f9
commit
44bb795e78
@ -25,12 +25,12 @@ type InstrumentConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Description describes the instrument in human-readable terms.
|
// Description describes the instrument in human-readable terms.
|
||||||
func (cfg InstrumentConfig) Description() string {
|
func (cfg *InstrumentConfig) Description() string {
|
||||||
return cfg.description
|
return cfg.description
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unit describes the measurement unit for a instrument.
|
// Unit describes the measurement unit for a instrument.
|
||||||
func (cfg InstrumentConfig) Unit() unit.Unit {
|
func (cfg *InstrumentConfig) Unit() unit.Unit {
|
||||||
return cfg.unit
|
return cfg.unit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,12 +78,12 @@ type MeterConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// InstrumentationVersion is the version of the library providing instrumentation.
|
// InstrumentationVersion is the version of the library providing instrumentation.
|
||||||
func (cfg MeterConfig) InstrumentationVersion() string {
|
func (cfg *MeterConfig) InstrumentationVersion() string {
|
||||||
return cfg.instrumentationVersion
|
return cfg.instrumentationVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
// SchemaURL is the schema_url of the library providing instrumentation.
|
// SchemaURL is the schema_url of the library providing instrumentation.
|
||||||
func (cfg MeterConfig) SchemaURL() string {
|
func (cfg *MeterConfig) SchemaURL() string {
|
||||||
return cfg.schemaURL
|
return cfg.schemaURL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user