Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use it #17

Open
Blue-53Hz opened this issue Jun 18, 2020 · 1 comment
Open

How do I use it #17

Blue-53Hz opened this issue Jun 18, 2020 · 1 comment

Comments

@Blue-53Hz
Copy link

Hello, do you have any examples for reference? I want to use it to synchronize data to opentsdb

@muffix
Copy link
Contributor

muffix commented Jun 19, 2020

There are detailed instructions in the README.

The code here needs to be compiled and the resulting JAR put into OpenTSDB's plugin directory (as defined in tsd.core.plugin_path in the OpenTSDB config). Then, you will need to add the configuration items described here to the same (OpenTSDB's) config file. OpenTSDB will load the plugin on startup and spin up Kakfa consumers that consume the topic you configured.

The crucial part is the deserialiser class. Each message (i.e. the raw bytes) from the Kafka topic is passed to the deserialiser configured for that topic. A JSON deserialiser is provided out of the box, but you can also make your own by implementing the net.opentsdb.data.deserializers.Deserializer interface in case you have something other than JSON (Protobuf, for example) in your Kafka topic.

The deserialiser only needs to return a List of TypedIncomingData (which can be Metric, Aggregate, Histogram, or Metrics) for each message. The plugin takes care of the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants