Use raw data storage for events to collect more info

OSprofiler uses free-form notifications in fact, so any kind of data
might be included to the profiling trace. To be able to do that in
Ceilometer case, that use explicit event definitions, we need to
use its raw data events storage, that will include all notification
message.

To use this feature the following section needs to be set in
ceilometer.conf:

[event]
store_raw = info

where info is the notification level used.

Warning: if raw data is used, ALL events that come into ceilometer
with info notification level will be stored with raw data included,
there is no way to set this parameter only for profiler.* events.

Change-Id: I3ebf8ee34ac01e68d530a676ae840f7a62d897bd
This commit is contained in:
Dina Belova 2016-01-18 13:45:59 +03:00
parent 85b47a1d80
commit 8eb4a53de7
2 changed files with 25 additions and 32 deletions

View File

@ -77,19 +77,14 @@ def parse_notifications(notifications):
"name": name.split("-")[0],
"project": project,
"service": service,
"meta.host": host,
"host": host,
},
"trace_id": trace_id,
"parent_id": parent_id,
}
skip_keys = ["base_id", "trace_id", "parent_id",
"name", "project", "service", "host", "timestamp"]
for k in traits:
if k["name"] not in skip_keys:
result[trace_id]["info"]["meta.%s" % k["name"]] = k["value"]
result[trace_id]["info"]["meta.raw_payload.%s" % name] = n.get(
"raw", {}).get("payload", {})
if name.endswith("stop"):
result[trace_id]["info"]["finished"] = timestamp

View File

@ -352,34 +352,32 @@ class CeilometerParserTestCase(test.TestCase):
]
expected = {"children": [
{"children": [
{"children": [],
"info": {"finished": 76,
"host": "ubuntu",
"meta.db.params": "[]",
"meta.db.statement": "SELECT 1",
"meta.host": "ubuntu",
"name": "db",
"project": "keystone",
"service": "main",
"started": 56},
"parent_id": "06320327-2c2c-45ae-923a-515de890276a",
"trace_id": "1baf1d24-9ca9-4f4c-bd3f-01b7e0c0735a"}],
"info": {"finished": 0,
"host": "ubuntu",
"meta.host": "ubuntu",
"meta.method": "POST",
"name": "wsgi",
"project": "keystone",
"service": "main",
"started": 0},
"parent_id": "7253ca8c-33b3-4f84-b4f1-f5a4311ddfa4",
"trace_id": "06320327-2c2c-45ae-923a-515de890276a"},
{"children": [{"children": [],
"info": {"finished": 76,
"host": "ubuntu",
"meta.raw_payload.db-start": {},
"meta.raw_payload.db-stop": {},
"name": "db",
"project": "keystone",
"service": "main",
"started": 56},
"parent_id": "06320327-2c2c-45ae-923a-515de890276a",
"trace_id": "1baf1d24-9ca9-4f4c-bd3f-01b7e0c0735a"}
],
"info": {"finished": 0,
"host": "ubuntu",
"meta.raw_payload.wsgi-start": {},
"name": "wsgi",
"project": "keystone",
"service": "main",
"started": 0},
"parent_id": "7253ca8c-33b3-4f84-b4f1-f5a4311ddfa4",
"trace_id": "06320327-2c2c-45ae-923a-515de890276a"},
{"children": [],
"info": {"finished": 41,
"host": "ubuntu",
"meta.host": "ubuntu",
"meta.method": "GET",
"meta.raw_payload.wsgi-start": {},
"meta.raw_payload.wsgi-stop": {},
"name": "wsgi",
"project": "keystone",
"service": "main",