You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,40 @@ The arguments are:
49
49
-**refresh** how often should the app refresh and store a point in the DB
50
50
-**retain** how long should points be kept in the DB
51
51
-**dbName** where to store the history (default 'offsetapp')
52
+
-**pluginsArgs** additional arguments used by extensions (see below)
52
53
54
+
Writing and using plugins
55
+
============================
56
+
57
+
Kafka Offset Monitor allows you to plug-in additional offset info reporters in case you want this information to be logged or stored somewhere. In order to write your own plugin,
58
+
all you need to do is to implement OffsetInfoReporter trait:
59
+
60
+
```
61
+
trait OffsetInfoReporter {
62
+
def report(info: IndexedSeq[OffsetInfo])
63
+
def cleanupOldData() = {}
64
+
}
65
+
```
66
+
67
+
It is also required, that implementation has a constructor with String as the only parameter, and this parameter will be set to pluginsArgs argument value.
68
+
Its up to you how you want to utilize this argument and configure your plugin.
69
+
70
+
When building a plugin you may find it difficult to set up dependency to Kafka Offset Monitor classes, as currently artifacts are not published to public repos.
71
+
As long as this is true you will need to use local maven repo and just publish Kafka Offset Monitor artifact with: ```sbt publishM2```
72
+
73
+
Assuming you have a custom implementation of OffsetInfoReporter in a jar file, running it is as simple as adding the jar to the classpath when running app:
For complete working example you can check [kafka-offset-monitor-graphite](https://github.com/allegro/kafka-offset-monitor-graphite), a plugin reporting offset information to Graphite.
0 commit comments