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

Add option to control Go metrics in the default collector. #1089

Closed
SuperQ opened this issue Jul 15, 2022 · 3 comments · Fixed by #1102
Closed

Add option to control Go metrics in the default collector. #1089

SuperQ opened this issue Jul 15, 2022 · 3 comments · Fixed by #1102

Comments

@SuperQ
Copy link
Member

SuperQ commented Jul 15, 2022

With client_golang v1.12.2, we removed the runtime/metrics from the default collector.

But now it seems difficult to get these metrics back without having to abandon the default registry. This makes the use of promauto more cumbersome.

Some ideas:

  • Add a default registry method to adjust what metrics features are enabled at build time/runtime.
  • Add some filtering methods so that only specific sets of runtime/metrics are included.

For example, of the new metrics I only need /sched/latencies:seconds right now.

@kakkoyun kakkoyun added this to the v1.13.0 milestone Jul 15, 2022
@bwplotka
Copy link
Member

It is indeed unfortunate we cannot change the default registry Go collector to new metrics as registering another GoCollector would register base metrics. It's relatively easy to change it, but not sure it's worth it. We generally want to deprecate global registry (my opinion).

promauto is quite nice with custom registry. Just use promauto.With(reg).New..... I don't think 9 more characters are more cumbersome 🙈 This is what we use everywhere and recommend (probably we might want to update docs).

You are right that some filtering might be amazing. Perhaps it could solve GoCollector on the default register. I think it's worth considering.

Open Questions

  • Should we filter based on core runtime metric name like /shed/latencies:second or resulted Prometheus-like metric names?
  • Should we filter on Go collector level or on registered level? (would allow doing this for any collector in the registry).

@SuperQ
Copy link
Member Author

SuperQ commented Jul 27, 2022

I all I really want to do is be able to toggle or update the filter on the GoCollector.

bwplotka added a commit that referenced this issue Aug 3, 2022
Fixes: #1089

Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka added a commit that referenced this issue Aug 3, 2022
Fixes: #1089

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

bwplotka commented Aug 3, 2022

Let us know if that (#1102) will satisfy you @SuperQ - I will add more details, even how to add it to defaultRegistry

bwplotka added a commit that referenced this issue Aug 5, 2022
Fixes: #1089

Signed-off-by: bwplotka <bwplotka@gmail.com>
kakkoyun added a commit that referenced this issue Aug 5, 2022
…uration. (#1102)

* goCollector: Added rule support for granular metric configuration.

Fixes: #1089

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

* Added compatibility mode with old options. (#1107)

* Added compatibility mode with old options.

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

* Copyright header.

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

* Remove bucket option for now. (#1108)

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

* collectors/GoCollector: Add tests and examples (#1109)

* 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>

Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
Cori1109 added a commit to Cori1109/client_golang that referenced this issue Jan 9, 2023
…uration. (#1102)

* goCollector: Added rule support for granular metric configuration.

Fixes: prometheus/client_golang#1089

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

* Added compatibility mode with old options. (#1107)

* Added compatibility mode with old options.

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

* Copyright header.

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

* Remove bucket option for now. (#1108)

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

* collectors/GoCollector: Add tests and examples (#1109)

* 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>

Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants