From 86dbea5e87c779368c20ef4aeacbb00883bf4f6f Mon Sep 17 00:00:00 2001 From: David Poncelow Date: Mon, 25 Oct 2021 12:05:58 -0700 Subject: [PATCH 1/2] option to disable hypervisor metrics for openstack Useful for openstack-on-openstack deployments --- collectd-plugins.yaml | 2 +- docs/monitors/collectd-openstack.md | 2 ++ pkg/monitors/collectd/openstack/metadata.yaml | 1 + pkg/monitors/collectd/openstack/openstack.go | 3 +++ selfdescribe.json | 10 +++++++++- tests/monitors/openstack/openstack_test.py | 1 + 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/collectd-plugins.yaml b/collectd-plugins.yaml index 16b562c256..e2112f132e 100644 --- a/collectd-plugins.yaml +++ b/collectd-plugins.yaml @@ -48,7 +48,7 @@ - pymongo[tls]==3.3.1 - name: openstack - version: v4.1.0 + version: v4.2.0 repo: signalfx/collectd-openstack - name: rabbitmq diff --git a/docs/monitors/collectd-openstack.md b/docs/monitors/collectd-openstack.md index 6a6ad09836..eb4c33f8af 100644 --- a/docs/monitors/collectd-openstack.md +++ b/docs/monitors/collectd-openstack.md @@ -57,6 +57,7 @@ monitors: password: "secret" skipVerify: true queryServerMetrics: false + queryHypervisorMetrics: false ``` @@ -89,6 +90,7 @@ Configuration](../monitor-config.md#common-configuration).** | `httpTimeout` | no | `float64` | The HTTP client timeout in seconds for all requests (**default:** `0`) | | `requestBatchSize` | no | `integer` | The maximum number of concurrent requests for each metric class (**default:** `5`) | | `queryServerMetrics` | no | `bool` | Whether to query server metrics (useful to disable for TripleO Undercloud) (**default:** `true`) | +| `queryHypervisorMetrics` | no | `bool` | Whether to query hypervisor metrics (useful to disable for TripleO Undercloud) (**default:** `true`) | | `novaListServersSearchOpts` | no | `map of strings` | Optional search_opts mapping for collectd-openstack Nova client servers.list(search_opts=novaListServerSearchOpts). For more information see https://docs.openstack.org/api-ref/compute/#list-servers. | diff --git a/pkg/monitors/collectd/openstack/metadata.yaml b/pkg/monitors/collectd/openstack/metadata.yaml index 19046b1b3e..778d5b5cab 100644 --- a/pkg/monitors/collectd/openstack/metadata.yaml +++ b/pkg/monitors/collectd/openstack/metadata.yaml @@ -52,6 +52,7 @@ monitors: password: "secret" skipVerify: true queryServerMetrics: false + queryHypervisorMetrics: false ``` metrics: counter.openstack.nova.server.cpu_time: diff --git a/pkg/monitors/collectd/openstack/openstack.go b/pkg/monitors/collectd/openstack/openstack.go index 2767e34ae8..0b6329637a 100644 --- a/pkg/monitors/collectd/openstack/openstack.go +++ b/pkg/monitors/collectd/openstack/openstack.go @@ -49,6 +49,8 @@ type Config struct { RequestBatchSize int `yaml:"requestBatchSize" default:"5"` // Whether to query server metrics (useful to disable for TripleO Undercloud) QueryServerMetrics *bool `yaml:"queryServerMetrics" default:"true"` + // Whether to query hypervisor metrics (useful to disable for TripleO Undercloud) + QueryHypervisorMetrics *bool `yaml:"queryHypervisorMetrics" default:"true"` // Optional search_opts mapping for collectd-openstack Nova client servers.list(search_opts=novaListServerSearchOpts). // For more information see https://docs.openstack.org/api-ref/compute/#list-servers. NovaListServersSearchOpts map[string]string `yaml:"novaListServersSearchOpts"` @@ -93,6 +95,7 @@ func (m *Monitor) Configure(conf *Config) error { "HTTPTimeout": conf.HTTPTimeout, "RequestBatchSize": conf.RequestBatchSize, "QueryServerMetrics": conf.QueryServerMetrics, + "QueryHypervisorMetrics": conf.QueryHypervisorMetrics, "NovaListServersSearchOpts": novaListServersSearchOpts, }, } diff --git a/selfdescribe.json b/selfdescribe.json index 18b7c9bba5..6edcacbc5f 100644 --- a/selfdescribe.json +++ b/selfdescribe.json @@ -17466,7 +17466,7 @@ "description": "This will contain the project id and name of the project given in the configuration." } }, - "doc": "Monitors [Openstack](https://www.openstack.org/) by using the [Openstack\ncollectd Python plugin](https://github.com/signalfx/collectd-openstack),\nwhich collects metrics from Openstack instances. This plugin is installed\nwith the Smart Agent, so no additional installation is required to use this\nmontior.\n\nThis monitor covers the following Openstack components:\n\n* Nova (Compute)\n* Cinder (BlockStorge)\n* Neutron (Network)\n\nPlease see the reference for OpenStack [Monitoring](https://wiki.openstack.org/wiki/Operations/Monitoring).\n\n\u003c!--- SETUP ---\u003e\n### Deployment Host\n\nIdentify a host on which the SignalFx agent will run. This integration\ncollects data from OpenStack remotely via APIs, and so those API endpoints\nmust be visible to the host on which the agent runs. We do not recommend\ninstalling the agent directly on a compute instance because a compute\ninstance/resource under one project cannot get stats about the resources\nunder other projects. Also, a compute instance may go down due to lack of\nresources in the project.\n\n\u003c!--- SETUP ---\u003e\n### Example config\n```yaml\nmonitors:\n- type: collectd/openstack\n authURL: \"http://192.168.11.111/identity/v3\"\n username: \"admin\"\n password: \"secret\"\n requestBatchSize: 10\n novaListServersSearchOpts:\n all_tenants: \"TRUE\"\n status: \"ACTIVE\"\n```\n### Example config using skipVerify and disabling querying server metrics\n```yaml\nmonitors:\n- type: collectd/openstack\n authURL: \"https://192.168.11.111/identity/v3\"\n username: \"admin\"\n password: \"secret\"\n skipVerify: true\n queryServerMetrics: false\n```\n", + "doc": "Monitors [Openstack](https://www.openstack.org/) by using the [Openstack\ncollectd Python plugin](https://github.com/signalfx/collectd-openstack),\nwhich collects metrics from Openstack instances. This plugin is installed\nwith the Smart Agent, so no additional installation is required to use this\nmontior.\n\nThis monitor covers the following Openstack components:\n\n* Nova (Compute)\n* Cinder (BlockStorge)\n* Neutron (Network)\n\nPlease see the reference for OpenStack [Monitoring](https://wiki.openstack.org/wiki/Operations/Monitoring).\n\n\u003c!--- SETUP ---\u003e\n### Deployment Host\n\nIdentify a host on which the SignalFx agent will run. This integration\ncollects data from OpenStack remotely via APIs, and so those API endpoints\nmust be visible to the host on which the agent runs. We do not recommend\ninstalling the agent directly on a compute instance because a compute\ninstance/resource under one project cannot get stats about the resources\nunder other projects. Also, a compute instance may go down due to lack of\nresources in the project.\n\n\u003c!--- SETUP ---\u003e\n### Example config\n```yaml\nmonitors:\n- type: collectd/openstack\n authURL: \"http://192.168.11.111/identity/v3\"\n username: \"admin\"\n password: \"secret\"\n requestBatchSize: 10\n novaListServersSearchOpts:\n all_tenants: \"TRUE\"\n status: \"ACTIVE\"\n```\n### Example config using skipVerify and disabling querying server metrics\n```yaml\nmonitors:\n- type: collectd/openstack\n authURL: \"https://192.168.11.111/identity/v3\"\n username: \"admin\"\n password: \"secret\"\n skipVerify: true\n queryServerMetrics: false\n queryHypervisorMetrics: false\n```\n", "groups": { "": { "description": "", @@ -17963,6 +17963,14 @@ "type": "bool", "elementKind": "" }, + { + "yamlName": "queryHypervisorMetrics", + "doc": "Whether to query hypervisor metrics (useful to disable for TripleO Undercloud)", + "default": true, + "required": false, + "type": "bool", + "elementKind": "" + }, { "yamlName": "novaListServersSearchOpts", "doc": "Optional search_opts mapping for collectd-openstack Nova client servers.list(search_opts=novaListServerSearchOpts). For more information see https://docs.openstack.org/api-ref/compute/#list-servers.", diff --git a/tests/monitors/openstack/openstack_test.py b/tests/monitors/openstack/openstack_test.py index 39645263a9..b79b0cee7c 100644 --- a/tests/monitors/openstack/openstack_test.py +++ b/tests/monitors/openstack/openstack_test.py @@ -35,6 +35,7 @@ def test_openstack_default(devstack): httpTimeout: 10.001 requestBatchSize: 10 queryServerMetrics: true + queryHypervisorMetrics: true novaListServersSearchOpts: all_tenants: "TRUE" status: "ACTIVE" From b706197c2034d95f4b125e9bdbbb1453070ff3d7 Mon Sep 17 00:00:00 2001 From: David Poncelow Date: Tue, 26 Oct 2021 08:58:03 -0700 Subject: [PATCH 2/2] bump sfxpython version to 0.4.2 --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index bc23aff52c..a8f9867aa5 100644 --- a/python/setup.py +++ b/python/setup.py @@ -3,7 +3,7 @@ # yapf: disable setup( name="sfxpython", - version="0.4.1", + version="0.4.2", author="SignalFx, Inc", description="Python packages used by the Python extension mechanism of the SignalFx Smart Agent", url="https://github.com/signalfx/signalfx-agent",