Skip to content

How to implement Prometheus Gauge Set method in open-telemetry? #3984

@lsytj0413

Description

@lsytj0413

Problem Statement

A clear and concise description of what the problem is.
Ex. I'm always frustrated when [...]

I'm trying to migrate an project's metric implement from Prometheus to open-telemetry,it heavily use gauge.Set to measure values with different labels group. For example:

It have an gauge metric for conn pool stats, defined as:

conn_pool_stat{type=?}

and type's value could be one of: free、running as so on.

On other hand, another library we used only expose an Store method to the user, which is been called when the library want to set a metric to an concrete value (with different labels group), we implement Store use gauge.Set method. but when we migrate to open-telemetry,we only have two choice:

  1. Float64UpDownCounter,but it only have an Add method
  2. Float64ObservableGauge,but it only record value when callback is perform, and the library will call Store at any time.

base on this discription,how should implement gauge.Set method in open-telemetry with different label groups?

I have search for previous issue,and found #708 (comment) is and similar requests.

Proposed Solution

A clear and concise description of what you want to happen.

Alternatives

A clear and concise description of any alternative solutions or features you've considered.

Prior Art

A clear and concise list of any similar and existing solutions from other projects that provide context to possible solutions.

Additional Context

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions