Commit Graph

26 Commits

Author SHA1 Message Date
wangzihao 3b91b33784 Remove six
Remove all six usage.

Change-Id: Ib2f0f6cf3b7f5d9ec20440fb81b09c1c083c67b0
Story: 2008305
Task: 41295
2020-11-20 09:35:23 +00:00
Witek Bedyk db01fe425b Migrate from ujson to simplejson
Additionally, temporarily set build-monasca-docker-image as non-voting
due to problems with buggy confluent-kafka 1.4.0 release, which prevents
building the Docker image.

Change-Id: I561ea633a09eb3d7468d2d55aa46d6fb3b2380ff
Story: 2007549
Task: 39390
2020-04-18 10:42:39 +02:00
Witek Bedyk d47bbae4e8 Use Confluent Kafka client
The change introduces the possibility to run the persister with the new
confluent-kafka client. It has to be enabled in the configuration file.

Story: 2003705
Task: 35858

Depends-On: https://review.opendev.org/675297
Change-Id: I8d9e173e9a252712fb285c0676c26334e1f677a7
2019-09-19 15:09:23 +02:00
Jui Chandwaskar d396753a83 Update pep8 checks
* Set max line length to 100
* Clean up code for pep8 checks

Change-Id: Ie00dc204f522fb2112f02f4151ec8a15d5523459
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
2018-04-11 14:16:27 +02:00
Tomasz Trębski e1a9b9a96a Integrate with oslo.conf and oslo.log
Change upgrades the monasca-notification to leverage
the capabilities of both oslo.log and oslo.conf:

- configuration of logging separated from application settings
- ability to enforce data types for application settings
- ability to use oslo.config-generator capabilities
- automatic configuration parsing done by oslo.cfg

That change will bring it closer to the rest of monasca
components where such transition has happened already.
However, in the rest of monasca, oslo.cfg was partially
or fully implemented whereas monasca-notification has
been relying on YAML based configuration file.

Therefore backward compatybility for such format will
be kept for now.

Story: 2000959
Task: 4093
Task: 4092

Change-Id: Ia75c3b60d0fada854178f21ca5ccb9e6a880f37f
2017-10-20 09:32:11 +02:00
Artur Basiak 1ee321bb05 Make code compatible with Python3.5
Add adjustments:
   - read configuration file in binary mode
   - remove extra encoding
   - check if string is binary class and convert it to
     standard string

Change-Id: I5f73b6b0e8b5592539e07fe66debf917540ce24c
Story: 2001124
Task: 4816
2017-08-10 07:12:26 +02:00
Artur Basiak 722ecaa7a5 Add config option for statsd
Add new section to config file with configuration for statsd
host and port. Add modification in notification engines.
According to the monasca-agent change:
https://review.openstack.org/#/c/381417

Change-Id: I6e99bae5e50f3670ae8b4a0c7ac5af3c747bcd68
2016-12-02 07:10:52 +01:00
Cao Xuan Hoang 69f4c2b8e3 Clean imports in code
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I3c5c7368fb006f3691d07cef9557c20a42cc5b76
2016-10-06 15:27:06 +07:00
Michael James Hoppal 063c4f1d1d Query database to see if the periodic notificiation changes
Also added notification id to notification object we construct in the
alarm processor

Change-Id: I6ccfffc9102bec8f670df13268e244cb0c998950
2016-08-29 15:11:20 -06:00
Michael James Hoppal 79189ca811 Adding support for periodic notifications
New periodic notification engine that will take a notification send it, and then
place it back onto the periodic notification topic. Once the alarm associated
with the notification has transitioned to a state that is different from the
original state the notification is removed from the queue.

Change-Id: Ie3103a0ec30abcd8dfc53869b1c3135953aabf3a
2016-05-09 08:18:11 -06:00
Ryan Brandt 97a401027a Change email notification format
Add severity to the subject line
Add up to 10 unique dimension sets in body
Add link and lifecycle state to email body

Change-Id: I85e2e9f2382c6ebadde072967e098e8109f65bfe
2016-01-29 16:42:56 -07:00
Michael James Hoppal 8f05261e6a Add in HP Copyrights
Change-Id: I54d8bb19e6cd44557cf4757bb1283c8b9821ba35
2016-01-27 12:56:23 -07:00
Michal Zielonka a82a49a1e8 Add configurable database setting (mysql, postgres, orm)
We used sqlalchemy.core for execute query for orm.
The configuration of db is based on monasca-api.
The default mode is mysql connection so we can use old configuration.

Change-Id: Iebb4d6dfca6d43298ced407178e7f9673a83a7ca
2015-08-04 22:34:57 +02:00
Joe Keen fe3707782a Added MySql reconnect and better error output
Better exception handing so that our exceptions don't get eaten with a general
GeneratorExit exception.

Attempt reconnect to MySQL under the assumtion that the connection timed out.

Change-Id: Ia1daa5cfb397fb2fb9c8f9bc07e99adba435ae38
2015-05-12 17:55:10 -06:00
Ryan Brandt ef0d82fbbc Changes to log messages to support unicode
Change-Id: Iefb3b4d577d8c4dc4d2b1ace5c155d2dc3d5ef9c
2015-05-05 16:54:32 -06:00
Craig Bryant c4b469c11d AlarmStateTransitionedEvent timestamp now in ms
This will ensure a unique timestamp. Influx V9 will only keep one
entry with the same timestamp

Some of the tests weren't using a numerica timestamp which caused
problems when the code tried to divide the timestamp by 1000

Change-Id: Ie0fefc61abe9a95503fa7611971a21ed2cb56224
2015-04-16 13:31:40 -06:00
Joe Keen 9f0e65028f Added retry engine to notification system
Change-Id: Iea1a05c1b7336b9e3e8aeb972e0f9ba1b7f74d69
2015-02-09 11:40:02 -07:00
Joe Keen 3eb169fac3 Notification engine refactored from many processes to one
Squished the notification down to one process in preparation for making
multiple engine instances able to talk to the same topic.

Added HA capabilities to the KafkaConsumer object.

Change-Id: Id4799d690c7caf10ae7ba89c2d4e0aeb76c54375
2015-01-30 11:59:57 -07:00
Tim Kuhlman 9b1df54682 Force mysql_passwd to a string
Fixes https://bugs.launchpad.net/monasca/+bug/1405027

Change-Id: I5d32eaa5e8d9cf219fc19bc917e9fa812616dd59
2015-01-05 09:42:39 -07:00
Tim Kuhlman 0ea7127a7a Fixes for statsd integration
The reuse of the monascastatsd module as a variable name seems ripe for
confusion so I fixed the naming.

Change-Id: Ib8e2e2abac606f0dc13a06d88ed4f5e3d635970a
2014-12-22 16:12:45 -07:00
Tim Kuhlman f85cc90f22 Added mysql ssl support
Change-Id: I274c58e3ebc05845bfb7992e4a2c5b68704f0e22
2014-12-03 16:12:43 -07:00
gary-hessler 9025d8b0e4 Switch to using monasca-statsd
Switch to monasca-statsd so we can send additional dimensions
for service and component with the statsd messages.

Change-Id: Ic6ff3b67b4148c070ec9eec9f9f990680b5e9f4c
2014-11-20 09:43:52 -07:00
Deklan Dieterly 2fea98ec2b Change alarm_id to alarm_definition_id in alarm_action
Conflicts:
	monasca_notification/processors/alarm_processor.py

Change-Id: Id47a8dbb9b8327cc73b9598369e50f17b862b40c
2014-10-31 15:45:59 -06:00
Craig Bryant eed5a4ad16 Changes for alarmed metrics
Use alarmDefintionId instead of alarmId to find the right notificaion.
Further changes are needed to complete this change.

Change-Id: I577559fd085261f01a36355095fa1c04a72fb9c9
2014-09-30 12:35:29 -06:00
Tim Kuhlman 8aae2c8829 Log mysql connection failures better.
Change-Id: Ic040939fc881aa62be8bee31f39a7624c8bc5e7d
2014-07-21 16:17:30 -06:00
Tim Kuhlman e6e54c6576 Rename to monasca, setup for tox, removed legacy bits
Removed manual tests which are no longer valid with a modern mini-mon
Removed debian creation bits all distribution is with pypi now
Minor pep8 fixes

Change-Id: I1f2fc4d0ad6375f4c39446f9627247945066e4ad
2014-07-16 15:59:00 -06:00