It's possible for Prometheus to return multiple metrics, where
each of them has different labels. Before this the client
would fail with error when using the default table formatter,
because of for example:
Row has incorrect number of values, (actual) 8!=9 (expected)
It was also possible to mismatch the label keys and values
for some of the rows.
This patch makes sure the label values are matched to the correct
keys. It also makes sure it uses all labels and it fills
missing values with empty strings for metrics, which don't have
that label defined.
Example table output:
+------------+----------+------------+----------------+-------+
| group | __name__ | job | instance | value |
+------------+----------+------------+----------------+-------+
| | up | sg-core | localhost:3000 | 1 |
| production | up | prometheus | localhost:9090 | 1 |
+------------+----------+------------+----------------+-------+
Example json output:
[
{
"__name__": "up",
"group": "",
"job": "sg-core",
"instance": "localhost:3000",
"value": "1"
},
{
"__name__": "up",
"group": "production",
"job": "prometheus",
"instance": "localhost:9090",
"value": "1"
}
]
Change-Id: Id0dfabf52fe0a21194c498f4aefa1bff1d3eeea9
This adds a new config option: "prometheus_ca_cert". If this
option is set, then it forces the client to use https to access
prometheus and it uses the specified ca cert to verify the
prometheus' certificate.
Change-Id: Iccb911a590d5b3b9a4c6ac08c4d020641c8094a9
* Add unit testing
* Fix code according to CI
This includes:
- formating changes
- rewording of some doc strings
- adding support to {label!~'value'} in rbac
* Add unit tests automation
* Fix CI automation
* Add requirements.txt
* Remove old observability client
* Add initial functionality for prometheus querying
* Fix a copy-paste error in get_client()
* Add additional functionality.
This commit adds:
- commands:
delete
clear-tombstones
snapshot
- Better rbac injection as well as a possibility
to disable rbac.
- Configuration of prometheus_client through
env variables and /etc/openstack/prometheus.yaml
* Make README up to date
* Implement Martin's PR comments
* Implement better support for label values in rbac
* PEP8
This patch adds basic functionality of the plugin. It successfully registers as openstackclient plugin and contains two basic observability commands:
- discover
- prepares ansible inventory file with overcloud and undercloud nodes and gather data for prometheus agent according to which nodes are scrapable
- setup
- starts proper ansible playbook based on component (currently only prometheus_agent is available)
Co-authored-by: Marihan Girgis mgirgisf@redhat.com
Partially-Implements: OSP-14664
Related: infrawatch/osp-observability-ansible#11