-
Notifications
You must be signed in to change notification settings - Fork 35
Support float64 for gauges #88
Description
Requirement
We would like to emit gauge updates with floating numbers (e.g. probabilities)
Problem
The gauge interface in jaeger-lib only supports int64
Lines 18 to 21 in 78a0e7f
| type Gauge interface { | |
| // Update the gauge to the value passed in. | |
| Update(int64) | |
| } |
Implementations like tally, prom, go-kit, influx and expvar support float64 gauges, but jaeger-lib casts the int64 to a float64 value. Is there a reason for this?
jaeger-lib/metrics/prometheus/factory.go
Lines 230 to 232 in 78a0e7f
| func (g *gauge) Update(v int64) { | |
| g.gauge.Set(float64(v)) | |
| } |
jaeger-lib/metrics/tally/metrics.go
Lines 49 to 51 in 78a0e7f
| func (g *Gauge) Update(value int64) { | |
| g.gauge.Update(float64(value)) | |
| } |
jaeger-lib/metrics/go-kit/metrics.go
Lines 49 to 51 in 78a0e7f
| func (g *Gauge) Update(value int64) { | |
| g.gauge.Set(float64(value)) | |
| } |
Proposal
Update Gauge to use float64 instead of int64 in jaeger-lib 3.0; alternatively jaeger-lib can declare new types GaugeV2, FactoryV2, etc and create an adaptor.