1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +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:
Bogdan Drutu 2021-12-14 13:15:53 -08:00 committed by GitHub
parent db762533f9
commit 44bb795e78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}