diff --git a/osprofiler/parsers/ceilometer.py b/osprofiler/parsers/ceilometer.py index a87b319..b267979 100644 --- a/osprofiler/parsers/ceilometer.py +++ b/osprofiler/parsers/ceilometer.py @@ -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 diff --git a/osprofiler/tests/parsers/test_ceilometer.py b/osprofiler/tests/parsers/test_ceilometer.py index ffc548e..103f244 100644 --- a/osprofiler/tests/parsers/test_ceilometer.py +++ b/osprofiler/tests/parsers/test_ceilometer.py @@ -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",