master
md 188 lines 7.31 KB
Rendered Raw
1 <!--startmeta
2 custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/exporting/opentsdb/README.md"
3 meta_yaml: "https://github.com/netdata/netdata/edit/master/src/exporting/opentsdb/metadata.yaml"
4 sidebar_label: "OpenTSDB"
5 learn_status: "Published"
6 learn_rel_path: "Exporting Metrics/Connectors"
7 keywords: ['exporter', 'OpenTSDB', 'scalable time series']
8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE EXPORTER'S metadata.yaml FILE"
9 endmeta-->
10
11 # OpenTSDB
12
13
14 <img src="https://netdata.cloud/img/opentsdb.png" width="150"/>
15
16
17 Use the OpenTSDB connector for the exporting engine to archive your Netdata metrics to OpenTSDB databases for long-term storage,
18 further analysis, or correlation with data from other sources.
19
20
21 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
22
23 ## Setup
24
25
26 ### Prerequisites
27
28 ####
29
30 - OpenTSDB and Netdata, installed, configured and operational.
31
32
33
34 ### Configuration
35
36 #### Options
37
38 The following options can be defined for this exporter.
39
40 <details open><summary>Config options</summary>
41
42
43
44 | Option | Description | Default | Required |
45 |:-----|:------------|:--------|:---------:|
46 | enabled | Enables or disables an exporting connector instance (yes/no). | no | yes |
47 | [destination](#option-destination) | Accepts a space separated list of hostnames, IPs (IPv4 and IPv6) and ports to connect to. Netdata will use the first available to send the metrics. | no | yes |
48 | username | Username for HTTP authentication | my_username | no |
49 | password | Password for HTTP authentication | my_password | no |
50 | data source | Selects the kind of data that will be sent to the external database. (as collected/average/sum) | | no |
51 | hostname | The hostname to be used for sending data to the external database server. | [global].hostname | no |
52 | prefix | The prefix to add to all metrics. | Netdata | no |
53 | [update every](#option-update-every) | Frequency of sending sending data to the external database, in seconds. | 10 | no |
54 | [buffer on failures](#option-buffer-on-failures) | The number of iterations (`update every` seconds) to buffer data, when the external database server is not available. | 10 | no |
55 | timeout ms | The timeout in milliseconds to wait for the external database server to process the data. | 2 * update_every * 1000 | no |
56 | [send hosts matching](#option-send-hosts-matching) | Hosts filter. Determines which hosts will be sent to OpenTSDB. The syntax is [simple patterns](https://github.com/netdata/netdata/tree/master/src/libnetdata/simple_pattern#simple-patterns). | localhost * | no |
57 | [send charts matching](#option-send-charts-matching) | One or more space separated patterns (use * as wildcard) checked against both chart id and chart name. | * | no |
58 | [send names instead of ids](#option-send-names-instead-of-ids) | Controls the metric names Netdata should send to the external database (yes/no). | | no |
59 | send configured labels | Controls if host labels defined in the `[host labels]` section in `netdata.conf` should be sent to the external database (yes/no). | | no |
60 | send automatic labels | Controls if automatically created labels, like `_os_name` or `_architecture` should be sent to the external database (yes/no). | | no |
61
62 <a id="option-destination"></a>
63 ##### destination
64
65 The format of each item in this list, is: [PROTOCOL:]IP[:PORT].
66 - PROTOCOL can be udp or tcp. tcp is the default and only supported by the current exporting engine.
67 - IP can be XX.XX.XX.XX (IPv4), or [XX:XX...XX:XX] (IPv6). For IPv6 you can to enclose the IP in [] to separate it from the port.
68 - PORT can be a number of a service name. If omitted, the default port for the exporting connector will be used (opentsdb = 4242).
69
70 Example IPv4:
71 ```yaml
72 destination = 10.11.14.2:4242 10.11.14.3:4242 10.11.14.4:4242
73 ```
74 Example IPv6 and IPv4 together:
75 ```yaml
76 destination = [ffff:...:0001]:2003 10.11.12.1:2003
77 ```
78 When multiple servers are defined, Netdata will try the next one when the previous one fails.
79
80
81 <a id="option-update-every"></a>
82 ##### update every
83
84 Netdata will add some randomness to this number, to prevent stressing the external server when many Netdata servers
85 send data to the same database. This randomness does not affect the quality of the data, only the time they are sent.
86
87
88 <a id="option-buffer-on-failures"></a>
89 ##### buffer on failures
90
91 If the server fails to receive the data after that many failures, data loss on the connector instance is expected (Netdata will also log it).
92
93
94 <a id="option-send-hosts-matching"></a>
95 ##### send hosts matching
96
97 Includes one or more space separated patterns, using * as wildcard (any number of times within each pattern).
98 The patterns are checked against the hostname (the localhost is always checked as localhost), allowing us to
99 filter which hosts will be sent to the external database when this Netdata is a central Netdata aggregating multiple hosts.
100
101 A pattern starting with `!` gives a negative match. So to match all hosts named `*db*` except hosts containing `*child*`,
102 use `!*child* *db*` (so, the order is important: the first pattern matching the hostname will be used - positive or negative).
103
104
105 <a id="option-send-charts-matching"></a>
106 ##### send charts matching
107
108 A pattern starting with ! gives a negative match. So to match all charts named apps.* except charts ending in *reads,
109 use !*reads apps.* (so, the order is important: the first pattern matching the chart id or the chart name will be used,
110 positive or negative). There is also a URL parameter filter that can be used while querying allmetrics. The URL parameter
111 has a higher priority than the configuration option.
112
113
114 <a id="option-send-names-instead-of-ids"></a>
115 ##### send names instead of ids
116
117 Netdata supports names and IDs for charts and dimensions. Usually IDs are unique identifiers as read by the system and names
118 are human friendly labels (also unique). Most charts and metrics have the same ID and name, but in several cases they are
119 different : disks with device-mapper, interrupts, QoS classes, statsd synthetic charts, etc.
120
121
122
123 </details>
124
125
126
127 #### via File
128
129 The configuration file name for this integration is `exporting.conf`.
130
131
132 You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the
133 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
134
135 ```bash
136 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
137 sudo ./edit-config exporting.conf
138 ```
139
140 ##### Examples
141
142 ###### Minimal configuration
143
144 Add `:http` or `:https` modifiers to the connector type if you need to use other than a plaintext protocol.
145 For example: `opentsdb:http:my_opentsdb_instance`, `opentsdb:https:my_opentsdb_instance`.
146
147
148 ```yaml
149 [opentsdb:my_opentsdb_instance]
150 enabled = yes
151 destination = localhost:4242
152
153 ```
154 ###### HTTP authentication
155
156
157
158 ```yaml
159 [opentsdb:my_opentsdb_instance]
160 enabled = yes
161 destination = localhost:4242
162 username = my_username
163 password = my_password
164
165 ```
166 ###### Using `send hosts matching`
167
168
169
170 ```yaml
171 [opentsdb:my_opentsdb_instance]
172 enabled = yes
173 destination = localhost:4242
174 send hosts matching = localhost *
175
176 ```
177 ###### Using `send charts matching`
178
179
180
181 ```yaml
182 [opentsdb:my_opentsdb_instance]
183 enabled = yes
184 destination = localhost:4242
185 send charts matching = *
186
187 ```
188