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

collectors.GoCollector: Added rule support for granular metric configuration. #1102

Merged
merged 4 commits into from Aug 5, 2022

Conversation

bwplotka
Copy link
Member

@bwplotka bwplotka commented Aug 3, 2022

Fixes: #1089

cc @mknyszek

e,g to enable all runtime/metrics you can do this:

reg := prometheus.NewRegistry()
	reg.MustRegister(NewGoCollector(
		WithGoCollectorRuntimeMetrics(GoRuntimeMetricsRule{
			Matcher: regexp.MustCompile("/.*"),
		}),
	))

TODO:

  • Provide more examples on how to customize Go collector metrics
  • Allow adjusting buckets

Signed-off-by: bwplotka bwplotka@gmail.com

@bwplotka bwplotka changed the title goCollector: Added rule support for granular metric configuration. collectors.GoCollector: Added rule support for granular metric configuration. Aug 3, 2022
@kakkoyun kakkoyun added this to the v1.13.0 milestone Aug 5, 2022
Fixes: #1089

Signed-off-by: bwplotka <bwplotka@gmail.com>
* Added compatibility mode with old options.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* Copyright header.

Signed-off-by: bwplotka <bwplotka@gmail.com>
@mknyszek
Copy link
Contributor

mknyszek commented Aug 5, 2022

Neat! Something like this LGTM. Thanks for doing this.

bwplotka and others added 2 commits Aug 5, 2022
Signed-off-by: bwplotka <bwplotka@gmail.com>
* Add tests and examples

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Add docs for the presets

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun
Copy link
Member

kakkoyun commented Aug 5, 2022

@mknyszek 👋 again. I can't believe I've actually met with you in person and haven't discussed the runtime/metrics things in person. I'm terrible with the names 🙈 Sorry about that. Next time I hope 😊

@kakkoyun kakkoyun merged commit 5b7e8b2 into main Aug 5, 2022
7 checks passed
@kakkoyun kakkoyun deleted the go-coll branch Aug 5, 2022
@bwplotka
Copy link
Member Author

bwplotka commented Aug 5, 2022

Yea, I would be mad on myself in your case @kakkoyun 🙈

@mknyszek
Copy link
Contributor

mknyszek commented Aug 5, 2022

Wow, I'm so sorry, I definitely failed to connect the dots too. That was you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants