Hi Idan,





Sorry, maybe it's the issue of my OpenStack env. I'll check it later. Thanks~






BR,


dwj

























原始邮件




发件人:董文娟00101742
收件人: <[email protected]>;
抄送人: <[email protected]>;
日 期 :2017年10月30日 08:59
主 题 :答复: RE: [openstack-dev][vitrage] some error in Aodh datasource








Hi Idan,






Yes, it happens when Vitrage receives the Aodh alarm(event alarm) state change 
notification.


But for the event alarm and threshold alarms, they don't combine type dict and 
type Unicode.


So only gnocchi threshold alarm needs to encode.


I think gnocchi threshold alarm need to handle the state change notification 
separately, 



otherwise the event alarm and threshold alarm will raise exception as shown in 
the log below.


What do you think?





BR,


dwj






























发件人: <[email protected]>;
收件人:董文娟00101742;
抄送人: <[email protected]>;
日 期 :2017年10月29日 17:04
主 题 :RE: [openstack-dev][vitrage] some error in Aodh datasource








Hi dwj,


 


In this patch I added support for gnocchi threshold alarm.


This kind of alarm combine type dict and type Unicode. This occurs when 
receiving notification about state transition from insufficient data to alarm.


 


In order not to make a major change in the code structure this type of error 
should occur in event alarm (because it entirely type dict). It is caught in 
_convert_alarm_state_transition_event.


 


In the upcoming changes in Aodh datasource (because of Ceilometer’s API is 
being removed)  we might need to insert some changes so 
_convert_alarm_state_transition_event will receive also the alarm type (event, 
gnocchi..).


 


Let me know if I can be of any help.


 


Thanks.


BR


 


 


Idan kinory


 





 


From: [email protected] [mailto:[email protected]] 
 Sent: Friday, October 27, 2017 10:51 AM
 To: Kinory, Idan (Nokia - IL/Kfar Sava) <[email protected]>
 Cc: Afek, Ifat (Nokia - IL/Kfar Sava) <[email protected]>; 
[email protected]
 Subject: [openstack-dev][vitrage] some error in Aodh datasource


 

Hi Idan Kinory,

 

I deploy Vitrage with devstack using master branch.

Currently I found a error in Aodh datasource when I change the Aodh alarm 
state(alarm_state_transition notification).

 

The error log is as follows:


Oct 27 07:30:50 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:30:50.429 
9880 DEBUG vitrage.datasources.listener_service [-] EVENT ENQUEUED:
 Oct 27 07:30:50 dwj-vitrage vitrage-collector[9880]: {'description': u'Alarm 
when * event occurred.', 'resource_id': None, 'vitrage_entity_type': 'aodh', 
'timestamp': u'2017-10-26T06:37:41.353447', 'state_timestamp': 
u'2017-10-27T07:09:06.636137', 'name': u'dwj',  'vitrage_datasource_action': 
'update', 'severity': u'low', 'vitrage_sample_date': '2017-10-27 
07:30:50.382730+00:00', 'vitrage_event_type': u'alarm.deletion', 'enabled': 
True, 'alarm_id': u'9578d0eb-5d09-49a2-80e9-fb1a6c7ce7e9', 'state': u'alarm', 
'repeat_actions':  False, 'event_type': (u'*',), 'project_id': 
u'378f268c64fc42c28226704dd71f37fe', 'type': u'event'} _enqueue_events 
/opt/stack/vitrage/vitrage/datasources/listener_service.py:106
 Oct 27 07:31:02 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:02.327 
10104 DEBUG vitrage.datasources.services [-] start get changes _get_changes 
/opt/stack/vitrage/vitrage/datasources/services.py:119
 Oct 27 07:31:02 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:02.331 
10104 DEBUG vitrage.datasources.services [-] end get changes _get_changes 
/opt/stack/vitrage/vitrage/datasources/services.py:126
 Oct 27 07:31:12 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:12.087 
9880 ERROR vitrage.datasources.aodh.driver [-] Failed to Convert alarm state 
transition event - 'dict' object has no attribute 'encode': AttributeError: 
'dict' object has no attribute  'encode'
 Oct 27 07:31:12 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:12.087 
9880 ERROR vitrage.datasources.aodh.driver Traceback (most recent call last):
 Oct 27 07:31:12 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:12.087 
9880 ERROR vitrage.datasources.aodh.driver   File 
"/opt/stack/vitrage/vitrage/datasources/aodh/driver.py", line 352, in 
_convert_alarm_state_transition_event
 Oct 27 07:31:12 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:12.087 
9880 ERROR vitrage.datasources.aodh.driver     unicode_to_str = 
state.encode("ascii")
 Oct 27 07:31:12 dwj-vitrage vitrage-collector[9880]: 2017-10-27 07:31:12.087 
9880 ERROR vitrage.datasources.aodh.driver AttributeError: 'dict' object has no 
attribute 'encode'

I noticed that you fix the code in this patch(Line 352-368): 
https://review.openstack.org/#/c/501701/4/vitrage/datasources/aodh/driver.py

Can you please explain why? Thanks.

 

BR,

dwj
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [email protected]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to