|
1 | | -### MANAGED BY PUPPET |
| 1 | +# |
| 2 | +# MANAGED BY PUPPET |
| 3 | +# |
2 | 4 |
|
3 | 5 | ########## |
4 | 6 | # WARNING |
5 | 7 | ########## |
6 | 8 | # This sample works only for Kafka >= 0.8.2. |
7 | 9 | # If you are running a version older than that, you can refer to agent 5.2.x released |
8 | 10 | # sample files, https://raw.githubusercontent.com/DataDog/dd-agent/5.2.1/conf.d/kafka.yaml.example |
9 | | - |
10 | 11 | instances: |
11 | | - - host: <%= @host %> |
12 | | - port: <%= @port %> # This is the JMX port on which Kafka exposes its metrics (usually 9999) |
13 | | -<% if @tags.length > 0 -%> |
| 12 | +<% @servers.each do |server| -%> |
| 13 | + - host: <%= server['host'] %> |
| 14 | + port: <%= server['port'] %> |
| 15 | + <%- if !server['tags'].nil? && server['tags'].any? -%> |
14 | 16 | tags: |
15 | | -<%- @tags.each do |tag_name, tag_value| -%> |
16 | | - <%= tag_name %>: <%= tag_value %> |
17 | | -<% end -%> |
18 | | -<% end -%> |
19 | | -<% if @user -%> |
20 | | - user: <%= @user %> |
21 | | - password: <%= @password %> |
| 17 | + <%- server['tags'].each do |tag| -%> |
| 18 | + - <%= tag %> |
| 19 | + <%- end -%> |
| 20 | + <%- end -%> |
| 21 | + <%- if !server['username'].nil? -%> |
| 22 | + user: <%= server['username'] %> |
| 23 | + <%- end -%> |
| 24 | + <%- if !server['password'].nil? -%> |
| 25 | + password: <%= server['password'] %> |
| 26 | + <%- end -%> |
| 27 | + <%- if !server['process_name_regex'].nil? -%> |
| 28 | + process_name_regex: <%= server['process_name_regex'] %> |
| 29 | + <%- end -%> |
| 30 | + <%- if !server['tools_jar_path'].nil? -%> |
| 31 | + tools_jar_path: <%= server['tools_jar_path'] %> |
| 32 | + <%- end -%> |
| 33 | + <%- if !server['name'].nil? -%> |
| 34 | + name: <%= server['name'] %> |
| 35 | + <%- end -%> |
| 36 | + <%- if !server['java_bin_path'].nil? -%> |
| 37 | + java_bin_path: <%= server['java_bin_path'] %> |
| 38 | + <%- end -%> |
| 39 | + <%- if !server['trust_store_path'].nil? -%> |
| 40 | + trust_store_path: <%= server['trust_store_path'] %> |
| 41 | + <%- end -%> |
| 42 | + <%- if !server['trust_store_password'].nil? -%> |
| 43 | + trust_store_password: <%= server['trust_store_password'] %> |
| 44 | + <%- end -%> |
22 | 45 | <% end -%> |
23 | | - # process_name_regex: .*process_name.* # Instead of specifying a host, and port. The agent can connect using the attach api. |
24 | | - # # This requires the JDK to be installed and the path to tools.jar to be set below. |
25 | | - # tools_jar_path: /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar # To be set when process_name_regex is set |
26 | | - # name: kafka_instance |
27 | | - # java_bin_path: /path/to/java # Optional, should be set if the agent cannot find your java executable |
28 | | - # trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled |
29 | | - # trust_store_password: password |
30 | | - # - host: remotehost |
31 | | - # port: 9998 # Producer |
32 | | - # tags: |
33 | | - # kafka: producer0 |
34 | | - # env: stage |
35 | | - # newTag: test |
36 | | - # - host: remotehost |
37 | | - # port: 9997 # Consumer |
38 | | - # tags: |
39 | | - # kafka: consumer0 |
40 | | - # env: stage |
41 | | - # newTag: test |
42 | 46 |
|
43 | 47 | init_config: |
44 | 48 | is_jmx: true |
45 | 49 |
|
46 | 50 | # Metrics collected by this check. You should not have to modify this. |
47 | 51 | conf: |
48 | | - # v0.8.2.x Producers |
| 52 | + # |
| 53 | + # Producers (only v0.8.2.x) |
| 54 | + # |
49 | 55 | - include: |
50 | 56 | domain: 'kafka.producer' |
51 | 57 | bean_regex: 'kafka\.producer:type=ProducerRequestMetrics,name=ProducerRequestRateAndTimeMs,clientId=.*' |
@@ -75,8 +81,9 @@ init_config: |
75 | 81 | metric_type: rate |
76 | 82 | alias: kafka.producer.message_rate |
77 | 83 |
|
78 | | - |
79 | | - # v0.9.0.x Producers |
| 84 | + # |
| 85 | + # Producers (v0.9.0.x to v0.10.2.x) |
| 86 | + # |
80 | 87 | - include: |
81 | 88 | domain: 'kafka.producer' |
82 | 89 | bean_regex: 'kafka\.producer:type=producer-metrics,client-id=.*' |
@@ -113,8 +120,9 @@ init_config: |
113 | 120 | metric_type: gauge |
114 | 121 | alias: kafka.producer.io_wait |
115 | 122 |
|
116 | | - |
117 | | - # v0.8.2.x Consumers |
| 123 | + # |
| 124 | + # Consumers (only v0.8.2.x) |
| 125 | + # |
118 | 126 | - include: |
119 | 127 | domain: 'kafka.consumer' |
120 | 128 | bean_regex: 'kafka\.consumer:type=ConsumerFetcherManager,name=MaxLag,clientId=.*' |
@@ -143,25 +151,26 @@ init_config: |
143 | 151 | Count: |
144 | 152 | metric_type: rate |
145 | 153 | alias: kafka.consumer.messages_in |
146 | | - |
147 | | - # Offsets committed to ZooKeeper |
148 | 154 | - include: |
| 155 | + # Offsets committed to ZooKeeper |
149 | 156 | domain: 'kafka.consumer' |
150 | 157 | bean_regex: 'kafka\.consumer:type=ZookeeperConsumerConnector,name=ZooKeeperCommitsPerSec,clientId=.*' |
151 | 158 | attribute: |
152 | 159 | Count: |
153 | 160 | metric_type: rate |
154 | 161 | alias: kafka.consumer.zookeeper_commits |
155 | | - # Offsets committed to Kafka |
156 | 162 | - include: |
| 163 | + # Offsets committed to Kafka |
157 | 164 | domain: 'kafka.consumer' |
158 | 165 | bean_regex: 'kafka\.consumer:type=ZookeeperConsumerConnector,name=KafkaCommitsPerSec,clientId=.*' |
159 | 166 | attribute: |
160 | 167 | Count: |
161 | 168 | metric_type: rate |
162 | 169 | alias: kafka.consumer.kafka_commits |
163 | 170 |
|
164 | | - # v0.9.0.x Consumers |
| 171 | + # |
| 172 | + # Consumers (v0.9.0.x to v0.10.2.x) |
| 173 | + # |
165 | 174 | - include: |
166 | 175 | domain: 'kafka.consumer' |
167 | 176 | bean_regex: 'kafka\.consumer:type=consumer-fetch-manager-metrics,client-id=.*' |
@@ -311,8 +320,8 @@ init_config: |
311 | 320 | domain: 'kafka.server' |
312 | 321 | bean: 'kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent' |
313 | 322 | attribute: |
314 | | - Count: |
315 | | - metric_type: rate |
| 323 | + OneMinuteRate: |
| 324 | + metric_type: gauge |
316 | 325 | alias: kafka.request.handler.avg.idle.pct.rate |
317 | 326 | - include: |
318 | 327 | domain: 'kafka.server' |
|
0 commit comments