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

prometheus default metrics (go_goroutines, go_info, go_memstats ...) are not exposed #2171

Closed
xmlking opened this issue Aug 7, 2021 · 3 comments
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:exporter:prometheus Related to the Prometheus exporter package

Comments

@xmlking
Copy link

xmlking commented Aug 7, 2021

prometheus exporter is not exposing default metrics (go_goroutines, go_info, go_memstats ...)

The workaround to fix is with ugly code below

var pConfig = prometheus.Config{Registry: goprom.DefaultRegisterer.(*goprom.Registry)}
exporter, err := prometheus.New(pConfig, pController)

please consider changed this code to

	if config.Registry == nil {
		config.Registry = prometheus.DefaultRegisterer.(*prometheus.Registry)}
	}

My Workaround
https://github.com/xmlking/toolkit/blob/develop/telemetry/metrics/metrics.go#L64

@xmlking xmlking added the bug Something isn't working label Aug 7, 2021
xmlking added a commit to xmlking/grpc-starter-kit that referenced this issue Aug 7, 2021
@MrAlias MrAlias added this to Needs triage in Bugs via automation Aug 9, 2021
@MrAlias MrAlias added area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:exporter:prometheus Related to the Prometheus exporter package and removed bug Something isn't working labels Aug 9, 2021
@MrAlias MrAlias removed this from Needs triage in Bugs Aug 9, 2021
@jmacd
Copy link
Contributor

jmacd commented Aug 19, 2021

The OTel library has a module for runtime metrics, https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/runtime

@MrAlias MrAlias added this to the Metric SDK: Beta milestone Oct 12, 2022
@dashpole
Copy link
Contributor

I believe this is addressed with the current (new) version of the prometheus exporter. See #3239 (comment).

Basically, we register with the DefaultRegisterer by default, and allow users to override this with the WithRegisterer option.

@MrAlias
Copy link
Contributor

MrAlias commented Oct 14, 2022

I believe this is addressed with the current (new) version of the prometheus exporter. See #3239 (comment).

Basically, we register with the DefaultRegisterer by default, and allow users to override this with the WithRegisterer option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:exporter:prometheus Related to the Prometheus exporter package
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants