___ _____ ____ ____ ____
/ _ \ _ __ ___ _ _|_ _/ ___|| _ \| __ )
| | | | '_ \ / _ \ '_ \| | \___ \| | | | _ \
| |_| | |_) | __/ | | | | ___) | |_| | |_) |
\___/| .__/ \___|_| |_|_| |____/|____/|____/
|_| The modern time series database.
Search plugin for OpenTSDB
##Installation
- Compile the plugin via
mvn package. - Create a plugins directory for your TSD
- Copy the plugin from the
targetdirectory into your TSD's plugin's directory. - Add the following configs to your
opentsdb.conffile.- Add
tsd.core.plugin_path = <directory>pointing to a valid directory for your plugins. - Add
tsd.search.enable = true - Add
tsd.search.plugin = net.opentsdb.search.ElasticSearch - Add
tsd.search.elasticsearch.host = <host>The HTTP protocol, host and port for an ES host or VIP in the formathttp[s]://<host>[:port].
- Add
- Add a mapping for each JSON file in the
./schemassub folder of your choice via: (NOTE: It's important to do this BEFORE starting a TSD that would index data as you can't modify the mappings for documents that have already been indexed [afaik])
curl -X PUT -d @schemas/opentsdb_index.json http://<eshost>/opentsdb/
- Optionally add
tsd.core.meta.enable_tracking = trueto your TSD config if it's processing incoming data - Turn up the TSD OR...
- ... if you have existing data, run the
uid metasyncutility from OpenTSDB
-
Add the following configs to your
opentsdb.conffile.- Add
tsd.search.elasticsearch.index = opentsdbthe index of documents - Add
tsd.search.elasticsearch.type = metathe type of documents - Add
tsd.search.elasticsearch.uidmeta_type = uidmetathe prefix string of the document id of uidmeta - Add
tsd.search.elasticsearch.tsmeta_type = tsmetathe prefix string of the document id of tsmeta - Add
tsd.search.elasticsearch.annotation_type = annotationthe prefix string of the document id of annotation
- Add
-
The rule of generate document id as follows.
- uidmeta: document_id = uidmeta+(metric|tagk|tagv)+uid
- tsmeta: document_id = tsmeta+tsuid
- annotation: document_id = annotation+ts[+tsuid]
- Add the following configs to your
opentsdb.conffile.- Add
tsd.search.plugin = net.opentsdb.tsd.SearchHttpRpcPlugin
- Add
- Add
net.opentsdb.tsd.SearchHttpRpcPluginto transfer the request to ElasticSearch host./plugin/search/indextransfer the request to ElasticSearch. Support GET or POST Request, The request body and response, please read the EalsticSearch documents./plugin/search/versionreturn the plugin version.
TODO - doc em