Skip to content

Commit

Permalink
Decrease indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpionknifes committed Jan 11, 2024
1 parent 875fca6 commit 9e7e772
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions sdk/metric/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,13 @@ func (r observer) ObserveFloat64(o metric.Float64Observable, v float64, opts ...
return
}

if _, registered := r.float64[oImpl.observablID]; !registered {
if !oImpl.dropAggregation {
global.Error(errUnregObserver, "failed to record",
"name", oImpl.name,
"description", oImpl.description,
"unit", oImpl.unit,
"number", fmt.Sprintf("%T", float64(0)),
)
}
if _, registered := r.float64[oImpl.observablID]; !registered && !oImpl.dropAggregation {
global.Error(errUnregObserver, "failed to record",
"name", oImpl.name,
"description", oImpl.description,
"unit", oImpl.unit,
"number", fmt.Sprintf("%T", float64(0)),
)
return
}
c := metric.NewObserveConfig(opts)
Expand All @@ -474,15 +472,13 @@ func (r observer) ObserveInt64(o metric.Int64Observable, v int64, opts ...metric
return
}

if _, registered := r.int64[oImpl.observablID]; !registered {
if !oImpl.dropAggregation {
global.Error(errUnregObserver, "failed to record",
"name", oImpl.name,
"description", oImpl.description,
"unit", oImpl.unit,
"number", fmt.Sprintf("%T", int64(0)),
)
}
if _, registered := r.int64[oImpl.observablID]; !registered && !oImpl.dropAggregation {
global.Error(errUnregObserver, "failed to record",
"name", oImpl.name,
"description", oImpl.description,
"unit", oImpl.unit,
"number", fmt.Sprintf("%T", int64(0)),
)
return
}
c := metric.NewObserveConfig(opts)
Expand Down

0 comments on commit 9e7e772

Please sign in to comment.