Giter Club home page Giter Club logo

opentsdb-plugins's Introduction

Build Status

This project provides two OpenTSDB(v2.1.3) rpc plugins.

The Thrift Plugin

This is just a simple Thrift server that will be start when OpenTSDB starts.

By default, it binds to 0.0.0.0, which is configable var property em.thrift.host and listen port is 9999, which also can be changed using property em.thrift.port

The thrift IDL used here can be found at src/main/thrift/metrics.thrift which will provided very detailed view of how to use this thrift service.

As defined in the IDL, this server accepts two types of metrics data, simple text or Tsdata which is a predefined thrift struct.

The plain text type data is just like the OpenTSDB's telent service, so one can write a thrift client and put same data that used in the telnet service, it uses same metrics syntax.

The Kafka Plugin

While, this is somehow misusing the OpenTSDB's RPC mechanism, since it is not a RPC plugin at all.

What this plugin does is simple start a kafka consumer and fetch data from kafka and then write it to OpenTSDB.

This kafka consumer reads one more topics, you can shot data only type of plain text or tsdata's binary into every topic.

Note: the topic name property has no default value, so if there is no such property provided, then this plugin will not fetch any data from kafka but just quite.

We can get you topics via this configured property em.kafka.topics, you must split them by ,, they are just index, real topic name will be provode by the property named em.kafka.topicN.name e.g: em.kafka.topics=topic1,topic2,...,topicN

For each topic there are some properties that should be defined in the configuration file: (e.g: topic1)

  1. em.kafka.topic1.name

    topic name of kafka

  2. em.kafka.topic1.datatype

    the data type of your data shot into this topic, only two value for you : plaintext for plain text value and tsdata for tsdata's binary. Metrics schemas:

    • plaintext (just only one space between fragements):
      • (name tags timestamp value)
      • sys.cpu.user host=webserver01,cpu=0 1356998400 1
    • tsdata:
      • TSData(name:sys.cpu.user, value:6.0, timestamp:1356998400, tags:{host=webserver01, cpu=0})
  3. em.kafka.topic1.zookeeper.connect

    The zk host which will be used for the kafka consumer to connect to.

  4. em.kafka.topic1.group.id

    The client id used to identify kafka consumer group.

How to build

    ./gradlew clean build assembleMainDist

The artifact will be build and save to build/distributions/

NOTE: this requires Thrift 0.9.2

Install

Copy the build artifact and copy the jars to the OpenTSDB's lib dir, please note some dependencies of this project maybe already exist in the OpenTSDB's distribution, so just skip such jars and only copy non-exist ones.

Then modify OpenTSDB's conf file and add properties required by this plugin, all properties can be found in the class com.easemob.tsdb.thrift.rpc.Constants

To enable the rpc plugins provided by this project, please make sure such line exist in the Opentsdb's conf

tsd.rpc.plugins=com.easemob.thrift.tsdb.rpc.ThriftTSDBRpcPlugin,com.easemob.tsdb.kafka.plugin.KafkaConsumerRPCPlugin

opentsdb-plugins's People

Contributors

stliu avatar daasiri avatar

Watchers

James Cloos avatar John Ewing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.