OpenTSDB Result Table

Function

OpenTSDB is a distributed, scalable time series database based on HBase. OpenTSDB is designed to collect monitoring information of a large-scale cluster and query data in seconds, facilitating querying and storing massive amounts of monitoring data in common databases. OpenTSDB can be used for system monitoring and measurement as well as collection and monitoring of IoT data, financial data, and scientific experimental results.

DLI uses enhanced datasource connections to write the output of Flink jobs to OpenTSDB.

Prerequisites

Syntax

create table tsdbSink (
  attr_name attr_type 
  (',' attr_name attr_type)* 
)
with (
  'connector.type' = 'opentsdb',
  'connector.region' = '',
  'connector.tsdb-metrics' = '',
  'connector.tsdb-timestamps' = '',
  'connector.tsdb-values' = '',
  'connector.tsdb-tags' = '',
  'connector.tsdb-link-address' = ''
);

Parameters

Table 1 Parameter description

Parameter

Mandatory

Description

connector.type

Yes

Connector type. Set this parameter to opentsdb.

connector.region

Yes

Region where OpenTSDB locates

connector.tsdb-metrics

Yes

Metrics of data points, which can be specified through parameter configurations.

The number of metrics must be 1 or the same as the number of connector.tsdb-values.

Use semicolons (;) to separate multiple metrics.

connector.tsdb-timestamps

Yes

Timestamps of data points. Only dynamic columns are supported.

The data type can be int, bigint, or string. Only numbers are supported.

The number of metrics must be 1 or the same as the number of connector.tsdb-values.

Use semicolons (;) to separate multiple timestamps.

connector.tsdb-values

Yes

Values of data points. You can specify dynamic columns or constant values.

Separate multiple values with semicolons (;).

connector.tsdb-tags

Yes

Tags of data points. Each tag contains at least one tag value and a maximum of eight tag values. Separate multiple tags by commas (,). You can specify the tags by parameters.

The number of metrics must be 1 or the same as the number of connector.tsdb-values.

Separate multiple tags with semicolons (;).

connector.batch-insert-data-num

No

Number of data records to be written in batches at a time. The value must be a positive integer. The default value is 8.

connector.tsdb-link-address

Yes

OpenTSDB address for connecting to the cluster where the data to be inserted belongs.

Precautions

Example

create table sink1(
  attr1 bigint,
  attr2 int,
  attr3 int
) with (
  'connector.type' = 'opentsdb',
  'connector.region' = '',
  'connector.tsdb-metrics' = '',
  'connector.tsdb-timestamps' = '${attr1}',
  'connector.tsdb-values' = '${attr2};10',
  'connector.tsdb-tags' = 'key1:value1,key2:value2;key3:value3',
  'connector.tsdb-link-address' = ''
);