feat: add metrics_optional_domains and metrics_optional_packages for users to configure optional domains#245
Conversation
Reviewer's GuideThis pull request adds a new parameter, metrics_pcp_optional_agents, enabling users to specify additional PCP agents to be enabled beyond those automatically managed by the metrics role, with corresponding updates to documentation, defaults, implementation logic, and tests. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
4552371 to
ec93ce1
Compare
README.md
Outdated
| If you want to remove policy, you will need to use the selinux system | ||
| role directly. | ||
|
|
||
| ### metrics_pcp_optional_agents: [] |
There was a problem hiding this comment.
We've not included the backend project name ('pcp') directly in any variables before, don't think we should start now. How about 'metrics_optional_domains' instead here?
ec93ce1 to
0437e00
Compare
|
@natoscott 1) What optional agents should this test with? Ideally, agents that are available in el7 - el10 and fedora. 2) How to verify that the optional agents are active/enabled? |
0437e00 to
8a0f902
Compare
The apache agent (pcp-pmda-apache rpm) has been around forever and is never default installed in pmcd.conf - it is also tolerant of Apache not running, so seems like it might be a good option.
A good way is to ask pmcd via: Alternatively, can request values from the agent - this is problematic for CI though because it requires the source of metrics for that domain (apache) to be available, accessible and configured - which is not necessarily the case. From memory there are existing tests using pmcd.agent.status so I recommend that approach. |
|
@natoscott one catch is that I had to add this: vars:
...
pcp_optional_packages: [pcp-pmda-apache]which works - but it begs the question - how will customers install the custom packages required for |
|
@natoscott on an unrelated topic - any idea why |
Hi @richm - had a look through but couldn't see a root cause - the check has 10x 1sec retry logic, which is definitely needed to give pmdaopenmetrics time to start. The next thing to do would be to check both /var/log/pcp/pmcd/{pmcd,openmetrics}.log files for additional clues. I'm guessing it just takes too long to get started, though on my local machine it completes in less than 1sec - the lack of any output from pminfo/pmprobe at all for the openmetrics.control.status metric suggests the PMDA is not yet completely setup. Another check that could be added is the pmcd.agent.status based check from check_from_elasticsearch.yml (with .find("openmetrics") instead) - this will let us know that pmcd has started the PMDA at least. |
I tried
I don't see openmetrics.log I don't see any errors or other clues in pmcd.log
# pmprobe -I pmcd.agent.status
pmcd.agent.status 11 "root" "pmcd" "proc" "pmproxy" "xfs" "linux" "nfsclient" "mmv" "kvm" "jbd2" "dm"I'm baffled . . . |
|
I'm testing locally like this: tox -e qemu-ansible-core-2.19 -- --image-name centos-10 --log-level debug -- tests/tests_verify_from_spark.ympcp-pmda-openmetrics-6.3.7-5.el10.x86_64 |
|
@richm I think we're missing something to stitch the needed agent in at the top level, e.g. |
Yep, good point - I think that will be needed here. |
Done |
|
[citest] |
…users to configure optional domains Feature: The metrics role has access to many data collection domains. The metrics role will automatically enable domains for features being managed e.g. the metrics role will automatically enable the `elasticsearch` domain if `metrics_from_elasticsearch: true`. The new parameter `metrics_optional_domains` allows the user to provide a list of additional domains to enable. The new parameter `metrics_optional_packages` allows the user to provide a list of additional packages that may be required to support the additional domains. Reason: Users should be able to enable domains other than the ones for features managed by the metrics role, and provide additional packages needed to enable those domains. Result: Users can enable the domains they need to use, and specify additional packages required for those domains. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
4a4f522 to
4894af9
Compare
|
[citest] |
|
@natoscott ok to merge? |
LGTM. |
Feature: The metrics role has access to many data collection domains.
The metrics role will automatically enable
domains for features being managed e.g. the metrics role will automatically
enable the
elasticsearchdomain ifmetrics_from_elasticsearch: true. Thenew parameter
metrics_optional_domainsallows the user to provide a listof additional domains to enable. The new parameter
metrics_optional_packagesallows the user to provide a list of additional packages that may be required
to support the additional domains.
Reason: Users should be able to enable domains other than the ones for
features managed by the metrics role, and provide additional packages needed
to enable those domains.
Result: Users can enable the domains they need to use, and specify additional
packages required for those domains.
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Introduce support for user-configurable optional PCP agents in the metrics role, allowing users to enable additional agents beyond those automatically managed by the role.
New Features:
Enhancements:
Documentation:
Tests: