Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
option to disable hypervisor metrics for openstack (#1968)
Browse files Browse the repository at this point in the history
* option to disable hypervisor metrics for openstack

Useful for openstack-on-openstack deployments

* bump sfxpython version to 0.4.2
  • Loading branch information
zenmoto authored Oct 28, 2021
1 parent bdc4672 commit 3820130
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion collectd-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/monitors/collectd-openstack.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ monitors:
password: "secret"
skipVerify: true
queryServerMetrics: false
queryHypervisorMetrics: false
```
Expand Down Expand Up @@ -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. |


Expand Down
1 change: 1 addition & 0 deletions pkg/monitors/collectd/openstack/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ monitors:
password: "secret"
skipVerify: true
queryServerMetrics: false
queryHypervisorMetrics: false
```
metrics:
counter.openstack.nova.server.cpu_time:
Expand Down
3 changes: 3 additions & 0 deletions pkg/monitors/collectd/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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,
},
}
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 9 additions & 1 deletion selfdescribe.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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.",
Expand Down
1 change: 1 addition & 0 deletions tests/monitors/openstack/openstack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_openstack_default(devstack):
httpTimeout: 10.001
requestBatchSize: 10
queryServerMetrics: true
queryHypervisorMetrics: true
novaListServersSearchOpts:
all_tenants: "TRUE"
status: "ACTIVE"
Expand Down

0 comments on commit 3820130

Please sign in to comment.