Skip to content

Commit

Permalink
Remove zeroInstrumentKind (#5433)
Browse files Browse the repository at this point in the history
It is a duplicate of `instrumentKindUndefined`. Use
`instrumentKindUndefined` instead.
  • Loading branch information
MrAlias authored May 30, 2024
1 parent 8dbc7cd commit fad23ee
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sdk/metric/instrument.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import (
"go.opentelemetry.io/otel/sdk/metric/internal/aggregate"
)

var (
zeroInstrumentKind InstrumentKind
zeroScope instrumentation.Scope
)
var zeroScope instrumentation.Scope

// InstrumentKind is the identifier of a group of instruments that all
// performing the same function.
Expand Down Expand Up @@ -81,7 +78,7 @@ type Instrument struct {
func (i Instrument) IsEmpty() bool {
return i.Name == "" &&
i.Description == "" &&
i.Kind == zeroInstrumentKind &&
i.Kind == instrumentKindUndefined &&
i.Unit == "" &&
i.Scope == zeroScope
}
Expand Down Expand Up @@ -112,7 +109,7 @@ func (i Instrument) matchesDescription(other Instrument) bool {
// matchesKind returns true if the Kind of i is its zero-value or it equals the
// Kind of other, otherwise false.
func (i Instrument) matchesKind(other Instrument) bool {
return i.Kind == zeroInstrumentKind || i.Kind == other.Kind
return i.Kind == instrumentKindUndefined || i.Kind == other.Kind
}

// matchesUnit returns true if the Unit of i is its zero-value or it equals the
Expand Down

0 comments on commit fad23ee

Please sign in to comment.