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

[stacked 3/5] metrics: simplify policy/backend metrics collection interface. #408

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

klihub
Copy link
Collaborator

@klihub klihub commented Nov 11, 2024

Notes: This PR is stacked on top of #404.

Simplify the policy-backend metrics collection interface, reducing it to a single GetMetrics() call and a returned policy.Metrics interface, which simply implements the native prometheus collector interface with Describe() and Collect(). Update policy implementations accordingly.

@klihub klihub changed the title [3/4] metrics: simplicy policy/backend metrics collection interface. [3/5] metrics: simplicy policy/backend metrics collection interface. Nov 11, 2024
@klihub klihub force-pushed the metrics/simplify-policy-interface branch from ea333a0 to 2590ed1 Compare November 12, 2024 10:46
@pfl
Copy link

pfl commented Nov 12, 2024

Isn't this already part of commits 405 and 406?

@klihub
Copy link
Collaborator Author

klihub commented Nov 12, 2024

Isn't this already part of commits 405 and 406?

This is like some other is this series: effectively a single commit PR, but it is stacked on top of a the previous one, in this case, PR #404.

@klihub klihub force-pushed the metrics/simplify-policy-interface branch 3 times, most recently from 89227b2 to 8657a3e Compare November 13, 2024 09:44
@klihub klihub marked this pull request as ready for review November 13, 2024 13:29
@klihub klihub changed the title [3/5] metrics: simplicy policy/backend metrics collection interface. [3/5] metrics: simplify policy/backend metrics collection interface. Nov 13, 2024
@klihub klihub changed the title [3/5] metrics: simplify policy/backend metrics collection interface. [stack: 3/5] metrics: simplify policy/backend metrics collection interface. Nov 13, 2024
@klihub klihub changed the title [stack: 3/5] metrics: simplify policy/backend metrics collection interface. [stacked 3/5] metrics: simplify policy/backend metrics collection interface. Nov 13, 2024
@klihub klihub force-pushed the metrics/simplify-policy-interface branch 2 times, most recently from c05f9d8 to 7b498fa Compare November 13, 2024 16:53
Rework our metrics collector registry to take care of most
of the necessary bits for metrics registration, collection
and gathering. Use the prometheus-provided namespacing and
subsystems to put all generated metrics under a prefix and
provide additional grouping.

Signed-off-by: Krisztian Litkey <[email protected]>
Update cgroupstats collector for the reworked metrics registry.
Split out automatic registration to a register subpackage.

Signed-off-by: Krisztian Litkey <[email protected]>
Remove the old resmgr-triggered polling of policy metrics
and the old resmgr-level polling policy metrics collector.
Implement policy metrics collection in the policy package
itself.

Signed-off-by: Krisztian Litkey <[email protected]>
Remove the old opencensus-based prometheus exporter. Rework
prometheus exporting using our update metrics registry and
a promhttp /metrics-handler.

Signed-off-by: Krisztian Litkey <[email protected]>
Add configuration bits for controlling which metrics are
collected. Enable collection of policy metrics by default.

Signed-off-by: Krisztian Litkey <[email protected]>
Remove obsolete and unused option entries. Give a warning about
using the now-obsolete '-metrics-interval' argument. It's used
unconditionally by our existing Helm charts, so we'll phase it
out a bit more gently.

Signed-off-by: Krisztian Litkey <[email protected]>
Add a metrics/collectors subpackage. When imported it pulls
in and registers the fairly standard buildinfo, process and
golang runtime collectors. Turn on the build info collector
by default.

Signed-off-by: Krisztian Litkey <[email protected]>
Simplify the policy-backend metrics collection interface,
reducing it to a single GetMetrics() call and a returned
Metrics interface which simply implements the collector-
like Describe() and Collect() interfaces. Update policy
implementations accordingly.

Signed-off-by: Krisztian Litkey <[email protected]>
@klihub klihub force-pushed the metrics/simplify-policy-interface branch from 7b498fa to 185b1e3 Compare November 14, 2024 09:44
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.

2 participants