Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Support float64 for gauges #88

@vprithvi

Description

@vprithvi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions