Commit Graph

67 Commits

Author SHA1 Message Date
Fabian Reinartz d6e64dccc5 provider/boltmem: make alerts purely in-memory.
Initial testing has shown BoltDB in plain usage to be a bottleneck
at a few thousand alerts or more (especially JSON decoding.
This commit actually makes them purely memory as a temporary solution.
2016-07-07 09:45:12 +02:00
Fabian Reinartz ee37ea6965 provider/boltmem: add in-memory silence cache 2016-06-22 14:29:23 +02:00
Fabian Reinartz 639a4e9dc4 provider/boltmem: add license headers 2016-05-03 18:36:25 +02:00
Fabian Reinartz 0cd725ef3a provider/boltmem: fix naming, add doc comments 2016-05-03 12:46:34 +02:00
Fabian Reinartz 3980a6904e provider/boltmem: properly compare timestamps
Depending on the environment the timestamp internal fields
are different to handle timezones.
Thus a reflect.DeepEqual comparison falsely evaluates to
false.
This commit manually compares timestamps via the time.Time.Equal
method to circumvent the issue.
2016-05-03 12:46:34 +02:00
Fabian Reinartz d8efdde515 main: Use bolt based storage 2016-05-03 12:46:34 +02:00
Fabian Reinartz cc5aab6cff provider/boltmem: add alert subscription.
This commit implements the Subscribe() and GetPending()
methods for the bolt based alert provider.
2016-05-03 12:46:34 +02:00
Fabian Reinartz 0e954e10cf provider/boltmem: Add Put/Get for BoltDB provider 2016-05-03 12:46:34 +02:00
Fabian Reinartz a66ea61041 provider/boltmem: Implement Silences.Mutes()
This commits implements the Mutes() method for the boltmem silence
provider.
2016-05-03 12:39:22 +02:00
Fabian Reinartz f0cbdbec51 provider/boltmem: Implement Silences.All()
This commits adds the All() method to the Silence provider.
2016-05-03 12:39:21 +02:00
Fabian Reinartz f833fe5073 provider/boltmem: Implement silence deletion 2016-05-03 12:39:21 +02:00
Fabian Reinartz 9e4dfb32ca provider/boltmem: Implement set/del silences.
This commit implements creation and setting of silences.
They are stored as JSON objects in BoltDB and addressed by a unique
ID assigned on initial creation.
2016-05-03 12:39:21 +02:00
Fabian Reinartz 0019d4f858 provider/boltmem: Implement Notify, add dummies
This commit creates dummy implementations of the provider interfaces
for the boltmem provider.
It implements the NotifyInfo provider in BoltDB.
2016-05-03 12:39:21 +02:00
Fabian Reinartz d2c0cd6832 Revert back to one DB file 2016-03-15 20:47:54 +01:00
Fabian Reinartz d0e35c109e Separate alert and silence DB.
This commit separates out the silences and alert/notify databases.
Additional alert FP index was added and a locking of the
silences DB access added.
2016-03-15 20:39:00 +01:00
Fabian Reinartz 3620d996cf Serialize all database accesses 2016-02-13 09:21:46 +01:00
Fabian Reinartz 219fd1a293 Vendor go-sqlite3 library 2015-12-08 12:16:48 +01:00
Fabian Reinartz a50171cf39 Remove old providers and dependencies 2015-12-08 12:16:48 +01:00
Fabian Reinartz cadae2a9e5 Implement SQLite persistence provider 2015-12-08 11:55:28 +01:00
beorn7 93ffa534a5 PR with changes after code review
Now to be reverse-reveiewed.
2015-11-23 18:24:57 +01:00
Fabian Reinartz 2d8829d751 Remove data race from alert subscription 2015-11-19 13:49:32 +01:00
Fabian Reinartz e4e594d826 Unify receiver naming 2015-11-10 13:47:04 +01:00
Fabian Reinartz d4e2bdc36f Track and expose silenced/inhibited status of alerts 2015-11-09 14:34:57 +01:00
Fabian Reinartz 8d2bbc348b Simplify and rename notification info struct.
The delivered field was previously unused and is removed by this commit.
Only successful notifications are stored. The type was renamed to NotifyInfo.
2015-11-06 10:09:39 +01:00
Fabian Reinartz d365519ed3 Temporary fix for getting pending alerts 2015-10-20 12:38:42 +02:00
Fabian Reinartz 329b36594b (u)int64 fixes, UI time range improvements 2015-10-20 07:12:28 +02:00
Fabian Reinartz a515b22325 Convert all fingerprints to int64 before/after database interaction 2015-10-19 14:21:50 +02:00
Fabian Reinartz 69a3cf1c8c Fix SQL statements to find overlapping alerts 2015-10-15 16:22:54 +02:00
Fabian Reinartz 998ae4369e Fix querying pending alerts.
This commit retrieves the correct pending alerts
and introduces a workaround to a bug in the SQL library.
2015-10-14 12:52:42 +02:00
Fabian Reinartz 5dc2f6e9b1 Add license headers 2015-10-11 17:24:49 +02:00
Fabian Reinartz ce74f8363b Simplify initialization
No longer update components based on a new configuration. Generally,
destroying and recreating has no performance impact and is less
error-prone.
This also removes the Reloadable interface and simplifies the entire
startup contraption.
2015-10-11 16:54:39 +02:00
Fabian Reinartz aec79600d9 Fix pending SQL expression 2015-10-07 10:59:20 +02:00
Fabian Reinartz cf5d4fc2e4 Fix various SQL statements 2015-10-07 00:46:23 +02:00
Fabian Reinartz f067c96525 Use full SQL persistence, init DB in main 2015-10-06 21:10:24 +02:00
Fabian Reinartz cc5662f1e8 Integrate alert provider with notify persistence 2015-10-06 21:07:16 +02:00
Fabian Reinartz e7d45c6a64 Make SQL calls more readable 2015-10-06 20:50:11 +02:00
Fabian Reinartz 77cce75c05 Simplify notify provider interface 2015-10-06 20:40:52 +02:00
Fabian Reinartz 5afb402a6c Add SQL notify info provider 2015-10-06 20:40:39 +02:00
Fabian Reinartz f4ff8e12cb Initial version of SQL alert provider 2015-10-06 15:36:38 +02:00
Fabian Reinartz ff29710178 Fix silence encoding/decoding in SQL provider 2015-10-06 13:56:02 +02:00
Fabian Reinartz de18b1b70c Make data directory configurable 2015-10-06 12:36:33 +02:00
Fabian Reinartz 826a51cafb Complete and use the SQL backed silence provider 2015-10-06 12:23:48 +02:00
Fabian Reinartz e15c19ad0d Properly include creation timestamp 2015-10-06 12:10:42 +02:00
Fabian Reinartz 8d28d1dee5 Initial SQL provider for silences 2015-10-06 11:41:34 +02:00
Fabian Reinartz ecf6a7b48f Consider alerts without notify data pending 2015-10-05 16:51:17 +02:00
Fabian Reinartz b0ca8f7c1c Consider unresolved alerts always pending 2015-10-05 16:09:55 +02:00
Fabian Reinartz 7271ea0907 Fix listener broadcasting implementation 2015-10-04 22:58:33 +02:00
Fabian Reinartz 856d5091c1 Implement merging of alerts on insert 2015-10-02 16:52:04 +02:00
Fabian Reinartz 4e381c7e64 Store model.Silence and restore types.Silence correctly 2015-10-01 22:16:44 +02:00
Fabian Reinartz fdf4d80003 Implement silence provider check for bad insert 2015-10-01 20:58:14 +02:00