Skip to content

Commit

Permalink
Update internal/exporter/mapper.go
Browse files Browse the repository at this point in the history
Co-authored-by: Blagoj Atanasovski <[email protected]>
  • Loading branch information
Ivaka and atanasovskib authored Mar 7, 2024
1 parent aedfe93 commit 0a9a920
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions internal/exporter/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,18 @@ func (p metricMapper) Map(metricFamilyMaps []MetricFamiliyMap, ts time.Time) *pb
Value: *l.Value,
})
}
var newValue float64
switch t {
case "COUNTER":
metric.Measurements = append(metric.Measurements, &pb.Metric_Measurement{
Value: *m.GetCounter().Value,
Ts: timestamppb.New(ts),
Labels: labels,
})
newValue = *m.GetCounter().Value
case "GAUGE":
metric.Measurements = append(metric.Measurements, &pb.Metric_Measurement{
Value: *m.GetGauge().Value,
newValue = *m.GetGauge().Value,
}

Check failure on line 53 in internal/exporter/mapper.go

View workflow job for this annotation

GitHub Actions / Build

syntax error: unexpected }, expected expression
metric.Measurements = append(metric.Measurements, newMeasurement = &pb.Metric_Measurement{

Check failure on line 54 in internal/exporter/mapper.go

View workflow job for this annotation

GitHub Actions / Build

syntax error: unexpected = in argument list; possibly missing comma or )
Value: newValue,
Ts: timestamppb.New(ts),
Labels: labels,

Check failure on line 57 in internal/exporter/mapper.go

View workflow job for this annotation

GitHub Actions / Build

syntax error: unexpected : at end of statement
})

Check failure on line 58 in internal/exporter/mapper.go

View workflow job for this annotation

GitHub Actions / Build

syntax error: unexpected ) at end of statement
}
}
}
}
Expand Down

0 comments on commit 0a9a920

Please sign in to comment.