Skip to content

Commit

Permalink
Update API to be RESTful
Browse files Browse the repository at this point in the history
Update CLI to match API concepts
Centralized Storage mechanism for all Kapacitor data.
  • Loading branch information
nathanielc committed May 4, 2016
1 parent aa267cf commit 5149786
Show file tree
Hide file tree
Showing 93 changed files with 9,512 additions and 4,177 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,55 @@

### Release Notes

>**Breaking changes may require special upgrade steps please read below.**
#### Upgrade Steps

Changes to how and where task data is store have been made.
In order to safely upgrade to version 0.13 you need to follow these steps:

1. Upgrade the Kapacitor binary.
2. Configure new database location. By default the location `/var/lib/kapacitor/kapacitor.db` is chosen for package installs or `./kapacitor.db` for manual installs.
Do **not** remove the configuration for the location of the old task.db database file since it is still needed to do the migration.

```
[storage]
boltdb = "/var/lib/kapacitor/kapacitor.db"
```

3. Restart Kapacitor. At this point Kapacitor will migrate all existing data to the new database file.
If any errors occur Kapacitor will log them and fail to startup. This way if Kapacitor starts up you can be sure the migration was a success and can continue normal operation.
The old database is opened in read only mode so that existing data cannot be corrupted.
Its recommended to start Kapacitor in debug logging mode for the migration so you can follow the details of the migration process.

At this point you may remove the configuration for the old `task` `dir` and restart Kapacitor to ensure everything is working.
Kapacitor will attempt the migration on every startup while the old configuration and db file exist, but will skip any data that was already migrated.


#### API Changes

With this release the API has been updated to what we believe will be the stable version for a 1.0 release.
Small changes may still be made but the significant work to create a RESTful HTTP API is complete.
Many breaking changes introduced, see the [client/API.md](http://github.com/influxdata/kapacitor/blob/master/client/API.md) doc for details on how the API works now.

#### CLI Changes

Along with the API changes, breaking changes where also made to the `kapacitor` CLI command.
Here is a break down of the CLI changes:

* Every thing has an ID now: tasks, recordings, even replays.
The `name` used before to define a task is now its `ID`.
As such instead of using `-name` and `-id` to refer to tasks and recordings,
the flags have been changed to `-task` and `-recording` accordingly.
* Replays can be listed and deleted like tasks and recordings.
* Replays default to `fast` clock mode.
* The record and replay commands now have a `-no-wait` option to start but not wait for the recording/replay to complete.
* Listing recordings and replays displays the status of the respective action.
* Record and Replay command now have an optional flag `-replay-id`/`-recording-id` to specify the ID of the replay or recording.
If not set then a random ID will be chosen like the previous behavior.

#### Notable features

UDF can now be managed externally to Kapacitor via Unix sockets.
A process or container can be launched independent of Kapacitor exposing a socket.
On startup Kapacitor will connect to the socket and begin communication.
Expand Down Expand Up @@ -55,6 +104,7 @@ For example, let's say we want to store all data that triggered an alert in Infl
- [#486](https://github.com/influxdata/kapacitor/pull/486): Default config file location.
- [#461](https://github.com/influxdata/kapacitor/pull/461): Make Alerta `event` property configurable.
- [#491](https://github.com/influxdata/kapacitor/pull/491): BREAKING: Rewriting stateful expression in order to improve performance, the only breaking change is: short circuit evaluation for booleans - for example: ``lambda: "bool_value" && (count() > 100)`` if "bool_value" is false, we won't evaluate "count".
- [#504](https://github.com/influxdata/kapacitor/pull/504): BREAKING: Many changes to the API and underlying storage system. This release requires a special upgrade process.

### Bugfixes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Place the above script into a file `cpu_alert.tick` then run these commands to s
```sh
# Define the task (assumes cpu data is in db 'telegraf')
kapacitor define \
-name cpu_alert \
cpu_alert \
-type stream \
-dbrp telegraf.default \
-tick ./cpu_alert.tick
Expand Down
4 changes: 2 additions & 2 deletions alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func (a *AlertNode) renderID(name string, group models.GroupID, tags models.Tags
}
info := idInfo{
Name: name,
TaskName: a.et.Task.Name,
TaskName: a.et.Task.ID,
Group: g,
Tags: tags,
}
Expand All @@ -693,7 +693,7 @@ func (a *AlertNode) renderMessageAndDetails(id, name string, t time.Time, group
minfo := messageInfo{
idInfo: idInfo{
Name: name,
TaskName: a.et.Task.Name,
TaskName: a.et.Task.ID,
Group: g,
Tags: tags,
},
Expand Down
Loading

0 comments on commit 5149786

Please sign in to comment.