add go.d/rethinkdb (#18278)
Ilya Mashchenko committed
Aug 8, 2024 at 21:48 UTC
5dedeeca156e442f9d6a5ba68272739f35ac7b2b
19 files changed
+1108
src/collectors/apps.plugin/apps_groups.conf
+2
@@ -375,6 +375,8 @@ inetd: inetd xinetd
375
# -----------------------------------------------------------------------------
376
# other application servers
377
378
+rethinkdb: rethinkdb
379
+
380
beanstalkd: beanstalkd
381
382
rspamd: rspamd
src/go/go.mod
+4
@@ -49,6 +49,7 @@ require (
49
golang.org/x/text v0.16.0
50
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20220504211119-3d4a969bb56b
51
gopkg.in/ini.v1 v1.67.0
52
+ gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2
53
gopkg.in/yaml.v2 v2.4.0
54
k8s.io/api v0.30.3
55
k8s.io/apimachinery v0.30.3
@@ -86,6 +87,7 @@ require (
87
github.com/google/gofuzz v1.2.0 // indirect
88
github.com/google/uuid v1.6.0 // indirect
89
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
90
+ github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
91
github.com/huandu/xstrings v1.3.3 // indirect
92
github.com/imdario/mergo v0.3.16 // indirect
93
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
@@ -114,6 +116,7 @@ require (
116
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
117
github.com/opencontainers/go-digest v1.0.0 // indirect
118
github.com/opencontainers/image-spec v1.0.2 // indirect
119
+ github.com/opentracing/opentracing-go v1.1.0 // indirect
120
github.com/pkg/errors v0.9.1 // indirect
121
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
122
github.com/prometheus/client_model v0.6.1 // indirect
@@ -143,6 +146,7 @@ require (
146
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
147
golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect
148
google.golang.org/protobuf v1.34.2 // indirect
149
+ gopkg.in/cenkalti/backoff.v2 v2.2.1 // indirect
150
gopkg.in/inf.v0 v0.9.1 // indirect
151
gopkg.in/yaml.v3 v3.0.1 // indirect
152
k8s.io/klog/v2 v2.120.1 // indirect
src/go/go.sum
+34
@@ -22,10 +22,14 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhP
22
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
23
github.com/axiomhq/hyperloglog v0.0.0-20240507144631-af9851f82b27 h1:60m4tnanN1ctzIu4V3bfCNJ39BiOPSm1gHFlFjTkRE0=
24
github.com/axiomhq/hyperloglog v0.0.0-20240507144631-af9851f82b27/go.mod h1:k08r+Yj1PRAmuayFiRK6MYuR5Ve4IuZtTfxErMIh0+c=
25
+github.com/bitly/go-hostpool v0.1.0 h1:XKmsF6k5el6xHG3WPJ8U0Ku/ye7njX7W81Ng7O2ioR0=
26
+github.com/bitly/go-hostpool v0.1.0/go.mod h1:4gOCgp6+NZnVqlKyZ/iBZFTAJKembaVENUpMkpg42fw=
27
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
28
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
29
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
30
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
31
+github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
32
+github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
33
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
34
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
35
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
@@ -68,6 +72,7 @@ github.com/facebook/time v0.0.0-20240626113945-18207c5d8ddc h1:0VQsg5ZXW9MPUxzem
72
github.com/facebook/time v0.0.0-20240626113945-18207c5d8ddc/go.mod h1:2UFAomOuD2vAK1x68czUtCVjAqmyWCEnAXOlmGqf+G0=
73
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
74
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
75
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
76
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
77
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
78
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
@@ -103,6 +108,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
108
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
109
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
110
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
111
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
112
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
113
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
114
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
115
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
@@ -130,6 +137,9 @@ github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWf
137
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
138
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk=
139
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk=
140
+github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
141
+github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
142
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
143
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
144
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
145
github.com/ilyam8/hashstructure v1.1.0 h1:N8t8hzzKLf2Da87XgC/DBYqXUmSbclgx+2cZxS5/klU=
@@ -272,18 +282,25 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
282
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
283
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
284
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
285
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
286
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
287
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
288
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
289
+github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
290
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
291
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
292
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
293
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
294
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
295
+github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
296
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
297
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
298
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
299
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
300
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
301
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
302
+github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
303
+github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
304
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
305
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
306
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -310,6 +327,7 @@ github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7
327
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
328
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
329
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
330
+github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
331
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
332
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
333
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
@@ -323,6 +341,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
341
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
342
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
343
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
344
+github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
345
+github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
346
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
347
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
348
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -390,6 +410,7 @@ golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaE
410
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
411
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
412
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
413
+golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
414
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
415
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
416
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
@@ -409,6 +430,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
430
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
431
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
432
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
433
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
434
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
435
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
436
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -423,6 +445,7 @@ golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
445
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
446
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
447
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
448
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
449
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
450
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
451
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -431,6 +454,7 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ
454
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
455
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
456
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
457
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
458
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
459
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
460
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -438,6 +462,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
462
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
463
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
464
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
465
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
466
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
467
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
468
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -508,19 +533,28 @@ google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
533
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
534
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
535
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
536
+gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
537
+gopkg.in/cenkalti/backoff.v2 v2.2.1 h1:eJ9UAg01/HIHG987TwxvnzK2MgxXq97YY6rYDpY9aII=
538
+gopkg.in/cenkalti/backoff.v2 v2.2.1/go.mod h1:S0QdOvT2AlerfSBkp0O+dk+bbIMaNbEmVk876gPCthU=
539
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
540
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
541
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
542
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
543
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
544
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
545
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
546
+gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
547
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
548
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
549
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
550
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
551
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
552
+gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2 h1:tczPZjdz6soV2thcuq1IFOuNLrBUGonFyUXBbIWXWis=
553
+gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2/go.mod h1:c7Wo0IjB7JL9B9Avv0UZKorYJCUhiergpj3u1WtGT1E=
554
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
555
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
556
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
557
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
558
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
559
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
560
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
src/go/plugin/go.d/README.md
+1
@@ -123,6 +123,7 @@ see the appropriate collector readme.
123
| [puppet](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/puppet) | Puppet |
124
| [rabbitmq](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rabbitmq) | RabbitMQ |
125
| [redis](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/redis) | Redis |
126
+| [rethinkdb](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rethinkdb) | RethinkDB |
127
| [rspamd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rspamd) | Rspamd |
128
| [scaleio](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/scaleio) | Dell EMC ScaleIO |
129
| [sensors](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/sensors) | Hardware Sensors |
src/go/plugin/go.d/config/go.d.conf
+1
@@ -87,6 +87,7 @@ modules:
87
# puppet: yes
88
# rabbitmq: yes
89
# redis: yes
90
+# rethinkdb: yes
91
# rspamd: yes
92
# scaleio: yes
93
# sensors: yes
src/go/plugin/go.d/config/go.d/rethinkdb.conf
new
+6
@@ -0,0 +1,6 @@
1
+## All available configuration options, their descriptions and default values:
2
+## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rethinkdb#readme
3
+
4
+#jobs:
5
+# - name: local
6
+# address: 127.0.0.1:28015
src/go/plugin/go.d/config/go.d/sd/docker.conf
+7
@@ -66,6 +66,8 @@ classify:
66
expr: '{{ or (eq .PrivatePort "15672") (match "sp" .Image "rabbitmq rabbitmq:* */rabbitmq */rabbitmq:*") }}'
67
- tags: "redis"
68
expr: '{{ or (eq .PrivatePort "6379") (match "sp" .Image "redis redis:* */redis */redis:*") }}'
69
+ - tags: "rethinkdb"
70
+ expr: '{{ and (eq .PrivatePort "28015") (match "sp" .Image "rethinkdb rethinkdb:* */rethinkdb */rethinkdb:*") }}'
71
- tags: "tengine"
72
expr: '{{ match "sp" .Image "*/tengine */tengine:*" }}'
73
- tags: "tomcat"
@@ -179,6 +181,11 @@ compose:
181
module: pika
182
name: docker_{{.Name}}
183
address: redis://@{{.Address}}
184
+ - selector: "rethinkdb"
185
+ template: |
186
+ module: rethinkdb
187
+ name: docker_{{.Name}}
188
+ address: {{.Address}}
189
- selector: "postgres"
190
template: |
191
module: postgres
src/go/plugin/go.d/config/go.d/sd/net_listeners.conf
+7
@@ -104,6 +104,8 @@ classify:
104
expr: '{{ or (eq .Port "15672") (glob .Cmdline "*rabbitmq*") }}'
105
- tags: "redis"
106
expr: '{{ or (eq .Port "6379") (eq .Comm "redis-server") }}'
107
+ - tags: "rethinkdb"
108
+ expr: '{{ and (eq .Port "28015") (eq .Comm "rethinkdb") }}'
109
- tags: "rspamd"
110
expr: '{{ and (eq .Port "11334") (eq .Comm "rspamd") }}'
111
- tags: "supervisord"
@@ -362,6 +364,11 @@ compose:
364
module: pika
365
name: local
366
address: redis://@{{.IPAddress}}:{{.Port}}
367
+ - selector: "rethinkdb"
368
+ template: |
369
+ module: rethinkdb
370
+ name: local
371
+ address: {{.Address}}
372
- selector: "rspamd"
373
template: |
374
module: rspamd
src/go/plugin/go.d/modules/init.go
+1
@@ -79,6 +79,7 @@ import (
79
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/puppet"
80
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/rabbitmq"
81
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/redis"
82
+ _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/rethinkdb"
83
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/rspamd"
84
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio"
85
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/sensors"
src/go/plugin/go.d/modules/rethinkdb/charts.go
new
+189
@@ -0,0 +1,189 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package rethinkdb
4
+
5
+import (
6
+ "fmt"
7
+ "strings"
8
+
9
+ "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module"
10
+)
11
+
12
+const (
13
+ prioClusterServersStatsRequest = module.Priority + iota
14
+ prioClusterClientConnections
15
+ prioClusterActiveClients
16
+ prioClusterQueries
17
+ prioClusterDocuments
18
+
19
+ prioServerStatsRequestStatus
20
+ prioServerClientConnections
21
+ prioServerActiveClients
22
+ prioServerQueries
23
+ prioServerDocuments
24
+)
25
+
26
+var clusterCharts = module.Charts{
27
+ clusterServersStatsRequestChart.Copy(),
28
+ clusterClientConnectionsChart.Copy(),
29
+ clusterActiveClientsChart.Copy(),
30
+ clusterQueriesChart.Copy(),
31
+ clusterDocumentsChart.Copy(),
32
+}
33
+
34
+var (
35
+ clusterServersStatsRequestChart = module.Chart{
36
+ ID: "cluster_cluster_servers_stats_request",
37
+ Title: "Cluster Servers Stats Request",
38
+ Units: "servers",
39
+ Fam: "servers",
40
+ Ctx: "rethinkdb.cluster_servers_stats_request",
41
+ Priority: prioClusterServersStatsRequest,
42
+ Dims: module.Dims{
43
+ {ID: "cluster_servers_stats_request_success", Name: "success"},
44
+ {ID: "cluster_servers_stats_request_timeout", Name: "timeout"},
45
+ },
46
+ }
47
+ clusterClientConnectionsChart = module.Chart{
48
+ ID: "cluster_client_connections",
49
+ Title: "Cluster Client Connections",
50
+ Units: "connections",
51
+ Fam: "connections",
52
+ Ctx: "rethinkdb.cluster_client_connections",
53
+ Priority: prioClusterClientConnections,
54
+ Dims: module.Dims{
55
+ {ID: "cluster_client_connections", Name: "connections"},
56
+ },
57
+ }
58
+ clusterActiveClientsChart = module.Chart{
59
+ ID: "cluster_active_clients",
60
+ Title: "Cluster Active Clients",
61
+ Units: "clients",
62
+ Fam: "clients",
63
+ Ctx: "rethinkdb.cluster_active_clients",
64
+ Priority: prioClusterActiveClients,
65
+ Dims: module.Dims{
66
+ {ID: "cluster_clients_active", Name: "active"},
67
+ },
68
+ }
69
+ clusterQueriesChart = module.Chart{
70
+ ID: "cluster_queries",
71
+ Title: "Cluster Queries",
72
+ Units: "queries/s",
73
+ Fam: "queries",
74
+ Ctx: "rethinkdb.cluster_queries",
75
+ Priority: prioClusterQueries,
76
+ Dims: module.Dims{
77
+ {ID: "cluster_queries_total", Name: "queries", Algo: module.Incremental},
78
+ },
79
+ }
80
+ clusterDocumentsChart = module.Chart{
81
+ ID: "cluster_documents",
82
+ Title: "Cluster Documents",
83
+ Units: "documents/s",
84
+ Fam: "documents",
85
+ Ctx: "rethinkdb.cluster_documents",
86
+ Priority: prioClusterDocuments,
87
+ Dims: module.Dims{
88
+ {ID: "cluster_read_docs_total", Name: "read", Algo: module.Incremental},
89
+ {ID: "cluster_written_docs_total", Name: "written", Mul: -1, Algo: module.Incremental},
90
+ },
91
+ }
92
+)
93
+
94
+var serverChartsTmpl = module.Charts{
95
+ serverStatsRequestStatusChartTmpl.Copy(),
96
+ serverConnectionsChartTmpl.Copy(),
97
+ serverActiveClientsChartTmpl.Copy(),
98
+ serverQueriesChartTmpl.Copy(),
99
+ serverDocumentsChartTmpl.Copy(),
100
+}
101
+
102
+var (
103
+ serverStatsRequestStatusChartTmpl = module.Chart{
104
+ ID: "server_%s_stats_request_status",
105
+ Title: "Server Stats Request Status",
106
+ Units: "status",
107
+ Fam: "srv status",
108
+ Ctx: "rethinkdb.server_stats_request_status",
109
+ Priority: prioServerStatsRequestStatus,
110
+ Dims: module.Dims{
111
+ {ID: "server_%s_stats_request_status_success", Name: "success"},
112
+ {ID: "server_%s_stats_request_status_timeout", Name: "timeout"},
113
+ },
114
+ }
115
+ serverConnectionsChartTmpl = module.Chart{
116
+ ID: "server_%s_client_connections",
117
+ Title: "Server Client Connections",
118
+ Units: "connections",
119
+ Fam: "srv connections",
120
+ Ctx: "rethinkdb.server_client_connections",
121
+ Priority: prioServerClientConnections,
122
+ Dims: module.Dims{
123
+ {ID: "server_%s_client_connections", Name: "connections"},
124
+ },
125
+ }
126
+ serverActiveClientsChartTmpl = module.Chart{
127
+ ID: "server_%s_active_clients",
128
+ Title: "Server Active Clients",
129
+ Units: "clients",
130
+ Fam: "srv clients",
131
+ Ctx: "rethinkdb.server_active_clients",
132
+ Priority: prioServerActiveClients,
133
+ Dims: module.Dims{
134
+ {ID: "server_%s_clients_active", Name: "active"},
135
+ },
136
+ }
137
+ serverQueriesChartTmpl = module.Chart{
138
+ ID: "server_%s_queries",
139
+ Title: "Server Queries",
140
+ Units: "queries/s",
141
+ Fam: "srv queries",
142
+ Ctx: "rethinkdb.server_queries",
143
+ Priority: prioServerQueries,
144
+ Dims: module.Dims{
145
+ {ID: "server_%s_queries_total", Name: "queries", Algo: module.Incremental},
146
+ },
147
+ }
148
+ serverDocumentsChartTmpl = module.Chart{
149
+ ID: "server_%s_documents",
150
+ Title: "Server Documents",
151
+ Units: "documents/s",
152
+ Fam: "srv documents",
153
+ Ctx: "rethinkdb.server_documents",
154
+ Priority: prioServerDocuments,
155
+ Dims: module.Dims{
156
+ {ID: "server_%s_read_docs_total", Name: "read", Algo: module.Incremental},
157
+ {ID: "server_%s_written_docs_total", Name: "written", Mul: -1, Algo: module.Incremental},
158
+ },
159
+ }
160
+)
161
+
162
+func (r *Rethinkdb) addServerCharts(srvUUID, srvName string) {
163
+ charts := serverChartsTmpl.Copy()
164
+
165
+ for _, chart := range *charts {
166
+ chart.ID = fmt.Sprintf(chart.ID, srvUUID)
167
+ chart.Labels = []module.Label{
168
+ {Key: "sever_uuid", Value: srvUUID},
169
+ {Key: "sever_name", Value: srvName},
170
+ }
171
+ for _, dim := range chart.Dims {
172
+ dim.ID = fmt.Sprintf(dim.ID, srvUUID)
173
+ }
174
+ }
175
+
176
+ if err := r.Charts().Add(*charts...); err != nil {
177
+ r.Warningf("failed to add chart for '%s' server: %v", srvName, err)
178
+ }
179
+}
180
+
181
+func (r *Rethinkdb) removeServerCharts(srvUUID string) {
182
+ px := fmt.Sprintf("server_%s_", srvUUID)
183
+ for _, chart := range *r.Charts() {
184
+ if strings.HasPrefix(chart.ID, px) {
185
+ chart.MarkRemove()
186
+ chart.MarkNotCreated()
187
+ }
188
+ }
189
+}
src/go/plugin/go.d/modules/rethinkdb/client.go
new
+72
@@ -0,0 +1,72 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package rethinkdb
4
+
5
+import (
6
+ "context"
7
+ "errors"
8
+ "time"
9
+
10
+ "gopkg.in/rethinkdb/rethinkdb-go.v6"
11
+)
12
+
13
+type rdbConn interface {
14
+ stats() ([][]byte, error)
15
+ close() error
16
+}
17
+
18
+func newRethinkdbConn(cfg Config) (rdbConn, error) {
19
+ sess, err := rethinkdb.Connect(rethinkdb.ConnectOpts{
20
+ Address: cfg.Address,
21
+ Username: cfg.Username,
22
+ Password: cfg.Password,
23
+ })
24
+ if err != nil {
25
+ return nil, err
26
+ }
27
+
28
+ client := &rethinkdbClient{
29
+ timeout: cfg.Timeout.Duration(),
30
+ sess: sess,
31
+ }
32
+
33
+ return client, nil
34
+}
35
+
36
+type rethinkdbClient struct {
37
+ timeout time.Duration
38
+
39
+ sess *rethinkdb.Session
40
+}
41
+
42
+func (c *rethinkdbClient) stats() ([][]byte, error) {
43
+ ctx, cancel := context.WithTimeout(context.Background(), c.timeout)
44
+ defer cancel()
45
+
46
+ opts := rethinkdb.RunOpts{Context: ctx}
47
+
48
+ cur, err := rethinkdb.DB("rethinkdb").Table("stats").Run(c.sess, opts)
49
+ if err != nil {
50
+ return nil, err
51
+ }
52
+
53
+ if cur.IsNil() {
54
+ return nil, errors.New("no stats found (cursor is nil)")
55
+ }
56
+ defer func() { _ = cur.Close() }()
57
+
58
+ var stats [][]byte
59
+ for {
60
+ bs, ok := cur.NextResponse()
61
+ if !ok {
62
+ break
63
+ }
64
+ stats = append(stats, bs)
65
+ }
66
+
67
+ return stats, nil
68
+}
69
+
70
+func (c *rethinkdbClient) close() (err error) {
71
+ return c.sess.Close()
72
+}
src/go/plugin/go.d/modules/rethinkdb/collect.go
new
+123
@@ -0,0 +1,123 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package rethinkdb
4
+
5
+import (
6
+ "encoding/json"
7
+ "errors"
8
+ "fmt"
9
+
10
+ "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm"
11
+)
12
+
13
+type (
14
+ // https://rethinkdb.com/docs/system-stats/
15
+ serverStats struct {
16
+ ID []string `json:"id"`
17
+ Server string `json:"server"`
18
+ QueryEngine struct {
19
+ ClientConnections int64 `json:"client_connections" stm:"client_connections"`
20
+ ClientsActive int64 `json:"clients_active" stm:"clients_active"`
21
+ QueriesTotal int64 `json:"queries_total" stm:"queries_total"`
22
+ ReadDocsTotal int64 `json:"read_docs_total" stm:"read_docs_total"`
23
+ WrittenDocsTotal int64 `json:"written_docs_total" stm:"written_docs_total"`
24
+ } `json:"query_engine" stm:""`
25
+
26
+ Error string `json:"error"`
27
+ }
28
+)
29
+
30
+func (r *Rethinkdb) collect() (map[string]int64, error) {
31
+ if r.rdb == nil {
32
+ conn, err := r.newConn(r.Config)
33
+ if err != nil {
34
+ return nil, err
35
+ }
36
+ r.rdb = conn
37
+ }
38
+
39
+ mx := make(map[string]int64)
40
+
41
+ if err := r.collectStats(mx); err != nil {
42
+ return nil, err
43
+ }
44
+
45
+ return mx, nil
46
+}
47
+
48
+func (r *Rethinkdb) collectStats(mx map[string]int64) error {
49
+ resp, err := r.rdb.stats()
50
+ if err != nil {
51
+ return err
52
+ }
53
+
54
+ if len(resp) == 0 {
55
+ return errors.New("empty stats response from server")
56
+ }
57
+
58
+ for _, v := range []string{
59
+ "cluster_servers_stats_request_success",
60
+ "cluster_servers_stats_request_timeout",
61
+ "cluster_client_connections",
62
+ "cluster_clients_active",
63
+ "cluster_queries_total",
64
+ "cluster_read_docs_total",
65
+ "cluster_written_docs_total",
66
+ } {
67
+ mx[v] = 0
68
+ }
69
+
70
+ seen := make(map[string]bool)
71
+
72
+ for _, bs := range resp[1:] { // skip cluster
73
+ var srv serverStats
74
+
75
+ if err := json.Unmarshal(bs, &srv); err != nil {
76
+ return fmt.Errorf("invalid stats response: failed to unmarshal server data: %v", err)
77
+ }
78
+ if len(srv.ID[0]) == 0 {
79
+ return errors.New("invalid stats response: empty id")
80
+ }
81
+ if srv.ID[0] != "server" {
82
+ continue
83
+ }
84
+ if len(srv.ID) != 2 {
85
+ return fmt.Errorf("invalid stats response: unexpected server id: '%v'", srv.ID)
86
+ }
87
+
88
+ srvUUID := srv.ID[1]
89
+
90
+ seen[srvUUID] = true
91
+
92
+ if !r.seenServers[srvUUID] {
93
+ r.seenServers[srvUUID] = true
94
+ r.addServerCharts(srvUUID, srv.Server)
95
+ }
96
+
97
+ px := fmt.Sprintf("server_%s_", srv.ID[1]) // uuid
98
+
99
+ mx[px+"stats_request_status_success"] = 0
100
+ mx[px+"stats_request_status_timeout"] = 0
101
+ if srv.Error != "" {
102
+ mx["cluster_servers_stats_request_timed_out"]++
103
+ mx[px+"stats_request_status_timeout"] = 1
104
+ continue
105
+ }
106
+ mx["cluster_servers_stats_request_success"]++
107
+ mx[px+"stats_request_status_success"] = 1
108
+
109
+ for k, v := range stm.ToMap(srv.QueryEngine) {
110
+ mx["cluster_"+k] += v
111
+ mx[px+k] = v
112
+ }
113
+ }
114
+
115
+ for k := range r.seenServers {
116
+ if !seen[k] {
117
+ delete(r.seenServers, k)
118
+ r.removeServerCharts(k)
119
+ }
120
+ }
121
+
122
+ return nil
123
+}
src/go/plugin/go.d/modules/rethinkdb/config_schema.json
new
+82
@@ -0,0 +1,82 @@
1
+{
2
+ "jsonSchema": {
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "title": "RethinkDB collector configuration.",
5
+ "type": "object",
6
+ "properties": {
7
+ "update_every": {
8
+ "title": "Update every",
9
+ "description": "Data collection interval, measured in seconds.",
10
+ "type": "integer",
11
+ "minimum": 1,
12
+ "default": 1
13
+ },
14
+ "address": {
15
+ "title": "Address",
16
+ "description": "The IP address and port where the RethinkDB service listens for connections.",
17
+ "type": "string",
18
+ "default": "127.0.0.1:28015"
19
+ },
20
+ "timeout": {
21
+ "title": "Timeout",
22
+ "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.",
23
+ "type": "number",
24
+ "minimum": 0.5,
25
+ "default": 1
26
+ },
27
+ "username": {
28
+ "title": "Username",
29
+ "description": "The username for basic authentication.",
30
+ "type": "string",
31
+ "sensitive": true
32
+ },
33
+ "password": {
34
+ "title": "Password",
35
+ "description": "The password for basic authentication.",
36
+ "type": "string",
37
+ "sensitive": true
38
+ }
39
+ },
40
+ "required": [
41
+ "address"
42
+ ],
43
+ "additionalProperties": false,
44
+ "patternProperties": {
45
+ "^name$": {}
46
+ }
47
+ },
48
+ "uiSchema": {
49
+ "uiOptions": {
50
+ "fullPage": true
51
+ },
52
+ "timeout": {
53
+ "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
54
+ },
55
+ "username": {
56
+ "ui:widget": "password"
57
+ },
58
+ "password": {
59
+ "ui:widget": "password"
60
+ },
61
+ "ui:flavour": "tabs",
62
+ "ui:options": {
63
+ "tabs": [
64
+ {
65
+ "title": "Base",
66
+ "fields": [
67
+ "update_every",
68
+ "address",
69
+ "timeout"
70
+ ]
71
+ },
72
+ {
73
+ "title": "Auth",
74
+ "fields": [
75
+ "username",
76
+ "password"
77
+ ]
78
+ }
79
+ ]
80
+ }
81
+ }
82
+}
src/go/plugin/go.d/modules/rethinkdb/metadata.yaml
new
+198
@@ -0,0 +1,198 @@
1
+plugin_name: go.d.plugin
2
+modules:
3
+ - meta:
4
+ id: collector-go.d.plugin-rethinkdb
5
+ plugin_name: go.d.plugin
6
+ module_name: rethinkdb
7
+ monitored_instance:
8
+ name: RethinkDB
9
+ link: https://rethinkdb.com
10
+ categories:
11
+ - data-collection.database-servers
12
+ icon_filename: "rethinkdb.png"
13
+ related_resources:
14
+ integrations:
15
+ list: []
16
+ info_provided_to_referring_integrations:
17
+ description: ""
18
+ keywords:
19
+ - rethinkdb
20
+ - database
21
+ - db
22
+ most_popular: false
23
+ overview:
24
+ data_collection:
25
+ metrics_description: |
26
+ It collects cluster-wide metrics such as server status, client connections, active clients, query rate, and document read/write rates.
27
+ For each server, it offers similar metrics.
28
+ method_description: |
29
+ The data is gathered by querying the stats table in RethinkDB, which stores real-time statistics related to the cluster and its individual servers.
30
+ supported_platforms:
31
+ include: []
32
+ exclude: []
33
+ multi_instance: true
34
+ additional_permissions:
35
+ description: ""
36
+ default_behavior:
37
+ auto_detection:
38
+ description: |
39
+ If no configuration is given, collector will attempt to connect to RethinkDB instance on `127.0.0.1:28015` address.
40
+ limits:
41
+ description: ""
42
+ performance_impact:
43
+ description: ""
44
+ setup:
45
+ prerequisites:
46
+ list: []
47
+ configuration:
48
+ file:
49
+ name: go.d/rethinkdb.conf
50
+ options:
51
+ description: |
52
+ The following options can be defined globally: update_every, autodetection_retry.
53
+ folding:
54
+ title: Config options
55
+ enabled: true
56
+ list:
57
+ - name: update_every
58
+ description: Data collection frequency.
59
+ default_value: 1
60
+ required: false
61
+ - name: autodetection_retry
62
+ description: Recheck interval in seconds. Zero means no recheck will be scheduled.
63
+ default_value: 0
64
+ required: false
65
+ - name: address
66
+ description: The IP address and port where the RethinkDB service listens for connections.
67
+ default_value: 127.0.0.1:28015
68
+ required: true
69
+ - name: timeout
70
+ description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution.
71
+ default_value: 1
72
+ required: false
73
+ - name: username
74
+ description: Username used for authentication.
75
+ default_value: ""
76
+ required: false
77
+ - name: password
78
+ description: Password used for authentication.
79
+ default_value: ""
80
+ required: false
81
+ examples:
82
+ folding:
83
+ title: Config
84
+ enabled: true
85
+ list:
86
+ - name: Basic
87
+ description: A basic example configuration.
88
+ config: |
89
+ jobs:
90
+ - name: local
91
+ address: 127.0.0.1:28015
92
+ - name: With authentication
93
+ description: An example configuration with authentication.
94
+ config: |
95
+ jobs:
96
+ - name: local
97
+ address: 127.0.0.1:28015
98
+ username: name
99
+ password: pass
100
+ - name: Multi-instance
101
+ description: |
102
+ > **Note**: When you define multiple jobs, their names must be unique.
103
+
104
+ Collecting metrics from local and remote instances.
105
+ config: |
106
+ jobs:
107
+ - name: local
108
+ address: 127.0.0.1:28015
109
+
110
+ - name: remote
111
+ address: 203.0.113.0:28015
112
+ troubleshooting:
113
+ problems:
114
+ list: []
115
+ alerts: []
116
+ metrics:
117
+ folding:
118
+ title: Metrics
119
+ enabled: false
120
+ description: ""
121
+ availability: []
122
+ scopes:
123
+ - name: global
124
+ description: "These metrics refer to the entire monitored application."
125
+ labels: []
126
+ metrics:
127
+ - name: rethinkdb.cluster_servers_stats_request
128
+ description: Cluster Servers Stats Request
129
+ unit: "servers"
130
+ chart_type: line
131
+ dimensions:
132
+ - name: success
133
+ - name: timeout
134
+ - name: rethinkdb.cluster_client_connections
135
+ description: Cluster Client Connections
136
+ unit: "connections"
137
+ chart_type: line
138
+ dimensions:
139
+ - name: connections
140
+ - name: rethinkdb.cluster_active_clients
141
+ description: Cluster Active Clients
142
+ unit: "clients"
143
+ chart_type: line
144
+ dimensions:
145
+ - name: active
146
+ - name: rethinkdb.cluster_queries
147
+ description: Cluster Queries
148
+ unit: "queries/s"
149
+ chart_type: line
150
+ dimensions:
151
+ - name: queries
152
+ - name: rethinkdb.cluster_documents
153
+ description: Cluster Documents
154
+ unit: "documents/s"
155
+ chart_type: line
156
+ dimensions:
157
+ - name: read
158
+ - name: written
159
+ - name: server
160
+ description: "These metrics refer to the server (cluster member)."
161
+ labels:
162
+ - name: server_uuid
163
+ description: Server UUID.
164
+ - name: server_name
165
+ description: Server name.
166
+ metrics:
167
+ - name: rethinkdb.server_stats_request_status
168
+ description: Server Stats Request Status
169
+ unit: "status"
170
+ chart_type: line
171
+ dimensions:
172
+ - name: success
173
+ - name: timeout
174
+ - name: rethinkdb.server_client_connections
175
+ description: Server Client Connections
176
+ unit: "connections"
177
+ chart_type: line
178
+ dimensions:
179
+ - name: connections
180
+ - name: rethinkdb.server_active_clients
181
+ description: Server Active Clients
182
+ unit: "clients"
183
+ chart_type: line
184
+ dimensions:
185
+ - name: active
186
+ - name: rethinkdb.server_queries
187
+ description: Server Queries
188
+ unit: "queries/s"
189
+ chart_type: line
190
+ dimensions:
191
+ - name: queries
192
+ - name: rethinkdb.server_documents
193
+ description: Server Documents
194
+ unit: "documents/s"
195
+ chart_type: line
196
+ dimensions:
197
+ - name: read
198
+ - name: written
src/go/plugin/go.d/modules/rethinkdb/rethinkdb.go
new
+107
@@ -0,0 +1,107 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package rethinkdb
4
+
5
+import (
6
+ _ "embed"
7
+ "errors"
8
+ "time"
9
+
10
+ "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module"
11
+ "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web"
12
+)
13
+
14
+//go:embed "config_schema.json"
15
+var configSchema string
16
+
17
+func init() {
18
+ module.Register("rethinkdb", module.Creator{
19
+ JobConfigSchema: configSchema,
20
+ Create: func() module.Module { return New() },
21
+ Config: func() any { return &Config{} },
22
+ })
23
+}
24
+
25
+func New() *Rethinkdb {
26
+ return &Rethinkdb{
27
+ Config: Config{
28
+ Address: "127.0.0.1:28015",
29
+ Timeout: web.Duration(time.Second * 1),
30
+ },
31
+
32
+ charts: clusterCharts.Copy(),
33
+ newConn: newRethinkdbConn,
34
+ seenServers: make(map[string]bool),
35
+ }
36
+}
37
+
38
+type Config struct {
39
+ UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"`
40
+ Address string `yaml:"address" json:"address"`
41
+ Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"`
42
+ Username string `yaml:"username,omitempty" json:"username"`
43
+ Password string `yaml:"password,omitempty" json:"password"`
44
+}
45
+
46
+type (
47
+ Rethinkdb struct {
48
+ module.Base
49
+ Config `yaml:",inline" json:""`
50
+
51
+ charts *module.Charts
52
+
53
+ newConn func(cfg Config) (rdbConn, error)
54
+ rdb rdbConn
55
+
56
+ seenServers map[string]bool
57
+ }
58
+)
59
+
60
+func (r *Rethinkdb) Configuration() any {
61
+ return r.Config
62
+}
63
+
64
+func (r *Rethinkdb) Init() error {
65
+ if r.Address == "" {
66
+ r.Error("address is not set")
67
+ return errors.New("address is not set")
68
+ }
69
+ return nil
70
+}
71
+
72
+func (r *Rethinkdb) Check() error {
73
+ mx, err := r.collect()
74
+ if err != nil {
75
+ r.Error(err)
76
+ return err
77
+ }
78
+ if len(mx) == 0 {
79
+ return errors.New("no metrics collected")
80
+ }
81
+ return nil
82
+}
83
+
84
+func (r *Rethinkdb) Charts() *module.Charts {
85
+ return r.charts
86
+}
87
+
88
+func (r *Rethinkdb) Collect() map[string]int64 {
89
+ ms, err := r.collect()
90
+ if err != nil {
91
+ r.Error(err)
92
+ }
93
+
94
+ if len(ms) == 0 {
95
+ return nil
96
+ }
97
+ return ms
98
+}
99
+
100
+func (r *Rethinkdb) Cleanup() {
101
+ if r.rdb != nil {
102
+ if err := r.rdb.close(); err != nil {
103
+ r.Warningf("cleanup: error on closing client [%s]: %v", r.Address, err)
104
+ }
105
+ r.rdb = nil
106
+ }
107
+}
src/go/plugin/go.d/modules/rethinkdb/rethinkdb_test.go
new
+259
@@ -0,0 +1,259 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+package rethinkdb
4
+
5
+import (
6
+ "bytes"
7
+ "errors"
8
+ "fmt"
9
+ "os"
10
+ "testing"
11
+
12
+ "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module"
13
+
14
+ "github.com/stretchr/testify/assert"
15
+ "github.com/stretchr/testify/require"
16
+)
17
+
18
+var (
19
+ dataConfigJSON, _ = os.ReadFile("testdata/config.json")
20
+ dataConfigYAML, _ = os.ReadFile("testdata/config.yaml")
21
+
22
+ dataStats, _ = os.ReadFile("testdata/v2.4.4/stats.txt")
23
+)
24
+
25
+func Test_testDataIsValid(t *testing.T) {
26
+ for name, data := range map[string][]byte{
27
+ "dataConfigJSON": dataConfigJSON,
28
+ "dataConfigYAML": dataConfigYAML,
29
+
30
+ "dataStats": dataStats,
31
+ } {
32
+ require.NotNil(t, data, name)
33
+ }
34
+}
35
+
36
+func TestRethinkdb_ConfigurationSerialize(t *testing.T) {
37
+ module.TestConfigurationSerialize(t, &Rethinkdb{}, dataConfigJSON, dataConfigYAML)
38
+}
39
+
40
+func TestRethinkdb_Init(t *testing.T) {
41
+ tests := map[string]struct {
42
+ config Config
43
+ wantFail bool
44
+ }{
45
+ "success with default config": {
46
+ wantFail: false,
47
+ config: New().Config,
48
+ },
49
+ "fails if address not set": {
50
+ wantFail: true,
51
+ config: func() Config {
52
+ conf := New().Config
53
+ conf.Address = ""
54
+ return conf
55
+ }(),
56
+ },
57
+ }
58
+
59
+ for name, test := range tests {
60
+ t.Run(name, func(t *testing.T) {
61
+ rdb := New()
62
+ rdb.Config = test.config
63
+
64
+ if test.wantFail {
65
+ assert.Error(t, rdb.Init())
66
+ } else {
67
+ assert.NoError(t, rdb.Init())
68
+ }
69
+ })
70
+ }
71
+}
72
+
73
+func TestRethinkdb_Cleanup(t *testing.T) {
74
+ tests := map[string]struct {
75
+ prepare func() *Rethinkdb
76
+ }{
77
+ "not initialized": {
78
+ prepare: func() *Rethinkdb {
79
+ return New()
80
+ },
81
+ },
82
+ "after check": {
83
+ prepare: func() *Rethinkdb {
84
+ rdb := New()
85
+ rdb.newConn = func(config Config) (rdbConn, error) {
86
+ return &mockRethinkdbConn{dataStats: dataStats}, nil
87
+ }
88
+ _ = rdb.Check()
89
+ return rdb
90
+ },
91
+ },
92
+ "after collect": {
93
+ prepare: func() *Rethinkdb {
94
+ rdb := New()
95
+ rdb.newConn = func(config Config) (rdbConn, error) {
96
+ return &mockRethinkdbConn{dataStats: dataStats}, nil
97
+ }
98
+ _ = rdb.Check()
99
+ return rdb
100
+ },
101
+ },
102
+ }
103
+
104
+ for name, test := range tests {
105
+ t.Run(name, func(t *testing.T) {
106
+ rdb := test.prepare()
107
+
108
+ assert.NotPanics(t, rdb.Cleanup)
109
+ })
110
+ }
111
+}
112
+
113
+func TestRethinkdb_Check(t *testing.T) {
114
+ tests := map[string]struct {
115
+ prepare func() *Rethinkdb
116
+ wantFail bool
117
+ }{
118
+ "success on valid response": {
119
+ wantFail: false,
120
+ prepare: prepareCaseOk,
121
+ },
122
+ "fails if error on stats": {
123
+ wantFail: true,
124
+ prepare: prepareCaseErrOnStats,
125
+ },
126
+ "fails if error on connect": {
127
+ wantFail: true,
128
+ prepare: prepareCaseErrOnConnect,
129
+ },
130
+ }
131
+
132
+ for name, test := range tests {
133
+ t.Run(name, func(t *testing.T) {
134
+ rdb := test.prepare()
135
+
136
+ if test.wantFail {
137
+ assert.Error(t, rdb.Check())
138
+ } else {
139
+ assert.NoError(t, rdb.Check())
140
+ }
141
+
142
+ if m, ok := rdb.rdb.(*mockRethinkdbConn); ok {
143
+ assert.False(t, m.disconnectCalled, "rdb close before cleanup")
144
+ rdb.Cleanup()
145
+ assert.True(t, m.disconnectCalled, "rdb close after cleanup")
146
+ }
147
+ })
148
+ }
149
+}
150
+
151
+func TestRethinkdb_Collect(t *testing.T) {
152
+ tests := map[string]struct {
153
+ prepare func() *Rethinkdb
154
+ wantMetrics map[string]int64
155
+ wantCharts int
156
+ }{
157
+ "success on valid response": {
158
+ prepare: prepareCaseOk,
159
+ wantCharts: len(clusterCharts) + len(serverChartsTmpl)*2,
160
+ wantMetrics: map[string]int64{
161
+ "cluster_client_connections": 3,
162
+ "cluster_clients_active": 3,
163
+ "cluster_queries_total": 27,
164
+ "cluster_read_docs_total": 3,
165
+ "cluster_servers_stats_request_success": 2,
166
+ "cluster_servers_stats_request_timeout": 0,
167
+ "cluster_written_docs_total": 3,
168
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_client_connections": 1,
169
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_clients_active": 1,
170
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_queries_total": 13,
171
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_read_docs_total": 1,
172
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_stats_request_status_success": 1,
173
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_stats_request_status_timeout": 0,
174
+ "server_b7730db2-4303-4719-aef8-2a3c339c672b_written_docs_total": 1,
175
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_client_connections": 2,
176
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_clients_active": 2,
177
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_queries_total": 14,
178
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_read_docs_total": 2,
179
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_stats_request_status_success": 1,
180
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_stats_request_status_timeout": 0,
181
+ "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_written_docs_total": 2,
182
+ },
183
+ },
184
+ "fails if error on stats": {
185
+ wantCharts: len(clusterCharts),
186
+ prepare: prepareCaseErrOnStats,
187
+ },
188
+ "fails if error on connect": {
189
+ wantCharts: len(clusterCharts),
190
+ prepare: prepareCaseErrOnStats,
191
+ },
192
+ }
193
+
194
+ for name, test := range tests {
195
+ t.Run(name, func(t *testing.T) {
196
+ rdb := test.prepare()
197
+
198
+ require.NoError(t, rdb.Init())
199
+
200
+ mx := rdb.Collect()
201
+
202
+ require.Equal(t, test.wantMetrics, mx)
203
+
204
+ assert.Equal(t, test.wantCharts, len(*rdb.Charts()))
205
+
206
+ if len(test.wantMetrics) > 0 {
207
+ module.TestMetricsHasAllChartsDims(t, rdb.Charts(), mx)
208
+ }
209
+
210
+ if m, ok := rdb.rdb.(*mockRethinkdbConn); ok {
211
+ assert.False(t, m.disconnectCalled, "rdb close before cleanup")
212
+ rdb.Cleanup()
213
+ assert.True(t, m.disconnectCalled, "rdb close after cleanup")
214
+ }
215
+ })
216
+ }
217
+}
218
+
219
+func prepareCaseOk() *Rethinkdb {
220
+ rdb := New()
221
+ rdb.newConn = func(cfg Config) (rdbConn, error) {
222
+ return &mockRethinkdbConn{dataStats: dataStats}, nil
223
+ }
224
+ return rdb
225
+}
226
+
227
+func prepareCaseErrOnStats() *Rethinkdb {
228
+ rdb := New()
229
+ rdb.newConn = func(cfg Config) (rdbConn, error) {
230
+ return &mockRethinkdbConn{errOnStats: true}, nil
231
+ }
232
+ return rdb
233
+}
234
+
235
+func prepareCaseErrOnConnect() *Rethinkdb {
236
+ rdb := New()
237
+ rdb.newConn = func(cfg Config) (rdbConn, error) {
238
+ return nil, errors.New("mock failed to connect")
239
+ }
240
+ return rdb
241
+}
242
+
243
+type mockRethinkdbConn struct {
244
+ dataStats []byte
245
+ errOnStats bool
246
+ disconnectCalled bool
247
+}
248
+
249
+func (m *mockRethinkdbConn) stats() ([][]byte, error) {
250
+ if m.errOnStats {
251
+ return nil, fmt.Errorf("mock.stats() error")
252
+ }
253
+ return bytes.Split(bytes.TrimSpace(m.dataStats), []byte("\n")), nil
254
+}
255
+
256
+func (m *mockRethinkdbConn) close() error {
257
+ m.disconnectCalled = true
258
+ return nil
259
+}
src/go/plugin/go.d/modules/rethinkdb/testdata/config.json
new
+7
@@ -0,0 +1,7 @@
1
+{
2
+ "update_every": 123,
3
+ "address": "ok",
4
+ "timeout": 123.123,
5
+ "username": "ok",
6
+ "password": "ok"
7
+}
src/go/plugin/go.d/modules/rethinkdb/testdata/config.yaml
new
+5
@@ -0,0 +1,5 @@
1
+update_every: 123
2
+address: "ok"
3
+timeout: 123.123
4
+username: "ok"
5
+password: "ok"
src/go/plugin/go.d/modules/rethinkdb/testdata/v2.4.4/stats.txt
new
+3
@@ -0,0 +1,3 @@
1
+{"id":["cluster"],"query_engine":{"client_connections":1,"clients_active":1,"queries_per_sec":1,"read_docs_per_sec":0,"written_docs_per_sec":0}}
2
+{"id":["server","b7730db2-4303-4719-aef8-2a3c339c672b"],"query_engine":{"client_connections":1,"clients_active":1,"queries_per_sec":1,"queries_total":13,"read_docs_per_sec":0,"read_docs_total":1,"written_docs_per_sec":0,"written_docs_total":1},"server":"some_hostname_182"}
3
+{"id":["server","f325e3c3-22d9-4005-b4b2-1f561d384edc"],"query_engine":{"client_connections":2,"clients_active":2,"queries_per_sec":1,"queries_total":14,"read_docs_per_sec":0,"read_docs_total":2,"written_docs_per_sec":0,"written_docs_total":2},"server":"pve_deb_work_183"}