Commit Graph

205 Commits

Author SHA1 Message Date
Witold Bedyk 77887bbf05 Workaround to avoid surefire plugin error
* do not use system classloader
* upgrade maven-surefire-plugin to ver. 2.22.1

Change-Id: I8bc83a59164c4a79bae036600cacb450cdc8feb9
Story: 2004256
Task: 27792
2018-11-05 14:14:10 +01:00
Zuul f08e707b16 Merge "Upper the pom version to 1.3.0" 2017-12-20 13:37:51 +00:00
James Gu 5891ee07c2 Upper the pom version to 1.3.0
Increase the pom version to 1.3.0 after adding cassandra support.

Change-Id: I0c6c1d027362a0babb5d7a5473c93afc3a72bb09
2017-12-19 13:12:53 -08:00
James Gu 9258e7efc2 Add Cassandra db support
Added Cassandra configuration Java class in the common project similar
to existing db.

Change-Id: I9aa250bab206438f9b98bd211d472c0d8fe12bde
story: 2001231
task: 5957
2017-12-04 20:27:15 +00:00
Witold Bedyk ca7c333cf6 Revert "Revert "Release version 1.2.1 for Java""
This reverts commit 251792afa0.

Change-Id: Ib3da5c9e1f6e5e2d6f77269129bd769179bfd3be
2017-02-15 13:43:52 +00:00
Tomasz Trębski 251792afa0 Revert "Release version 1.2.1 for Java"
This reverts commit cdfc99bd55.

Change-Id: I8569984c7013321052cd1d1c02f17c606d26fde3
2017-02-15 11:49:35 +00:00
Witold Bedyk cdfc99bd55 Release version 1.2.1 for Java
Change-Id: Ia344f1a5e49e3ec9724135df8e32cd8f6734fa4e
2017-02-14 17:28:12 +01:00
Jenkins 6dc0af93b1 Merge "Fix crash-loop in thresholder caused by floating point numbers used as dimension filter" 2016-12-19 23:51:23 +00:00
Joachim Barheine b988eb855c Fix crash-loop in thresholder caused by floating point numbers used as dimension filter
Example: avg(some_timer{quantile=0.99}) > 0.1)

Changes:
* add DECIMAL (floating point value) to allowed tokens for dimensions

Without this fix, an alarm-definition like the above one once injected
through the Python API will break the Java-ORM layer because the
alarm-definition cannot be parsed by the generated ANTLR parser.
As a consequence the thresholder worker will terminate, leading to a
crash-cycle. I could not find a way to make the ORM-layer ignore
non-parseable alarm-definitions. So maybe this fix should be
complemented by an extension of the Python API that uses exactly the
same ANTLR grammar to validate incoming alarm-definitions.

Change-Id: Ibbd41e1b817ebadc74b1b4a677db898cfa173ccb
2016-12-02 09:32:48 +00:00
Witold Bedyk f215d24eab Change version number to 1.2.0
Change-Id: Ic385ad5a8a5e51cf20456fce2f3b5963f84d90c0
2016-11-22 14:20:14 +01:00
Craig Bryant 06c23a1ade Always put value in first bucket if force is set
For a last function, the only values that matters is the last
one so always add it to the first window. This avoid the problem
where an OK value may be in a future window but the current window
has an older alarm value.

Change-Id: I20f8e91da266fdb917dd36ded60d1a5c608b74d0
Closes-Bug: #1618641
2016-08-30 16:59:39 -06:00
Jenkins 1ad8b00ae2 Merge "Reconnect to auth url in case of ClientProtocolException" 2016-08-20 03:41:49 +00:00
cindy oneill 5ea4d3cdf9 Reconnect to auth url in case of ClientProtocolException
We had a case where the authorization VIP was reset after the
monasca-api started.  The auth connection pool did not try to
reconnect since we did not meet the configured idle time, and
we had to restart the monasca-api.  This fix will allow the
monasca-api to reconnect the auth pool connections when we
get an exception.

Change-Id: I7e45970360720193b2d0ba27964bc22f66db79d3
2016-08-19 13:00:23 -06:00
Jenkins d13ba52bff Merge "Change Enum to String for AlarmNotificationMethodType" 2016-08-05 21:03:17 +00:00
haali1 b1569e5971 Change Enum to String for AlarmNotificationMethodType
This is required since we have changed NotificationMethodType to
String.  This change will cause build error in Monasca-api where
enum.name() is used. Once this merges, that needs to be fixed

Change-Id: I69a0c2ae03d4c02de161b21d78d115e71c798226
2016-08-03 13:27:08 -07:00
Craig Bryant 6a67fecc80 Add Last function
Add the LAST function to the Java parser and its associated classes.
It will save the last value received by its timestamp

Update SubAlarmDb to have a state field. This will be used in the
Threshold Engine for the new LAST function

Add a force argument to SubAlarmStats.addValue() because the
Threshold Engine will always need to add the values for the alarm
because they are only sent once

The changes to Java Monasca API and Monasca Thresh for this last-value
will require these changes, first

Also, remove all trailing spaces from AlarmExpression.g4

Change-Id: Ie3192370057676e89bfebbc5ce4243b1a3ecf0ea
Implements: Blueprint last-value
2016-07-27 12:44:09 -06:00
haali1 0d5a286c4f Add entity for notification_method_type table
Change-Id: I85142882654f65bbf9b47b661484a7d0ccf48ea2
Partially-implements: blueprint notification-engine-plugin
Implements: blueprint Notification Engine Plugin System
2016-07-22 11:35:14 -07:00
Craig Bryant e84ab435cd Add Conversions.variantToBoolean to fix API bug
Also, add tests of Conversions.variantToBoolean

Change-Id: I07bc8a84d511d36122ee8ffd153ae0961b77f65d
2016-06-23 12:20:45 -06:00
Tomasz Trębski b338b78907 (Non)deterministic support for alarms
Alarms can be created with deterministic keyword.
'deterministic' can be passed as part of alarm expression using:

 * keyword deterministic

If 'deterministic' is not found in expression it is assumed
to be 'false'.

Implements: blueprint alarmsonlogs
Change-Id: Ia42f9a1be37c31416bdac341b092fe527f860c16
2016-06-06 06:39:41 +02:00
Jenkins 89fee08dbc Merge "Add Period to hibernate notification method" 2016-05-07 22:24:20 +00:00
Michael James Hoppal 64558a1f34 Add Period to hibernate notification method
Created a new constructor including the new field. We have both
so we can support with or without passing in the period
which will help us with supporting the old API and the new API.

Once the transition occurs with the new API will remove the old
constructor

Change-Id: Idf0db02f51762633db6ccb60eeca2eb780c70e29
2016-05-05 08:13:04 -06:00
Brad Klein 896817f2d1 Log the end of the token which varies by token
Turns out the beginning of the token is largely the same
and not very meaningful in a log.  Instead log the end
of the token which should be different between legitimate
tokens.

Change-Id: I805965cc67d75ec975d2d26951fa9396e5397ede
2016-04-18 13:58:32 -06:00
Brad Klein b1b3b3f1d7 Don't log the entire token if auth failure
This change comes as a recommendation from our keystone
engineer, not good practice to log full tokens.  Also change
this log message:

'monasca.common.middleware.TokenAuth: 401 No token found.'

to debug level to avoid filling the log with these
messages as the result of a load balancer calling HEAD
without a token.

Change-Id: I6a04e98c398e163fb972020be1e580869b2538d7
2016-04-12 10:25:21 -06:00
Craig Bryant 0ea1032d90 Use SimpleDateFormat in thread safe construct
This was seen in a monasca-api.log:

ERROR [2016-02-13 17:18:41,546] monasca.common.middleware.TokenExceptionHandler:
Http Client Exception java.lang.NumberFormatException:
multiple points com.google.common.util.concurrent.UncheckedExecutionException:
java.lang.NumberFormatException: multiple points

Search shows that this can be caused by using a SimpleDateFormat concurrently
in two or more threads. SimpleDataFormat is not Thread Safe.

Use ThreadLocal to access SimpleDateFormant safely

Change-Id: Id12e8da8acc8b8a36be2504b55a219eef7293d44
2016-02-14 12:12:36 -07:00
Craig Bryant 9e0f8bb9fd Check TimeZone equality using equals
Java != does not work like python !=

Change-Id: Iab7e3f6e32580c155fe7d4880ca3b6cba2bb2046
2016-02-04 13:14:21 -07:00
Craig Bryant 746b45e7d2 Skip a test that fails if the server's time is UTC
This was causing some builds to fail

Change-Id: I9d8b1b287768250861166d03306bf62d0889db5e
2016-02-03 11:27:48 -07:00
Ryan Brandt acf2a3e779 Adjust copyright for AlarmSeverity
Missed the copyright in https://review.openstack.org/#/c/273745/

Change-Id: Id8b44238c2c4b6ac46a1b1b4d1b15c50396cbf78
2016-01-29 08:13:02 -07:00
Ryan Brandt 635b4f7f04 Add fromString and fromJson to AlarmSeverity
Change-Id: I8fc51565df2289d1ff17c90c8553f5ebb07d1a0c
2016-01-28 13:38:02 -07:00
Jenkins c57410136b Merge "Pass link and lifecycle state in state transitions" 2016-01-27 19:42:55 +00:00
Ryan Brandt 2c2b8c7085 Pass link and lifecycle state in state transitions
Requires changes to monasca-api, monasca thresh to use

Change-Id: I7b03be0c28638ae5fd7dae7c6566036acb94797f
2016-01-19 14:04:39 -07:00
Jenkins b4dcb898ee Merge "Fix connRetryInterval parameter interpreted as milliseconds" 2016-01-07 01:50:13 +00:00
Deklan Dieterly 3a54ef041c Upgrade to Kafka 0.8.2.2
Upgrade Kafka to current stable release - 0.8.2.2.
Upgrade Scala version to 2.11.

Change-Id: I4cd344111f6db2f59434555d584a4c4ff7f201e4
2015-12-07 15:01:37 -07:00
Shinya Kawabata a2148074c5 Fix connRetryInterval parameter interpreted as milliseconds
Change-Id: I8906e952752f6a7395293f5b42943d411b71f10f
Closes-Bug: #1522116
2015-12-07 12:11:32 +09:00
Thomas Graichen 9b7a364a27 add adminUserDomainId and adminUserProjectId support to monasca-api
add support to scope the user or project with the DomainId and not only the
DomainName as i added it some weeks ago to the monasca-api.

this change basically completes
  https://review.openstack.org/#/c/215146/
  https://review.openstack.org/#/c/215147/

Change-Id: Ife3eedc83e7502bad7e2613121ca288958954a31
Closes-Bug: #1517493
2015-11-18 15:41:59 +01:00
venkatamahesh 8a9d5b2af2 Change repositories from stackforge to openstack
Change-Id: I4420be590209e58e52223fc9f267500c9d1ddfb0
2015-10-19 09:50:12 +05:30
Ben Motz 792dd69a3b Fix files which had a mix of tabs and spaces
Change-Id: I5dd646847a2161b574d61bdb4c32c3811cf38b30
2015-10-08 09:49:48 +01:00
Lukasz Zajaczkowski a9934846d5 Fix for decimal separator during type conversion
- fix prevents situation when decimal
separator for default locale
is set to comma instead of dot.

Change-Id: I667682e4ed5e1d69e23ac2e82922cca024d1c467
2015-10-01 13:31:11 +00:00
Tomasz Trębski fc30e21e5c Time zone fix
- removed unused dependencies
- matched joda to entire monasca
- switched to standard java date + added explicit UTC

Change-Id: I04e986097010792aed772e83e529edb6d88a2125
2015-09-28 13:22:33 +02:00
Jenkins df99b11a40 Merge "Add adminUserDomainName and adminProjectDomainName to monasca-api" 2015-09-17 20:39:50 +00:00
Roland Hochmuth 6cdf714956 Add support for drizzle jdbc connector
Mysql jdbc connector returns an Integer when querying period and period.
Drizzle jdbc connector returns a Long. Adding appropriate conversions
that are used by monasca-api and monasca-thresh.

Change-Id: I4282b7de3fcbd82b3196bce1b4379076eff60bbc
2015-09-03 13:53:28 -06:00
Thomas Graichen 4a4ec859bd Add adminUserDomainName and adminProjectDomainName to monasca-api
add adminUserDomainName and adminProjectDomainName to api-config.yaml
to scope the username or projectname with a domainname

Change-Id: I12e0a1594961ef15eac6e401521d05a15a2014ad
Closes-Bug: #1484594
2015-08-31 13:04:47 +02:00
Tomasz Trębski 6c56dc799e [monasca-common] Hibernate support added
- refactored code to match java guidelines
- added missed indexes
- fixed invalid string lengths according to latest mon.sql from ansible-monasca-schema
- introduced relations
- using ordinal for enum fields

Change-Id: Ic84bf542c10ff714885c7a53bb9cbe3a2fb728cd
2015-08-31 07:20:35 +00:00
Craig Bryant fd5c41d720 Threshold Engine is rejecting valid measurements
In the default case of a period being 60 and the evalation period being 60, the
window was being alternately slid 0 slots and then 2 slots. This caused it to
reject some recent measurements.

To illustrate what was happening, assume a SlidingWindow with a period of 60, and
a viewEndTimestamp of 60, and the AlarmDelay default of 30 seconds.  AlarmDelay is
used to increase the likliehood a metric arrives before the window is evaluated.
Also assume the evaluation period is happening at 20 seconds after every minute.

On the first one, at time 20, the time is not past the viewEndTimeStamp so nothing
happens. On the second one, at time 80, the time is past the viewEndTimeStamp but
the window doesn't slide because the time has be > viewEndTimestamp + alarmDelay.
At time 140, time is > viewEndTimestamp + alarmDelay so the window is slid. However,
since the alarmDelay wasn't being accounted for in the number of slots to slide, it
was sliding it one too far. On the next period it wouldn't slide at all and then
the next one it would do two again.

This was fixed by accounting for alarmDelay when calculating the number of slots to
slide

Change-Id: I4fcfd41f2de515684b3d0054f9c46c925ee4807b
2015-08-26 16:50:14 -06:00
Jenkins ca45f80fbb Merge "Ensure threshold is always printed as a decimal" 2015-08-20 17:26:31 +00:00
Jenkins cb06432fef Merge "Allow spaces and apostrophes in dimensions" 2015-08-19 16:18:50 +00:00
Craig Bryant d3354d10ef Ensure threshold is always printed as a decimal
If threshold is very large, for example, 21474836480, it would get
printed using scientific notation. If that expression was then used
to recreate the AlarmSubExpression, it would fail because the parser
didn't handle scientific notation.

So, instead use DecimalFormat to ensure a valid decimal number without
scientific notation. This then limits the threshold to 15 decimal
places, but that should be enough. It would be better to have no limit
but I have not been able to find a way to do that.

Change-Id: I0511bd73a0ab65498dd615d8f5049b5663720b6a
2015-08-14 13:15:51 -06:00
Deklan Dieterly 908bd87609 Make Monasca-API recover from Keystone failures
Fixes JAH-1987.

Fixes "API is failing keystone authentication and never recovering".

Make Monasca-API release HTTP connection in finally clause for Keystone
requests.

Change-Id: Ia4c9899a311794cad8f2fa538fce11bcc265a7e2
2015-08-12 15:23:49 +00:00
Ryan Brandt 41457907ab Allow spaces and apostrophes in dimensions
Change-Id: I0f6a00496e65eeadb946849e68107321310a1a11
2015-08-06 13:59:46 -06:00
Jenkins de87b63c9b Merge "jah-1957" 2015-07-24 20:27:17 +00:00
Deklan Dieterly 91afbf3151 jah-1957
Fix case sensitivity of alarm state in alarm-list

'monasca alarm-list --state=ok' will work now.

Change-Id: I905cba63e07857d1d5d1ab7208af2afda5321fd6
2015-07-24 14:10:10 -06:00