Tuesday, 2020-12-15

*** vishalmanchanda has joined #cloudkitty05:04
*** evrardjp has quit IRC05:33
*** evrardjp has joined #cloudkitty05:33
*** sboyron has joined #cloudkitty07:55
zigoHi.10:18
zigoHow can I check that the tenant fetcher is really finding my users, and that metrics from Telemetry are going in?10:18
zigoI can't get rating to work... :/10:19
zigoWhen I do "gnocchi metrics list" I do see something. Is there anything I can do further to check?10:22
*** vishalmanchanda has quit IRC10:22
*** vishalmanchanda has joined #cloudkitty10:30
*** vishalmanchanda has quit IRC13:52
mkarpiarzzigo: For fetchers, you should set "debug" to True in your Cloudkitty config and then you will see a line like this one in the cloudkitty-processor logs:13:54
mkarpiarz[Worker: 0] Tenants loaded for fetcher keystone13:55
zigoI do see it: [Worker: 0] Tenants loaded for fetcher keystone13:56
zigomkarpiarz: But "cloudkitty report tenant list" shows an empty list...13:56
mkarpiarzHave a loot at this patch:13:58
mkarpiarzhttps://opendev.org/openstack/cloudkitty/commit/4900e5d4ba9c1b927a2e6d1081dbdccb3b613c4113:58
mkarpiarzForgot to add that this line shows up even when no tenant hae been fetched. ;)13:59
mkarpiarzCheck your Cloudkitty config. Do you have "[fetcher_keystone]" or "[keystone_fetcher]" there?14:02
mkarpiarzAs for confirming metric collection, you can query the InfluxDB database Cloudkitty is using.14:04
mkarpiarzuse cloudkitty;14:04
mkarpiarzSELECT * FROM dataframes ORDER BY time DESC LIMIT 5;14:04
zigo0 tenants loaded for fetcher keystone ... :/14:05
zigoI have [fetcher]/backend=keystone14:05
zigoI'm using Ceph as backend, not influx.14:06
zigoInflux is unfortunately non-free in the cluster flavor...14:06
mkarpiarzAh, but you are using Ceph for Gnocchi metrics, right?14:09
mkarpiarzThese you should be able to see using the Gnocchi API.14:09
mkarpiarzHave you seen this: https://github.com/mkarpiarz/cloudkitty-playground/tree/gnocchi-collector ?14:10
mkarpiarzmetric_uuid=$(openstack metric list -f value | grep vcpus | cut -d' ' -f1)14:11
mkarpiarzopenstack metric measures show ${metric_uuid}14:11
mkarpiarzThis should show you a list with measurements for Gnocchi metrics.14:11
mkarpiarz(well, for the "vpus" metric)14:12
mkarpiarzCloudkitty will query your datastore with metrics (Gnocchi in this case) and store records for billable metrics in one supported databases:14:16
mkarpiarzhttps://docs.openstack.org/cloudkitty/latest/admin/configuration/storage.html14:16
mkarpiarzOnly influxdb and elasticsearch are supported for storage backend v2.14:16
mkarpiarzBack to the fetcher, in a working env I can see these are set:14:19
mkarpiarz[fetcher_keystone]/keystone_version = 3/auth_section = keystone_authtoken/region_name = RegionOne14:20
mkarpiarzAnd in the "[keystone_authtoken]" section I have auth_url, username, password, etc.14:21
zigoThanks, I'll try.14:23
mkarpiarzAlso, have you added the "rating" role to the user you want to bill?14:23
zigoAnd let you know.14:23
zigoYes, I have.14:23
zigoCurrently, for the "admin" user (before I do for the others...).14:23
zigoI do see measures:14:24
zigo# openstack metric measures show a4962215-a802-4436-ac16-623fbb4e238114:24
zigo+---------------------------+-------------+-------+14:24
zigo| timestamp                 | granularity | value |14:24
zigo+---------------------------+-------------+-------+14:24
zigo| 2020-12-15T11:00:00+00:00 |       300.0 |   2.0 |14:24
zigo| 2020-12-15T12:00:00+00:00 |       300.0 |   2.0 |14:24
zigo| 2020-12-15T13:00:00+00:00 |       300.0 |   2.0 |14:24
zigo| 2020-12-15T14:00:00+00:00 |       300.0 |   2.0 |14:24
zigo+---------------------------+-------------+-------+14:24
mkarpiarzYeah, this confirms metrics are there in Gnocchi.14:25
zigoI do have [fetcher_keystone]14:25
zigokeystone_version=314:25
zigoauth_section=keystone_authtoken14:25
mkarpiarzCheck credentials in the keystone_authtoken section then.14:27
zigoIt would yell...14:29
mkarpiarzWas this the command you run to add the rating role to admin?14:30
mkarpiarzopenstack role add --user cloudkitty --project admin rating14:30
zigoIs the problem that I don't have the right coordinator URL ?14:30
zigoopenstack role add --user admin --project admin rating14:30
mkarpiarzAha!14:31
mkarpiarzAnd what's the username set to in [keystone_authtoken]?14:32
mkarpiarzcloudkitty or admin?14:32
zigocloudkitty ...14:35
zigoOk, so this?14:36
zigoopenstack role add --user cloudkitty --project services rating14:36
mkarpiarzYes.14:36
zigoOk, I'm adding this to my notes at https://salsa.debian.org/openstack-team/debian/openstack-cluster-installer#enabling-cloudkitty-rating then.14:36
zigo:)14:38
mkarpiarzhttps://github.com/mkarpiarz/cloudkitty-playground/blob/gnocchi-collector/README.adoc14:38
zigoYeah, that was it !!! :)14:38
zigoThanks.14:38
zigoIt looks like the processor is ... well ... processing ! :)14:38
mkarpiarzCool!14:39
mkarpiarzNow you need to write a definition for the metric you want to bill and create a hashmap mapping.14:40
mkarpiarzAll commands you need should be in the README file I linked.14:40
mkarpiarzAnd a sample metric definition is here:14:41
mkarpiarzhttps://github.com/mkarpiarz/cloudkitty-playground/blob/gnocchi-collector/kolla/config/cloudkitty/metrics.yml14:41
mkarpiarzBear in mind offcial docs have sensible samples for metric definitions with Gnocchi as the collector.14:42
zigoI did ...14:43
zigomkarpiarz: I did this: https://salsa.debian.org/openstack-team/debian/openstack-cluster-installer#add-billing14:43
zigoThough I'm still getting no rating for the admin user.14:44
zigoMaybe it will work better with a non-admin user ?14:44
* zigo tries to create a new project and spawn a vm.14:44
zigoI'll also fix the coordinator URL to get the 3 processors to work ...14:45
mkarpiarzSure.14:47
zigoOh, I know why it's wrong, it looks like the directive changed.14:47
zigomkarpiarz: Do you happen to know when it went from [coordination]/backend_url to [orchestrator]/coordination_url ?14:48
zigoI mean, what OpenStack release ...14:48
mkarpiarzNo idea.14:49
zigoNever mind, I'll set both directives in my puppet ... :P14:49
mkarpiarzThere should be a note in release notes I'd expect.14:50
mkarpiarzGood job spotting this. :)14:51
* zigo rebuilds the cloudkitty package with the number of tenant patch, and uploads it to Debian unstable14:53
zigomkarpiarz: Does the processor know when there's a new admin to bill, or shall it be restarted each time I'm adding a new customer?14:55
*** sboyron has quit IRC14:56
mkarpiarzYou mean when you add the rating role to more projects? I think this check runs on each metric poll, so no need to restart, but can't guarantee that.15:02
*** sboyron has joined #cloudkitty15:14
*** sboyron has quit IRC15:51
*** sboyron has joined #cloudkitty15:52
openstackgerritGhanshyam proposed openstack/cloudkitty master: [goal] Deprecate the JSON formatted policy file  https://review.opendev.org/c/openstack/cloudkitty/+/76684218:27
*** sboyron has quit IRC21:02

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!