How to insert data in OpenTSDB (Time Series Database)
Asked Answered
C

4

6

I'm new to OpenTSDB. I somehow managed to install and configure OpenTSDB, but I don't know how to put data into OpenTSDB from client. Can anyone of you help me?

Calamite answered 15/12, 2011 at 13:9 Comment(0)
I
2

The short answer is that those "put name timestamp value [tags]" commands are the network protocol for adding data to OpenTSDB over TCP/IP. So from your Java program, you can open a TCP socket to the TSD port and start writing commands to add your data.

Obviously, that still leaves a lot of details an an excercise to the reader.

You didn't specify in your question how, or even if, you're collecting time series data that you want to store. How complicated it is to periodically push data into TSD from your application will depend on what you're doing there. If you're using the excellent Yammer/Coda Hale Metrics library to collect data (and in Java, there really isn't a slicker way to do it, that I know of)

Metrics includes a reporter interface with several implementations for other statistics repositories like Graphite and Ganglia. You can easily implement one for OpenTSDB (in fact, someone already has - I'm trying to find the pull request on github but failing; I'll update this when I find it).

Incest answered 3/5, 2012 at 5:59 Comment(0)
J
4

Have you read the getting started guide

You have several options. Once started, and metrics created via ./tsdb mkmetric mymetric.data_1 mymetric.data_2 , you can batch import files written in the form

metric_name timestamp value tags e.g.

mymetric.data_1 1295643636 48 a=foo

then you can ./tsdb import file

An other way is to "telnet" commands to the server in the same form as above, but with the put keyword, like echo "put mymetric.data_1 1295643636 48 a=foo" | nc -w 15 tsdHost tsdPort (linux way :-) )

Jit answered 15/12, 2011 at 14:35 Comment(1)
yeah i read the getting stated guide but i dont know how to put data from into opentstb from nodes using javaCalamite
I
2

The short answer is that those "put name timestamp value [tags]" commands are the network protocol for adding data to OpenTSDB over TCP/IP. So from your Java program, you can open a TCP socket to the TSD port and start writing commands to add your data.

Obviously, that still leaves a lot of details an an excercise to the reader.

You didn't specify in your question how, or even if, you're collecting time series data that you want to store. How complicated it is to periodically push data into TSD from your application will depend on what you're doing there. If you're using the excellent Yammer/Coda Hale Metrics library to collect data (and in Java, there really isn't a slicker way to do it, that I know of)

Metrics includes a reporter interface with several implementations for other statistics repositories like Graphite and Ganglia. You can easily implement one for OpenTSDB (in fact, someone already has - I'm trying to find the pull request on github but failing; I'll update this when I find it).

Incest answered 3/5, 2012 at 5:59 Comment(0)
V
0

Check out the OpenTSDB 2.0 documentation: http://opentsdb.net/docs/build/html/ This will provide better insight in adding data into openTSDB. Moreover, openTSDB2.0 has HTTP api to put data.

Viper answered 21/8, 2013 at 9:11 Comment(0)
B
0

You can read Input Methods in the documentation. Also I find it useful for me to read Data Specification, to understand what every time series consists of.

Buoy answered 3/2, 2016 at 16:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.