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

Runtime instrumentation: Make runtime.uptime an Asynchronous Gauge #1341

Closed
cwildman opened this issue Oct 11, 2021 · 4 comments
Closed

Runtime instrumentation: Make runtime.uptime an Asynchronous Gauge #1341

cwildman opened this issue Oct 11, 2021 · 4 comments

Comments

@cwildman
Copy link

Currently the runtime.uptime metric is reported as an Asynchronous Counter. Uptime as a concept is certainly monotonic which makes it seem like it should be a Counter, but it's also non-additive, it doesn't make sense to sum the uptime of different processes.

Additionally reporting uptime as a Counter presents a problem when trying to use delta temporality. The obvious question you want to answer with a metric like this is "How long has my process been running?". Using delta temporality with uptime would force you to track the running sum of all data points since the process started.

Because runtime.uptime is not additive and we don't actually care about rates or sum I think it is best served as an Asynchronous Gauge.

@krak3n
Copy link

krak3n commented Aug 2, 2022

In the prometheus exporter in open-telemetry/opentelemetry-collector-contrib this metric fails to get exported due to this error:

{
   "level":"error",
   "ts":1659451541.6164072,
   "caller":"prometheusexporter@v0.53.0/log.go:34",
   "msg":"error gathering metrics: collected metric runtime_uptime counter:<value:8.415e+07 >  should be a Gauge\n",
   "kind":"exporter",
   "name":"prometheus",
   "stacktrace":"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*promLogger).Println\n\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter@v0.53.0/log.go:34\ngithub.com/prometheus/client_golang/prometheus/promhttp.HandlerFor.func1\n\tgithub.com/prometheus/client_golang@v1.12.2/prometheus/promhttp/http.go:129\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2084\nnet/http.(*ServeMux).ServeHTTP\n\tnet/http/server.go:2462\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2916\nnet/http.(*conn).serve\n\tnet/http/server.go:1966"
}

@starzhanganz
Copy link

Can we have someone looking into this please? The incorrect type caused high error rate while exporting the metrics to Google Cloud. It reports runtime.uptime must be GAUGE, but is CUMULATIVE

@MrAlias MrAlias moved this from Needs Triage to TODO in Go: Metric SDK (Post-GA) Feb 8, 2024
@AkhigbeEromo
Copy link
Contributor

Hello @MrAlias, i am currently working on a pull request for this issue. Can it be assigned to me?

@MrAlias
Copy link
Contributor

MrAlias commented Oct 17, 2024

This is no longer relevant after #5780. The semantic conventions for this instrumentation no longer contain this metric: open-telemetry/semantic-conventions#981.

@MrAlias MrAlias closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

5 participants