Skip to content

Commit

Permalink
Fix panic when using untyped metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Heathcliff <[email protected]>
  • Loading branch information
heathcliff26 committed Jan 4, 2025
1 parent a5a4d71 commit af4505c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions promremote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ func (c *Client) collect() ([]prompb.TimeSeries, error) {
} else if m.Gauge != nil {
value = m.Gauge.GetValue()
} else if m.Untyped != nil {
value = m.Counter.GetValue()
value = m.Untyped.GetValue()
} else {
return nil, fmt.Errorf("Unknown metric type")
return nil, fmt.Errorf("unknown metric type")
}
ts.Samples = []prompb.Sample{
{
Expand Down

0 comments on commit af4505c

Please sign in to comment.