diff --git a/ceilometer/event/converter.py b/ceilometer/event/converter.py index 7a22ab25..050cc326 100644 --- a/ceilometer/event/converter.py +++ b/ceilometer/event/converter.py @@ -154,6 +154,12 @@ class EventDefinition(object): DEFAULT_TRAITS = dict( service=dict(type='text', fields='publisher_id'), request_id=dict(type='text', fields='_context_request_id'), + project_id=dict(type='text', fields=['payload.tenant_id', + '_context_tenant']), + user_id=dict(type='text', fields=['payload.user_id', + '_context_user_id']), + # TODO(dikonoor):tenant_id is old terminology and should + # be deprecated tenant_id=dict(type='text', fields=['payload.tenant_id', '_context_tenant']), ) diff --git a/doc/source/events.rst b/doc/source/events.rst index 3ea27a31..9091d5ed 100644 --- a/doc/source/events.rst +++ b/doc/source/events.rst @@ -126,6 +126,8 @@ all events if the notification has the relevant data: * service: (All notifications should have this) notification's publisher * tenant_id * request_id +* project_id +* user_id These do not have to be specified in the event definition, they are automatically added, but their definitions can be overridden for a given diff --git a/etc/ceilometer/event_definitions.yaml b/etc/ceilometer/event_definitions.yaml index ed47fe0f..5a1ae7f5 100644 --- a/etc/ceilometer/event_definitions.yaml +++ b/etc/ceilometer/event_definitions.yaml @@ -331,6 +331,10 @@ fields: ['payload.ipsec_site_connection.id', 'payload.id'] - event_type: '*http.*' traits: &http_audit + project_id: + fields: payload.initiator.project_id + user_id: + fields: payload.initiator.id typeURI: fields: payload.typeURI eventType: