ceilometer-polling(compute, central) -> ceilometer-notification(monasca-publisher on it) -> monasca-api ->(via kafka, persister)> influxdb
monasca agent is working fine with monasca.
Problem in ceilometer's monasca publisher code.
Sample from ceilometer:
if bacth not enabled:
{'name': 'disk.device.read.requests', 'timestamp': 1623233527556, 'value': 1, 'dimensions': {'datasource': 'ceilometer', 'control_plane': 'None', 'cluster': 'None', 'cloud_name': 'None', 'resource_id': '80991fd0-b048-4c33-aaa9-e58e64d0602f-vda', 'project_id': '6f5fbb1c01a241cd99719e2a513da444', 'user_id': '40f4d273269f45caac898638a03dc530', 'region': 'None', 'type': 'cumulative', 'unit': 'request', 'source': 'openstack'}, 'value_meta': {'event_type': 'None', 'audit_period_beginning': 'None', 'audit_period_ending': 'None', 'availability_zone': 'None'}}
if batch enabled:
{'name': 'disk.device.read.requests', 'timestamp': 1623233527556, 'value': 1, 'dimensions': {'datasource': 'ceilometer', 'control_plane': 'None', 'cluster': 'None', 'cloud_name': 'None', 'resource_id': '80991fd0-b048-4c33-aaa9-e58e64d0602f-vda', 'project_id': '6f5fbb1c01a241cd99719e2a513da444', 'user_id': '40f4d273269f45caac898638a03dc530', 'region': 'None', 'type': 'cumulative', 'unit': 'request', 'source': 'openstack'}, 'value_meta': {'event_type': 'None', 'audit_period_beginning': 'None', 'audit_period_ending': 'None', 'availability_zone': 'None'}},
{'name': 'disk.device.write.bytes', 'timestamp': 1623233528796, 'value': 0, 'dimensions': {'datasource': 'ceilometer', 'control_plane': 'None', 'cluster': 'None', 'cloud_name': 'None', 'resource_id': '80991fd0-b048-4c33-aaa9-e58e64d0602f-vda', 'project_id': '6f5fbb1c01a241cd99719e2a513da444', 'user_id': '40f4d273269f45caac898638a03dc530', 'region': 'None', 'type': 'cumulative', 'unit': 'B', 'source': 'openstack'}, 'value_meta': {'event_type': 'None', 'audit_period_beginning': 'None', 'audit_period_ending': 'None', 'availability_zone': 'None'}},
{'name': 'memory.resident', 'timestamp': 1623233530220, 'value': 31.76171875, 'dimensions': {'datasource': 'ceilometer', 'control_plane': 'None', 'cluster': 'None', 'cloud_name': 'None', 'resource_id': '80991fd0-b048-4c33-aaa9-e58e64d0602f', 'project_id': '6f5fbb1c01a241cd99719e2a513da444', 'user_id': '40f4d273269f45caac898638a03dc530', 'region': 'None', 'type': 'gauge', 'unit': 'MB', 'source': 'openstack'}, 'value_meta': {'event_type': 'None', 'audit_period_beginning': 'None', 'audit_period_ending': 'None', 'availability_zone': 'None'}}]}
ceilometer is having python-monascaclient installed. to interact with monasca:
def create(self, **kwargs):
"""Create a metric."""
url_str = self.base_url
if 'tenant_id' in kwargs:
url_str = url_str + '?tenant_id=%s' % kwargs['tenant_id']
del kwargs['tenant_id']
data = kwargs['jsonbody'] if 'jsonbody' in kwargs else kwargs
body = self.client.create(url=url_str, json=data)
return body
Issue:
It is expecting 'tenant_id' from ceilometer data
but in ceilometer there is 'project_id' e.g.
{'name': 'disk.device.read.requests', 'timestamp': 1623233527556, 'value': 1, 'dimensions': {'datasource': 'ceilometer', 'control_plane': 'None', 'cluster': 'None', 'cloud_name': 'None', 'resource_id': '80991fd0-b048-4c33-aaa9-e58e64d0602f-vda', 'project_id': '6f5fbb1c01a241cd99719e2a513da444', 'user_id': '40f4d273269f45caac898638a03dc530', 'region': 'None', 'type': 'cumulative', 'unit': 'request', 'source': 'openstack'}, 'value_meta': {'event_type': 'None', 'audit_period_beginning': 'None', 'audit_period_ending': 'None', 'availability_zone': 'None'}}
So, monasca client is not able to explicitly sent the tenant_id(or not going in if condition) as per above code in python-monascaclient.
Which means, no tenant_id for resource will be passed during post request from ceilometer to monasca-api.
In this case, user configured in ceilometer's monasca section will generate a token to interact with monasca-api and monasca-api use tenantID from this user's tenant.
Everytime in ceilometer, tenant_id will not pass and wrong(considering user's token) tenantId will be append by monasca.
Here multi-tenant will get fail.
Expectation:
Each user can view data/metrics from it's own tenant.
Due to problem in monasca publisher on ceilometer, it is not working as expected and wrongly data is fetting store in tsdb.
ceilosca is a ceilometer fork and not under the OpenStack telemetry project.