Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support float64 for gauges #88

Open
vprithvi opened this issue Mar 26, 2021 · 1 comment
Open

Support float64 for gauges #88

vprithvi opened this issue Mar 26, 2021 · 1 comment

Comments

@vprithvi
Copy link
Contributor

vprithvi commented Mar 26, 2021

Requirement

We would like to emit gauge updates with floating numbers (e.g. probabilities)

Problem

The gauge interface in jaeger-lib only supports int64

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?

func (g *gauge) Update(v int64) {
g.gauge.Set(float64(v))
}

func (g *Gauge) Update(value int64) {
g.gauge.Update(float64(value))
}

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.

@yurishkuro
Copy link
Member

+1, FactoryV2, FloatGauge

I suspect it's for historical reasons, the old statsd based m3 client didn't support floats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants