Skip to content

Commit

Permalink
add err check
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsaks committed Dec 22, 2024
1 parent 5304c50 commit 52ed64d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions metricbeat/module/pgbouncer/pools/pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) error {
for _, result := range results {
var data mapstr.M

data, _ = schema.Apply(result)

data, err := schema.Apply(result)
if err != nil {
return fmt.Errorf("error mapping result: %w", err)
}
reporter.Event(mb.Event{
MetricSetFields: data,
})
Expand Down
6 changes: 4 additions & 2 deletions metricbeat/module/pgbouncer/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) error {
for _, result := range results {
var data mapstr.M

data, _ = schema.Apply(result)

data, err = schema.Apply(result)
if err != nil {
return fmt.Errorf("error mapping result: %w", err)
}
reporter.Event(mb.Event{
MetricSetFields: data,
})
Expand Down

0 comments on commit 52ed64d

Please sign in to comment.