Initial attempt at discovery plugin #719

Merged
merged 7 commits into from Mar 23, 2016

Projects

None yet

2 participants

@johann8384
Member

Attempting to build a framework for startup plugins.

Testing with this skeleton plugin that I intend to turn into an Apache Curator plugin.

Fixes #716

@johann8384
Member

Loaded my test plugin:

2016-03-02 22:17:34,277 INFO  [main] CuratorPlugin: Apache Curator ServiceDiscovery Plugin Initialized
2016-03-02 22:17:34,277 INFO  [main] TSDMain: Successfully initialized startup plugin [io.tsdb.opentsdb.discoveryplugins.CuratorPlugin] version: 2.0.0
@johann8384
Member

Configuration values:

tsd.startup.enabled = true
tsd.startup.plugin = io.tsdb.opentsdb.discoveryplugins.CuratorPlugin
tsd.core.plugin_path = /tmp/plugins
@johann8384
Member

Notes for me, I need to add a few things to this:

  • Fix build
  • I would like to add a "ready()" call for when the TSDB is open (about when it prints "listening on 4242" in the logs)
  • Add tests
@johann8384
Member

My test plugin loads cleanly:

2016-03-14 15:33:20,580 DEBUG [main] TSDMain: Startup Plugin is Enabled
2016-03-14 15:33:20,580 DEBUG [main] TSDMain: Plugin Path: /tmp
2016-03-14 15:33:20,587 DEBUG [main] PluginLoader: Found a jar: /tmp/DiscoveryPlugins-1.0-SNAPSHOT.jar
2016-03-14 15:33:20,587 DEBUG [main] PluginLoader: Found a jar: /tmp/DiscoveryPlugins-all-1.0-SNAPSHOT.jar
2016-03-14 15:33:20,587 WARN  [main] PluginLoader: Access denied to directory: /tmp/launchd-1290.iITGIm
2016-03-14 15:33:20,587 WARN  [main] PluginLoader: Access denied to directory: /tmp/launchd-751.hEI1uL
2016-03-14 15:33:20,591 DEBUG [main] PluginLoader: Successfully added JAR to class loader: /tmp/DiscoveryPlugins-1.0-SNAPSHOT.jar
2016-03-14 15:33:20,591 DEBUG [main] TSDMain: Attempt to Load: io.tsdb.opentsdb.discoveryplugins.IdentityPlugin
2016-03-14 15:33:20,594 DEBUG [main] CuratorPlugin: constructor called
2016-03-14 15:33:20,595 INFO  [main] CuratorPlugin: Apache Curator ServiceDiscovery Plugin Initialized
2016-03-14 15:33:20,595 DEBUG [main] CuratorPlugin: Finished with config
2016-03-14 15:33:20,595 INFO  [main] TSDMain: Successfully initialized startup plugin [io.tsdb.opentsdb.discoveryplugins.IdentityPlugin] version: 2.0.0
@johann8384
Member

Documentation PR added: OpenTSDB/opentsdb.net#79

@johann8384 johann8384 added this to the v2.3.0 milestone Mar 19, 2016
@johann8384 johann8384 merged commit e895983 into OpenTSDB:next Mar 23, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@johann8384 johann8384 deleted the johann8384:ISSUE-716 branch Mar 23, 2016
@manolama

We may want to change this to tsd.startup_override.enable or something. Otherwise I could see users saying "Of COURSE I want to startup TSDB..". ;)

Member

tsd.plugins.startup.enable? would make sense for all the plugins to be tsd.plugins.X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment