opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Collect more runtime metrics

Open pkositsyn opened this issue 4 years ago • 13 comments

Is your feature request related to a problem? Sometimes it's useful to have goroutines count or gc related metrics exposed

Describe the solution you'd like Add these metrics to collector internal metrics exporter

Describe alternatives you've considered Adding configuration would be useful as well, but I don't see an elegant way to add it for internal exporter

pkositsyn avatar Nov 14 '20 00:11 pkositsyn

I think we should remove the custom runtime metrics from the service, and use one of the way we do allow collecting of runtime metrics for any go lang binary.

I would suggest we expose expvar on our service and scrape these metrics using an expvar receiver. There are some reasons to do this:

  1. This is a generic mechanism that allows us to monitor any golang binary not just the collector.
  2. Avoid unnecessary code to scrape runtime metrics for this binary.

Thoughts?

bogdandrutu avatar Nov 16 '20 16:11 bogdandrutu

@Vemmy124 alternative is to rely on opentelemetry-go library to produce these metrics

bogdandrutu avatar Nov 16 '20 16:11 bogdandrutu

@bogdandrutu The only issue with the expvar is that there are not many tools that knows how to parse it. Otherwise, I agree with your points.

rakyll avatar Nov 17 '20 21:11 rakyll

@bogdandrutu @rakyll I agree that expvar isn't popular and it's a real problem, which includes using an exporter almost for sure for monitoring (e.g. another collector with expvar receiver and prometheus exporter + still a problem of monitoring the last collector). Moreover, I doubt its efficiency with lock for every variable update but might be not that bad.

By the way, I don't mind writing some lines for collecting system metrics actually. Do you think that prometheus is not enough standardized for usage? If this is the case, I don't know a good alternative.

pkositsyn avatar Nov 20 '20 00:11 pkositsyn

@Vemmy124 look into opentelemetry-go-contrib, already support for more runtime metrics. We should use that instead of OpenCensus for recording internal metrics and install the runtime plugin from there

bogdandrutu avatar Nov 20 '20 16:11 bogdandrutu

Instead of expvar, we should consider exposing this following the OpenMetrics format. Quite a lot of tools can understand it already, including the tool that is the most popular today in this area (Prometheus).

jpkrohling avatar Nov 25 '20 08:11 jpkrohling

To be honest even opentelemetry-go alone seems complicated for me as a client library. @bogdandrutu Do I understand correctly that you want to replace OpenCensus for metrics in the whole repository? Could you provide reasons for that and what's wrong with current approach? This issue is stale only because I cannot see the purpose of changing a lot of things. Think I need a vision for that

pkositsyn avatar Nov 28 '20 22:11 pkositsyn

Reopening, as I think this is still valid and we might be closer now to achieving it than we were before, given that we are now closer to using OTel API in the collector.

jpkrohling avatar Jan 11 '23 14:01 jpkrohling

Are there any updates on this? I was surprised to find there are go_gc or any go metrics emitted by the collector, lowering our ability to monitor what is happening on our collector processes. I would be interested in in helping implement this if there is an agreed upon way to move forward

HudsonHumphries avatar Mar 02 '23 00:03 HudsonHumphries

hey guys, whats the status here? could you pls export https://github.com/prometheus/client_golang/blob/main/prometheus/go_collector.go or https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/runtime/example/main.go its really essential. I may help

tomershafir avatar Dec 28 '23 10:12 tomershafir

Could you please expose the standard go_ metrics? This will really help tune GOGC and GOMEMLIMIT

gowtham-sundara avatar Jan 08 '24 20:01 gowtham-sundara

@bogdandrutu maybe you can help here?

tomershafir avatar Jan 09 '24 10:01 tomershafir

Any update on this topic? I was gonna check garbage collection on some collectors and was surprised this runtime metrics are not present.

Thanks :)

CarlosLanderas avatar May 10 '24 13:05 CarlosLanderas