diff --git a/docs/LICENSE_OF_DEPENDENCIES.md b/docs/LICENSE_OF_DEPENDENCIES.md index 7c1949e827f27..163f35af3d133 100644 --- a/docs/LICENSE_OF_DEPENDENCIES.md +++ b/docs/LICENSE_OF_DEPENDENCIES.md @@ -47,7 +47,6 @@ following works: - github.com/PaesslerAG/gval [BSD 3-Clause "New" or "Revised" License](https://github.com/PaesslerAG/gval/blob/master/LICENSE) - github.com/SAP/go-hdb [Apache License 2.0](https://github.com/SAP/go-hdb/blob/main/LICENSE.md) - github.com/abbot/go-http-auth [Apache License 2.0](https://github.com/abbot/go-http-auth/blob/master/LICENSE) -- github.com/aerospike/aerospike-client-go [Apache License 2.0](https://github.com/aerospike/aerospike-client-go/blob/master/LICENSE) - github.com/alecthomas/participle [MIT License](https://github.com/alecthomas/participle/blob/master/COPYING) - github.com/alecthomas/units [MIT License](https://github.com/alecthomas/units/blob/master/COPYING) - github.com/alitto/pond [MIT License](https://github.com/alitto/pond/blob/master/LICENSE) @@ -444,7 +443,6 @@ following works: - github.com/xdg/stringprep [Apache License 2.0](https://github.com/xdg-go/stringprep/blob/master/LICENSE) - github.com/xrash/smetrics [MIT License](https://github.com/xrash/smetrics/blob/master/LICENSE) - github.com/youmark/pkcs8 [MIT License](https://github.com/youmark/pkcs8/blob/master/LICENSE) -- github.com/yuin/gopher-lua [MIT License](https://github.com/yuin/gopher-lua/blob/master/LICENSE) - github.com/yusufpapurcu/wmi [MIT License](https://github.com/yusufpapurcu/wmi/blob/master/LICENSE) - github.com/zeebo/xxh3 [BSD 2-Clause "Simplified" License](https://github.com/zeebo/xxh3/blob/master/LICENSE) - github.com/zentures/cityhash [MIT License](https://github.com/zentures/cityhash/blob/master/LICENSE) diff --git a/go.mod b/go.mod index e3473d025c3e2..6798512a667b2 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,6 @@ require ( github.com/Mellanox/rdmamap v1.2.0 github.com/PaesslerAG/gval v1.2.4 github.com/SAP/go-hdb v1.16.12 - github.com/aerospike/aerospike-client-go/v5 v5.11.0 github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b github.com/alitto/pond v1.9.2 github.com/alitto/pond/v2 v2.7.1 @@ -549,7 +548,6 @@ require ( github.com/xdg/stringprep v1.0.3 // indirect github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect - github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/assert v1.3.1 // indirect github.com/zeebo/xxh3 v1.1.0 // indirect diff --git a/go.sum b/go.sum index adb8abc2364f7..bba845cb2a499 100644 --- a/go.sum +++ b/go.sum @@ -802,8 +802,6 @@ github.com/aalpar/deheap v0.0.0-20210914013432-0cc84d79dec3 h1:hhdWprfSpFbN7lz3W github.com/aalpar/deheap v0.0.0-20210914013432-0cc84d79dec3/go.mod h1:XaUnRxSCYgL3kkgX0QHIV0D+znljPIDImxlv2kbGv0Y= github.com/abbot/go-http-auth v0.4.0 h1:QjmvZ5gSC7jm3Zg54DqWE/T5m1t2AfDu6QlXJT0EVT0= github.com/abbot/go-http-auth v0.4.0/go.mod h1:Cz6ARTIzApMJDzh5bRMSUou6UMSp0IEXg9km/ci7TJM= -github.com/aerospike/aerospike-client-go/v5 v5.11.0 h1:z3ZmDSm3I10VMXXIIrsFCFq3IenwFqTCnLNyvnFVzrk= -github.com/aerospike/aerospike-client-go/v5 v5.11.0/go.mod h1:e/zYeIoBg9We63fLKa+h+198+fT1GdoLfKa+Pu4QSpg= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -1329,7 +1327,6 @@ github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-stomp/stomp v2.1.4+incompatible h1:D3SheUVDOz9RsjVWkoh/1iCOwD0qWjyeTZMUZ0EXg2Y= github.com/go-stomp/stomp v2.1.4+incompatible/go.mod h1:VqCtqNZv1226A1/79yh+rMiFUcfY3R109np+7ke4n0c= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= @@ -2009,7 +2006,6 @@ github.com/nsqio/go-nsq v1.1.0/go.mod h1:vKq36oyeVXgsS5Q8YEO7WghqidAVXQlcFxzQbQT github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/nwaples/tacplus v0.0.3 h1:i3v/BUWWrbKq00BzFDrgcPksUF4HwAWvS8Zk63ezYXg= github.com/nwaples/tacplus v0.0.3/go.mod h1:y5ZA9N5V2JbmwO766S+ET9zuu5FtL1OtdfBCYrbTIgw= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4= @@ -2023,15 +2019,10 @@ github.com/olivere/elastic/v7 v7.0.12/go.mod h1:14rWX28Pnh3qCKYRVnSGXWLf9MbLonYS github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.101.0 h1:TCQYvGS2MKTotOTQDnHUSd4ljEzXRzHXopdv71giKWU= @@ -2468,8 +2459,6 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE= github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= -github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= github.com/yunify/qingstor-sdk-go/v3 v3.2.0 h1:9sB2WZMgjwSUNZhrgvaNGazVltoFUUfuS9f0uCWtTr8= github.com/yunify/qingstor-sdk-go/v3 v3.2.0/go.mod h1:KciFNuMu6F4WLk9nGwwK69sCGKLCdd9f97ac/wfumS4= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= @@ -2715,7 +2704,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -2732,7 +2720,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2834,7 +2821,6 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2847,7 +2833,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2856,7 +2841,6 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2885,7 +2869,6 @@ golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210123111255-9b0068b26619/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3068,7 +3051,6 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= diff --git a/plugins/inputs/aerospike/README.md b/plugins/inputs/aerospike/README.md deleted file mode 100644 index 96c41c8c06b75..0000000000000 --- a/plugins/inputs/aerospike/README.md +++ /dev/null @@ -1,189 +0,0 @@ -# Aerospike Input Plugin - -This plugin queries [Aerospike][aerospike] server(s) for node statistics and -statistics on all configured namespaces. - -> [!CAUTION] -> As of version 1.30 the Aerospike plugin has been deprecated in favor of the -> [prometheus plugin](/plugins/inputs/prometheus/README.md) and the officially -> supported [Aerospike Prometheus Exporter][prometheus_exporter] - -For details on the measurements mean, please consult the -[Aerospike Metrics Reference Docs][ref_manual]. - -> [!NOTE] -> Metric names will have dashes (`-`) replaced as underscores (`_`) to make -> querying more consistently and easy. - -All metrics are attempted to be cast to integers, then booleans, then strings -in order. - -⭐ Telegraf v0.2.0 -🚩 Telegraf v1.30.0 -🔥 Telegraf v1.40.0 -🏷️ server -💻 all - -[aerospike]: https://www.aerospike.com -[prometheus_exporter]: https://aerospike.com/docs/monitorstack/configure/configure-exporter -[ref_manual]: https://www.aerospike.com/docs/reference/metrics - -## Global configuration options - -Plugins support additional global and plugin configuration settings for tasks -such as modifying metrics, tags, and fields, creating aliases, and configuring -plugin ordering. See [CONFIGURATION.md][CONFIGURATION.md] for more details. - -[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins - -## Configuration - -```toml @sample.conf -# Read stats from aerospike server(s) -[[inputs.aerospike]] - ## Aerospike servers to connect to (with port) - ## This plugin will query all namespaces the aerospike - ## server has configured and get stats for them. - servers = ["localhost:3000"] - - # username = "telegraf" - # password = "pa$$word" - - ## Optional TLS Config - ## Set to true/false to enforce TLS being enabled/disabled. If not set, - ## enable TLS only if any of the other options are specified. - # tls_enable = - ## Trusted root certificates for server - # tls_ca = "/path/to/cafile" - ## Used for TLS client certificate authentication - # tls_cert = "/path/to/certfile" - ## Used for TLS client certificate authentication - # tls_key = "/path/to/keyfile" - ## Password for the key file if it is encrypted - # tls_key_pwd = "" - ## Send the specified TLS server name via SNI - # tls_server_name = "kubernetes.example.com" - ## Minimal TLS version to accept by the client - # tls_min_version = "TLS12" - ## List of ciphers to accept, by default all secure ciphers will be accepted - ## See https://pkg.go.dev/crypto/tls#pkg-constants for supported values. - ## Use "all", "secure" and "insecure" to add all support ciphers, secure - ## suites or insecure suites respectively. - # tls_cipher_suites = ["secure"] - ## Renegotiation method, "never", "once" or "freely" - # tls_renegotiation_method = "never" - ## Use TLS but skip chain & host verification - # insecure_skip_verify = false - - # Feature Options - # Add namespace variable to limit the namespaces executed on - # Leave blank to do all - # disable_query_namespaces = true # default false - # namespaces = ["namespace1", "namespace2"] - - # Enable set level telemetry - # query_sets = true # default: false - # Add namespace set combinations to limit sets executed on - # Leave blank to do all sets - # sets = ["namespace1/set1", "namespace1/set2", "namespace3"] - - # Histograms - # enable_ttl_histogram = true # default: false - # enable_object_size_linear_histogram = true # default: false - - # by default, aerospike produces a 100 bucket histogram - # this is not great for most graphing tools, this will allow - # the ability to squash this to a smaller number of buckets - # To have a balanced histogram, the number of buckets chosen - # should divide evenly into 100. - # num_histogram_buckets = 100 # default: 10 -``` - -## Metrics - -The aerospike metrics are under a few measurement names: - -***aerospike_node***: These are the aerospike **node** measurements, which are -available from the aerospike `statistics` command. - -```text - telnet localhost 3003 - statistics - ... -``` - -***aerospike_namespace***: These are aerospike namespace measurements, which -are available from the aerospike `namespace/` command. - -```text - telnet localhost 3003 - namespaces - ;;etc. - namespace/ - ... -``` - -***aerospike_set***: These are aerospike set measurements, which -are available from the aerospike `sets//` command. - -```text - telnet localhost 3003 - sets - sets/ - sets// - ... -``` - -***aerospike_histogram_ttl***: These are aerospike ttl hisogram measurements, -which is available from the aerospike -`histogram:namespace=;[set=;]type=ttl` command. - -```text - telnet localhost 3003 - histogram:namespace=;type=ttl - histogram:namespace=;[set=;]type=ttl - ... -``` - -***aerospike_histogram_object_size_linear***: These are aerospike object size -linear histogram measurements, which is available from the aerospike -`histogram:namespace=;[set=;]type=object_size_linear` -command. - -```text - telnet localhost 3003 - histogram:namespace=;type=object_size_linear - histogram:namespace=;[set=;]type=object_size_linear - ... -``` - -### Tags - -All measurements have tags: - -- aerospike_host -- node_name - -Namespace metrics have tags: - -- namespace_name - -Set metrics have tags: - -- namespace_name -- set_name - -Histogram metrics have tags: - -- namespace_name -- set_name (optional) -- type - -## Example Output - -```text -aerospike_node,aerospike_host=localhost:3000,node_name="BB9020011AC4202" batch_error=0i,batch_index_complete=0i,batch_index_created_buffers=0i,batch_index_destroyed_buffers=0i,batch_index_error=0i,batch_index_huge_buffers=0i,batch_index_initiate=0i,batch_index_queue="0:0,0:0,0:0,0:0",batch_index_timeout=0i,batch_index_unused_buffers=0i,batch_initiate=0i,batch_queue=0i,batch_timeout=0i,client_connections=6i,cluster_integrity=true,cluster_key="8AF422E05281249E",cluster_size=1i,delete_queue=0i,demarshal_error=0i,early_tsvc_batch_sub_error=0i,early_tsvc_client_error=0i,early_tsvc_udf_sub_error=0i,fabric_connections=16i,fabric_msgs_rcvd=0i,fabric_msgs_sent=0i,heartbeat_connections=0i,heartbeat_received_foreign=0i,heartbeat_received_self=0i,info_complete=47i,info_queue=0i,migrate_allowed=true,migrate_partitions_remaining=0i,migrate_progress_recv=0i,migrate_progress_send=0i,objects=0i,paxos_principal="BB9020011AC4202",proxy_in_progress=0i,proxy_retry=0i,query_long_running=0i,query_short_running=0i,reaped_fds=0i,record_refs=0i,rw_in_progress=0i,scans_active=0i,sindex_gc_activity_dur=0i,sindex_gc_garbage_cleaned=0i,sindex_gc_garbage_found=0i,sindex_gc_inactivity_dur=0i,sindex_gc_list_creation_time=0i,sindex_gc_list_deletion_time=0i,sindex_gc_locktimedout=0i,sindex_gc_objects_validated=0i,sindex_ucgarbage_found=0i,sub_objects=0i,system_free_mem_pct=92i,system_swapping=false,tsvc_queue=0i,uptime=1457i 1468923222000000000 -aerospike_namespace,aerospike_host=localhost:3000,namespace=test,node_name="BB9020011AC4202" allow_nonxdr_writes=true,allow_xdr_writes=true,available_bin_names=32768i,batch_sub_proxy_complete=0i,batch_sub_proxy_error=0i,batch_sub_proxy_timeout=0i,batch_sub_read_error=0i,batch_sub_read_not_found=0i,batch_sub_read_success=0i,batch_sub_read_timeout=0i,batch_sub_tsvc_error=0i,batch_sub_tsvc_timeout=0i,client_delete_error=0i,client_delete_not_found=0i,client_delete_success=0i,client_delete_timeout=0i,client_lang_delete_success=0i,client_lang_error=0i,client_lang_read_success=0i,client_lang_write_success=0i,client_proxy_complete=0i,client_proxy_error=0i,client_proxy_timeout=0i,client_read_error=0i,client_read_not_found=0i,client_read_success=0i,client_read_timeout=0i,client_tsvc_error=0i,client_tsvc_timeout=0i,client_udf_complete=0i,client_udf_error=0i,client_udf_timeout=0i,client_write_error=0i,client_write_success=0i,client_write_timeout=0i,cold_start_evict_ttl=4294967295i,conflict_resolution_policy="generation",current_time=206619222i,data_in_index=false,default_ttl=432000i,device_available_pct=99i,device_free_pct=100i,device_total_bytes=4294967296i,device_used_bytes=0i,disallow_null_setname=false,enable_benchmarks_batch_sub=false,enable_benchmarks_read=false,enable_benchmarks_storage=false,enable_benchmarks_udf=false,enable_benchmarks_udf_sub=false,enable_benchmarks_write=false,enable_hist_proxy=false,enable_xdr=false,evict_hist_buckets=10000i,evict_tenths_pct=5i,evict_ttl=0i,evicted_objects=0i,expired_objects=0i,fail_generation=0i,fail_key_busy=0i,fail_record_too_big=0i,fail_xdr_forbidden=0i,geo2dsphere_within.earth_radius_meters=6371000i,geo2dsphere_within.level_mod=1i,geo2dsphere_within.max_cells=12i,geo2dsphere_within.max_level=30i,geo2dsphere_within.min_level=1i,geo2dsphere_within.strict=true,geo_region_query_cells=0i,geo_region_query_falsepos=0i,geo_region_query_points=0i,geo_region_query_reqs=0i,high_water_disk_pct=50i,high_water_memory_pct=60i,hwm_breached=false,ldt_enabled=false,ldt_gc_rate=0i,ldt_page_size=8192i,master_objects=0i,master_sub_objects=0i,max_ttl=315360000i,max_void_time=0i,memory_free_pct=100i,memory_size=1073741824i,memory_used_bytes=0i,memory_used_data_bytes=0i,memory_used_index_bytes=0i,memory_used_sindex_bytes=0i,migrate_order=5i,migrate_record_receives=0i,migrate_record_retransmits=0i,migrate_records_skipped=0i,migrate_records_transmitted=0i,migrate_rx_instances=0i,migrate_rx_partitions_active=0i,migrate_rx_partitions_initial=0i,migrate_rx_partitions_remaining=0i,migrate_sleep=1i,migrate_tx_instances=0i,migrate_tx_partitions_active=0i,migrate_tx_partitions_imbalance=0i,migrate_tx_partitions_initial=0i,migrate_tx_partitions_remaining=0i,non_expirable_objects=0i,ns_forward_xdr_writes=false,nsup_cycle_duration=0i,nsup_cycle_sleep_pct=0i,objects=0i,prole_objects=0i,prole_sub_objects=0i,query_agg=0i,query_agg_abort=0i,query_agg_avg_rec_count=0i,query_agg_error=0i,query_agg_success=0i,query_fail=0i,query_long_queue_full=0i,query_long_reqs=0i,query_lookup_abort=0i,query_lookup_avg_rec_count=0i,query_lookup_error=0i,query_lookup_success=0i,query_lookups=0i,query_reqs=0i,query_short_queue_full=0i,query_short_reqs=0i,query_udf_bg_failure=0i,query_udf_bg_success=0i,read_consistency_level_override="off",repl_factor=1i,scan_aggr_abort=0i,scan_aggr_complete=0i,scan_aggr_error=0i,scan_basic_abort=0i,scan_basic_complete=0i,scan_basic_error=0i,scan_udf_bg_abort=0i,scan_udf_bg_complete=0i,scan_udf_bg_error=0i,set_deleted_objects=0i,sets_enable_xdr=true,sindex.data_max_memory="ULONG_MAX",sindex.num_partitions=32i,single_bin=false,stop_writes=false,stop_writes_pct=90i,storage_engine="device",storage_engine.cold_start_empty=false,storage_engine.data_in_memory=true,storage_engine.defrag_lwm_pct=50i,storage_engine.defrag_queue_min=0i,storage_engine.defrag_sleep=1000i,storage_engine.defrag_startup_minimum=10i,storage_engine.disable_odirect=false,storage_engine.enable_osync=false,storage_engine.file="/opt/aerospike/data/test.dat",storage_engine.filesize=4294967296i,storage_engine.flush_max_ms=1000i,storage_engine.fsync_max_sec=0i,storage_engine.max_write_cache=67108864i,storage_engine.min_avail_pct=5i,storage_engine.post_write_queue=0i,storage_engine.scheduler_mode="null",storage_engine.write_block_size=1048576i,storage_engine.write_threads=1i,sub_objects=0i,udf_sub_lang_delete_success=0i,udf_sub_lang_error=0i,udf_sub_lang_read_success=0i,udf_sub_lang_write_success=0i,udf_sub_tsvc_error=0i,udf_sub_tsvc_timeout=0i,udf_sub_udf_complete=0i,udf_sub_udf_error=0i,udf_sub_udf_timeout=0i,write_commit_level_override="off",xdr_write_error=0i,xdr_write_success=0i,xdr_write_timeout=0i,{test}_query_hist_track_back=300i,{test}_query_hist_track_slice=10i,{test}_query_hist_track_thresholds="1,8,64",{test}_read_hist_track_back=300i,{test}_read_hist_track_slice=10i,{test}_read_hist_track_thresholds="1,8,64",{test}_udf_hist_track_back=300i,{test}_udf_hist_track_slice=10i,{test}_udf_hist_track_thresholds="1,8,64",{test}_write_hist_track_back=300i,{test}_write_hist_track_slice=10i,{test}_write_hist_track_thresholds="1,8,64" 1468923222000000000 -aerospike_set,aerospike_host=localhost:3000,node_name=BB99458B42826B0,set=test/test disable_eviction=false,memory_data_bytes=0i,objects=0i,set_enable_xdr="use-default",stop_writes_count=0i,tombstones=0i,truncate_lut=0i 1598033805000000000 -aerospike_histogram_ttl,aerospike_host=localhost:3000,namespace=test,node_name=BB98EE5B42826B0,set=test 0=0i,1=0i,10=0i,11=0i,12=0i,13=0i,14=0i,15=0i,16=0i,17=0i,18=0i,19=0i,2=0i,20=0i,21=0i,22=0i,23=0i,24=0i,25=0i,26=0i,27=0i,28=0i,29=0i,3=0i,30=0i,31=0i,32=0i,33=0i,34=0i,35=0i,36=0i,37=0i,38=0i,39=0i,4=0i,40=0i,41=0i,42=0i,43=0i,44=0i,45=0i,46=0i,47=0i,48=0i,49=0i,5=0i,50=0i,51=0i,52=0i,53=0i,54=0i,55=0i,56=0i,57=0i,58=0i,59=0i,6=0i,60=0i,61=0i,62=0i,63=0i,64=0i,65=0i,66=0i,67=0i,68=0i,69=0i,7=0i,70=0i,71=0i,72=0i,73=0i,74=0i,75=0i,76=0i,77=0i,78=0i,79=0i,8=0i,80=0i,81=0i,82=0i,83=0i,84=0i,85=0i,86=0i,87=0i,88=0i,89=0i,9=0i,90=0i,91=0i,92=0i,93=0i,94=0i,95=0i,96=0i,97=0i,98=0i,99=0i 1598034191000000000 -``` diff --git a/plugins/inputs/aerospike/aerospike.go b/plugins/inputs/aerospike/aerospike.go deleted file mode 100644 index 64418584cdaa3..0000000000000 --- a/plugins/inputs/aerospike/aerospike.go +++ /dev/null @@ -1,454 +0,0 @@ -//go:generate ../../../tools/config_includer/generator -//go:generate ../../../tools/readme_config_includer/generator -package aerospike - -import ( - "crypto/tls" - _ "embed" - "fmt" - "math" - "strconv" - "strings" - "sync" - "time" - - as "github.com/aerospike/aerospike-client-go/v5" - - "github.com/influxdata/telegraf" - common_tls "github.com/influxdata/telegraf/plugins/common/tls" - "github.com/influxdata/telegraf/plugins/inputs" -) - -//go:embed sample.conf -var sampleConfig string - -type Aerospike struct { - Servers []string `toml:"servers"` - - Username string `toml:"username"` - Password string `toml:"password"` - - EnableTLS bool `toml:"enable_tls" deprecated:"1.37.0;1.40.0;use 'tls_enable' instead"` - TLSName string `toml:"tls_name" deprecated:"1.37.0;1.40.0;use 'tls_server_name' instead"` - common_tls.ClientConfig - - tlsConfig *tls.Config - - DisableQueryNamespaces bool `toml:"disable_query_namespaces"` - Namespaces []string `toml:"namespaces"` - - QuerySets bool `toml:"query_sets"` - Sets []string `toml:"sets"` - - EnableTTLHistogram bool `toml:"enable_ttl_histogram"` - EnableObjectSizeLinearHistogram bool `toml:"enable_object_size_linear_histogram"` - - NumberHistogramBuckets int `toml:"num_histogram_buckets"` -} - -// On the random chance a hex value is all digits -// these are fields that can contain hex and should always be strings -var protectedHexFields = map[string]bool{ - "node_name": true, - "cluster_key": true, - "paxos_principal": true, -} - -func (*Aerospike) SampleConfig() string { - return sampleConfig -} - -func (a *Aerospike) Init() error { - a.ClientConfig.Enable = &a.EnableTLS - a.ClientConfig.ServerName = a.TLSName - tlsConfig, err := a.ClientConfig.TLSConfig() - if err != nil { - return err - } - a.tlsConfig = tlsConfig - - if a.NumberHistogramBuckets == 0 { - a.NumberHistogramBuckets = 10 - } else if a.NumberHistogramBuckets > 100 { - a.NumberHistogramBuckets = 100 - } else if a.NumberHistogramBuckets < 1 { - a.NumberHistogramBuckets = 10 - } - - return nil -} - -func (a *Aerospike) Gather(acc telegraf.Accumulator) error { - if len(a.Servers) == 0 { - return a.gatherServer(acc, "127.0.0.1:3000") - } - - var wg sync.WaitGroup - wg.Add(len(a.Servers)) - for _, server := range a.Servers { - go func(serv string) { - defer wg.Done() - acc.AddError(a.gatherServer(acc, serv)) - }(server) - } - - wg.Wait() - return nil -} - -func (a *Aerospike) gatherServer(acc telegraf.Accumulator, hostPort string) error { - policy := as.NewClientPolicy() - policy.User = a.Username - policy.Password = a.Password - policy.TlsConfig = a.tlsConfig - asHosts, err := as.NewHosts(hostPort) - if err != nil { - return err - } - if a.tlsConfig != nil { - policy.ClusterName = a.tlsConfig.ServerName - } - c, err := as.NewClientWithPolicyAndHost(policy, asHosts...) - if err != nil { - return err - } - asInfoPolicy := as.NewInfoPolicy() - defer c.Close() - - nodes := c.GetNodes() - for _, n := range nodes { - nodeHost := n.GetHost().String() - stats, err := getNodeInfo(n, asInfoPolicy) - if err != nil { - return err - } - parseNodeInfo(acc, stats, nodeHost, n.GetName()) - - namespaces, err := a.getNamespaces(n, asInfoPolicy) - if err != nil { - return err - } - - if !a.DisableQueryNamespaces { - // Query Namespaces - for _, namespace := range namespaces { - stats, err = getNamespaceInfo(namespace, n, asInfoPolicy) - - if err != nil { - continue - } - parseNamespaceInfo(acc, stats, nodeHost, namespace, n.GetName()) - - if a.EnableTTLHistogram { - err = a.getTTLHistogram(acc, nodeHost, namespace, "", n, asInfoPolicy) - if err != nil { - continue - } - } - if a.EnableObjectSizeLinearHistogram { - err = a.getObjectSizeLinearHistogram(acc, nodeHost, namespace, "", n, asInfoPolicy) - if err != nil { - continue - } - } - } - } - - if a.QuerySets { - namespaceSets, err := a.getSets(n, asInfoPolicy) - if err == nil { - for _, namespaceSet := range namespaceSets { - namespace, set := splitNamespaceSet(namespaceSet) - stats, err := getSetInfo(namespaceSet, n, asInfoPolicy) - - if err != nil { - continue - } - parseSetInfo(acc, stats, nodeHost, namespaceSet, n.GetName()) - - if a.EnableTTLHistogram { - err = a.getTTLHistogram(acc, nodeHost, namespace, set, n, asInfoPolicy) - if err != nil { - continue - } - } - - if a.EnableObjectSizeLinearHistogram { - err = a.getObjectSizeLinearHistogram(acc, nodeHost, namespace, set, n, asInfoPolicy) - if err != nil { - continue - } - } - } - } - } - } - return nil -} - -func getNodeInfo(n *as.Node, infoPolicy *as.InfoPolicy) (map[string]string, error) { - stats, err := n.RequestInfo(infoPolicy, "statistics") - if err != nil { - return nil, err - } - - return stats, nil -} - -func parseNodeInfo(acc telegraf.Accumulator, stats map[string]string, hostPort, nodeName string) { - nTags := map[string]string{ - "aerospike_host": hostPort, - "node_name": nodeName, - } - nFields := make(map[string]interface{}) - stat := strings.Split(stats["statistics"], ";") - for _, pair := range stat { - parts := strings.Split(pair, "=") - if len(parts) < 2 { - continue - } - key := strings.ReplaceAll(parts[0], "-", "_") - nFields[key] = parseAerospikeValue(key, parts[1]) - } - acc.AddFields("aerospike_node", nFields, nTags, time.Now()) -} - -func (a *Aerospike) getNamespaces(n *as.Node, infoPolicy *as.InfoPolicy) ([]string, error) { - var namespaces []string - if len(a.Namespaces) == 0 { - info, err := n.RequestInfo(infoPolicy, "namespaces") - if err != nil { - return namespaces, err - } - namespaces = strings.Split(info["namespaces"], ";") - } else { - namespaces = a.Namespaces - } - - return namespaces, nil -} - -func getNamespaceInfo(namespace string, n *as.Node, infoPolicy *as.InfoPolicy) (map[string]string, error) { - stats, err := n.RequestInfo(infoPolicy, "namespace/"+namespace) - if err != nil { - return nil, err - } - - return stats, err -} - -func parseNamespaceInfo(acc telegraf.Accumulator, stats map[string]string, hostPort, namespace, nodeName string) { - nTags := map[string]string{ - "aerospike_host": hostPort, - "node_name": nodeName, - } - nTags["namespace"] = namespace - nFields := make(map[string]interface{}) - - stat := strings.Split(stats["namespace/"+namespace], ";") - for _, pair := range stat { - parts := strings.Split(pair, "=") - if len(parts) < 2 { - continue - } - key := strings.ReplaceAll(parts[0], "-", "_") - nFields[key] = parseAerospikeValue(key, parts[1]) - } - acc.AddFields("aerospike_namespace", nFields, nTags, time.Now()) -} - -func (a *Aerospike) getSets(n *as.Node, infoPolicy *as.InfoPolicy) ([]string, error) { - var namespaceSets []string - // Gather all sets - if len(a.Sets) == 0 { - stats, err := n.RequestInfo(infoPolicy, "sets") - if err != nil { - return namespaceSets, err - } - stat := strings.Split(stats["sets"], ";") - for _, setStats := range stat { - // setInfo is "ns=test:set=foo:objects=1:tombstones=0" - if len(setStats) > 0 { - pairs := strings.Split(setStats, ":") - var ns, set string - for _, pair := range pairs { - parts := strings.Split(pair, "=") - if len(parts) == 2 { - if parts[0] == "ns" { - ns = parts[1] - } - if parts[0] == "set" { - set = parts[1] - } - } - } - if len(ns) > 0 && len(set) > 0 { - namespaceSets = append(namespaceSets, fmt.Sprintf("%s/%s", ns, set)) - } - } - } - } else { // User has passed in sets - namespaceSets = a.Sets - } - - return namespaceSets, nil -} - -func getSetInfo(namespaceSet string, n *as.Node, infoPolicy *as.InfoPolicy) (map[string]string, error) { - stats, err := n.RequestInfo(infoPolicy, "sets/"+namespaceSet) - if err != nil { - return nil, err - } - return stats, nil -} - -func parseSetInfo(acc telegraf.Accumulator, stats map[string]string, hostPort, namespaceSet, nodeName string) { - stat := strings.Split( - strings.TrimSuffix( - stats["sets/"+namespaceSet], ";"), ":") - nTags := map[string]string{ - "aerospike_host": hostPort, - "node_name": nodeName, - "set": namespaceSet, - } - nFields := make(map[string]interface{}) - for _, part := range stat { - pieces := strings.Split(part, "=") - if len(pieces) < 2 { - continue - } - - key := strings.ReplaceAll(pieces[0], "-", "_") - nFields[key] = parseAerospikeValue(key, pieces[1]) - } - acc.AddFields("aerospike_set", nFields, nTags, time.Now()) -} - -func (a *Aerospike) getTTLHistogram(acc telegraf.Accumulator, hostPort, namespace, set string, n *as.Node, infoPolicy *as.InfoPolicy) error { - stats, err := getHistogram(namespace, set, "ttl", n, infoPolicy) - if err != nil { - return err - } - - nTags := createTags(hostPort, n.GetName(), namespace, set) - a.parseHistogram(acc, stats, nTags, "ttl") - - return nil -} - -func (a *Aerospike) getObjectSizeLinearHistogram(acc telegraf.Accumulator, hostPort, namespace, set string, n *as.Node, infoPolicy *as.InfoPolicy) error { - stats, err := getHistogram(namespace, set, "object-size-linear", n, infoPolicy) - if err != nil { - return err - } - - nTags := createTags(hostPort, n.GetName(), namespace, set) - a.parseHistogram(acc, stats, nTags, "object-size-linear") - - return nil -} - -func getHistogram(namespace, set, histogramType string, n *as.Node, infoPolicy *as.InfoPolicy) (map[string]string, error) { - var queryArg string - if len(set) > 0 { - queryArg = fmt.Sprintf("histogram:type=%s;namespace=%v;set=%v", histogramType, namespace, set) - } else { - queryArg = fmt.Sprintf("histogram:type=%s;namespace=%v", histogramType, namespace) - } - - stats, err := n.RequestInfo(infoPolicy, queryArg) - if err != nil { - return nil, err - } - return stats, nil -} - -func (a *Aerospike) parseHistogram(acc telegraf.Accumulator, stats, nTags map[string]string, histogramType string) { - nFields := make(map[string]interface{}) - - for _, stat := range stats { - for _, part := range strings.Split(stat, ":") { - pieces := strings.Split(part, "=") - if len(pieces) < 2 { - continue - } - - if pieces[0] == "buckets" { - buckets := strings.Split(pieces[1], ",") - - // Normalize in case of less buckets than expected - numRecordsPerBucket := 1 - if len(buckets) > a.NumberHistogramBuckets { - numRecordsPerBucket = int(math.Ceil(float64(len(buckets)) / float64(a.NumberHistogramBuckets))) - } - - bucketCount := 0 - bucketSum := int64(0) // cast to int64, as can have large object sums - bucketName := 0 - for i, bucket := range buckets { - // Sum records and increment bucket collection counter - if bucketCount < numRecordsPerBucket { - bucketSum = bucketSum + parseAerospikeValue("", bucket).(int64) - bucketCount++ - } - - // Store records and reset counters - // increment bucket name - if bucketCount == numRecordsPerBucket { - nFields[strconv.Itoa(bucketName)] = bucketSum - - bucketCount = 0 - bucketSum = 0 - bucketName++ - } else if i == (len(buckets) - 1) { - // base/edge case where final bucket does not fully - // fill number of records per bucket - nFields[strconv.Itoa(bucketName)] = bucketSum - } - } - } - } - } - - acc.AddFields(fmt.Sprintf("aerospike_histogram_%v", strings.ReplaceAll(histogramType, "-", "_")), nFields, nTags, time.Now()) -} - -func splitNamespaceSet(namespaceSet string) (namespace, set string) { - split := strings.Split(namespaceSet, "/") - return split[0], split[1] -} - -func parseAerospikeValue(key, v string) interface{} { - if protectedHexFields[key] { - return v - } else if parsed, err := strconv.ParseInt(v, 10, 64); err == nil { - return parsed - } else if parsed, err := strconv.ParseUint(v, 10, 64); err == nil { - return parsed - } else if parsed, err := strconv.ParseBool(v); err == nil { - return parsed - } else if parsed, err := strconv.ParseFloat(v, 32); err == nil { - return parsed - } - // leave as string - return v -} - -func createTags(hostPort, nodeName, namespace, set string) map[string]string { - nTags := map[string]string{ - "aerospike_host": hostPort, - "node_name": nodeName, - "namespace": namespace, - } - - if len(set) > 0 { - nTags["set"] = set - } - return nTags -} - -func init() { - inputs.Add("aerospike", func() telegraf.Input { - return &Aerospike{} - }) -} diff --git a/plugins/inputs/aerospike/aerospike_test.go b/plugins/inputs/aerospike/aerospike_test.go deleted file mode 100644 index b9a1b944233f0..0000000000000 --- a/plugins/inputs/aerospike/aerospike_test.go +++ /dev/null @@ -1,490 +0,0 @@ -package aerospike - -import ( - "fmt" - "strconv" - "testing" - - as "github.com/aerospike/aerospike-client-go/v5" - "github.com/stretchr/testify/require" - "github.com/testcontainers/testcontainers-go/wait" - - "github.com/influxdata/telegraf/testutil" -) - -const servicePort = "3000" - -func launchTestServer(t *testing.T) *testutil.Container { - t.Helper() - container := testutil.Container{ - Image: "aerospike:ce-8.1.0.1", - ExposedPorts: []string{servicePort}, - WaitingFor: wait.ForLog("migrations: complete"), - HostConfigModifier: testutil.RaiseNofileLimit, - } - require.NoError(t, container.Start(), "failed to start container") - - return &container -} - -func TestAerospikeStatisticsIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - a := &Aerospike{ - Servers: []string{fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort])}, - } - - var acc testutil.Accumulator - - err := acc.GatherError(a.Gather) - require.NoError(t, err) - - require.True(t, acc.HasMeasurement("aerospike_node")) - require.True(t, acc.HasTag("aerospike_node", "node_name")) - require.True(t, acc.HasMeasurement("aerospike_namespace")) - require.True(t, acc.HasTag("aerospike_namespace", "node_name")) - require.True(t, acc.HasInt64Field("aerospike_node", "batch_index_error")) - - namespaceName := acc.TagValue("aerospike_namespace", "namespace") - require.Equal(t, "test", namespaceName) -} - -func TestAerospikeStatisticsPartialErrIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - a := &Aerospike{ - Servers: []string{ - fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort]), - testutil.GetLocalHost() + ":9999", - }, - } - - var acc testutil.Accumulator - err := acc.GatherError(a.Gather) - - require.Error(t, err) - - require.True(t, acc.HasMeasurement("aerospike_node")) - require.True(t, acc.HasMeasurement("aerospike_namespace")) - require.True(t, acc.HasInt64Field("aerospike_node", "batch_index_error")) - namespaceName := acc.TagSetValue("aerospike_namespace", "namespace") - require.Equal(t, "test", namespaceName) -} - -func TestSelectNamespacesIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - // Select nonexistent namespace - a := &Aerospike{ - Servers: []string{fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort])}, - Namespaces: []string{"notTest"}, - } - - var acc testutil.Accumulator - - err := acc.GatherError(a.Gather) - require.NoError(t, err) - - require.True(t, acc.HasMeasurement("aerospike_node")) - require.True(t, acc.HasTag("aerospike_node", "node_name")) - require.True(t, acc.HasMeasurement("aerospike_namespace")) - require.True(t, acc.HasTag("aerospike_namespace", "node_name")) - - // Expect only 1 namespace - count := 0 - for _, p := range acc.Metrics { - if p.Measurement == "aerospike_namespace" { - count++ - } - } - require.Equal(t, 1, count) - - // expect namespace to have no fields as nonexistent - require.False(t, acc.HasInt64Field("aerospike_namespace", "appeals_tx_remaining")) -} - -func TestDisableQueryNamespacesIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - a := &Aerospike{ - Servers: []string{ - fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort]), - }, - DisableQueryNamespaces: true, - } - - var acc testutil.Accumulator - err := acc.GatherError(a.Gather) - require.NoError(t, err) - - require.True(t, acc.HasMeasurement("aerospike_node")) - require.False(t, acc.HasMeasurement("aerospike_namespace")) - - a.DisableQueryNamespaces = false - err = acc.GatherError(a.Gather) - require.NoError(t, err) - - require.True(t, acc.HasMeasurement("aerospike_node")) - require.True(t, acc.HasMeasurement("aerospike_namespace")) -} - -func TestQuerySetsIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - portInt, err := strconv.Atoi(container.Ports[servicePort]) - require.NoError(t, err) - - // create a set - // test is the default namespace from aerospike - policy := as.NewClientPolicy() - client, errAs := as.NewClientWithPolicy(policy, container.Address, portInt) - require.NoError(t, errAs) - - key, errAs := as.NewKey("test", "foo", 123) - require.NoError(t, errAs) - bins := as.BinMap{ - "e": 2, - "pi": 3, - } - errAs = client.Add(nil, key, bins) - require.NoError(t, errAs) - - key, errAs = as.NewKey("test", "bar", 1234) - require.NoError(t, errAs) - bins = as.BinMap{ - "e": 2, - "pi": 3, - } - errAs = client.Add(nil, key, bins) - require.NoError(t, errAs) - - a := &Aerospike{ - Servers: []string{ - fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort]), - }, - QuerySets: true, - DisableQueryNamespaces: true, - } - - var acc testutil.Accumulator - err = acc.GatherError(a.Gather) - require.NoError(t, err) - - require.True(t, FindTagValue(&acc, "aerospike_set", "set", "test/foo")) - require.True(t, FindTagValue(&acc, "aerospike_set", "set", "test/bar")) - - require.True(t, acc.HasMeasurement("aerospike_set")) - require.True(t, acc.HasTag("aerospike_set", "set")) - require.True(t, acc.HasInt64Field("aerospike_set", "data_used_bytes")) -} - -func TestSelectQuerySetsIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - portInt, err := strconv.Atoi(container.Ports[servicePort]) - require.NoError(t, err) - - // create a set - // test is the default namespace from aerospike - policy := as.NewClientPolicy() - client, errAs := as.NewClientWithPolicy(policy, container.Address, portInt) - require.NoError(t, errAs) - - key, errAs := as.NewKey("test", "foo", 123) - require.NoError(t, errAs) - bins := as.BinMap{ - "e": 2, - "pi": 3, - } - errAs = client.Add(nil, key, bins) - require.NoError(t, errAs) - - key, errAs = as.NewKey("test", "bar", 1234) - require.NoError(t, errAs) - bins = as.BinMap{ - "e": 2, - "pi": 3, - } - errAs = client.Add(nil, key, bins) - require.NoError(t, errAs) - - a := &Aerospike{ - Servers: []string{ - fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort]), - }, - QuerySets: true, - Sets: []string{"test/foo"}, - DisableQueryNamespaces: true, - } - - var acc testutil.Accumulator - err = acc.GatherError(a.Gather) - require.NoError(t, err) - - require.True(t, FindTagValue(&acc, "aerospike_set", "set", "test/foo")) - require.False(t, FindTagValue(&acc, "aerospike_set", "set", "test/bar")) - - require.True(t, acc.HasMeasurement("aerospike_set")) - require.True(t, acc.HasTag("aerospike_set", "set")) - require.True(t, acc.HasInt64Field("aerospike_set", "data_used_bytes")) -} - -func TestDisableTTLHistogramIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - a := &Aerospike{ - Servers: []string{ - fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort]), - }, - QuerySets: true, - EnableTTLHistogram: false, - } - /* - No measurement exists - */ - var acc testutil.Accumulator - err := acc.GatherError(a.Gather) - require.NoError(t, err) - - require.False(t, acc.HasMeasurement("aerospike_histogram_ttl")) -} - -func TestDisableObjectSizeLinearHistogramIntegration(t *testing.T) { - if testing.Short() { - t.Skip("Skipping aerospike integration tests.") - } - - container := launchTestServer(t) - defer container.Terminate() - - a := &Aerospike{ - Servers: []string{ - fmt.Sprintf("%s:%s", container.Address, container.Ports[servicePort]), - }, - QuerySets: true, - EnableObjectSizeLinearHistogram: false, - } - /* - No Measurement - */ - var acc testutil.Accumulator - err := acc.GatherError(a.Gather) - require.NoError(t, err) - - require.False(t, acc.HasMeasurement("aerospike_histogram_object_size_linear")) -} - -func TestInit(t *testing.T) { - a := &Aerospike{} - - require.NoError(t, a.Init()) - - require.Equal(t, 10, a.NumberHistogramBuckets) - require.Nil(t, a.tlsConfig) -} - -func TestParseNodeInfo(t *testing.T) { - stats := map[string]string{ - "statistics": "early_tsvc_from_proxy_error=0;cluster_principal=BB9020012AC4202;cluster_is_member=true", - } - - expectedFields := map[string]interface{}{ - "early_tsvc_from_proxy_error": int64(0), - "cluster_principal": "BB9020012AC4202", - "cluster_is_member": true, - } - - expectedTags := map[string]string{ - "aerospike_host": "127.0.0.1:3000", - "node_name": "TestNodeName", - } - - var acc testutil.Accumulator - parseNodeInfo(&acc, stats, "127.0.0.1:3000", "TestNodeName") - acc.AssertContainsTaggedFields(t, "aerospike_node", expectedFields, expectedTags) -} - -func TestParseNamespaceInfo(t *testing.T) { - stats := map[string]string{ - "namespace/test": "ns_cluster_size=1;effective_replication_factor=1;objects=2;tombstones=0;master_objects=2", - } - - expectedFields := map[string]interface{}{ - "ns_cluster_size": int64(1), - "effective_replication_factor": int64(1), - "tombstones": int64(0), - "objects": int64(2), - "master_objects": int64(2), - } - - expectedTags := map[string]string{ - "aerospike_host": "127.0.0.1:3000", - "node_name": "TestNodeName", - "namespace": "test", - } - - var acc testutil.Accumulator - parseNamespaceInfo(&acc, stats, "127.0.0.1:3000", "test", "TestNodeName") - acc.AssertContainsTaggedFields(t, "aerospike_namespace", expectedFields, expectedTags) -} - -func TestParseSetInfo(t *testing.T) { - stats := map[string]string{ - "sets/test/foo": "objects=1:tombstones=0:memory_data_bytes=26;", - } - - expectedFields := map[string]interface{}{ - "objects": int64(1), - "tombstones": int64(0), - "memory_data_bytes": int64(26), - } - - expectedTags := map[string]string{ - "aerospike_host": "127.0.0.1:3000", - "node_name": "TestNodeName", - "set": "test/foo", - } - - var acc testutil.Accumulator - parseSetInfo(&acc, stats, "127.0.0.1:3000", "test/foo", "TestNodeName") - acc.AssertContainsTaggedFields(t, "aerospike_set", expectedFields, expectedTags) -} - -func TestParseHistogramSet(t *testing.T) { - a := &Aerospike{ - NumberHistogramBuckets: 10, - } - - var acc testutil.Accumulator - - stats := map[string]string{ - "histogram:type=object-size-linear;namespace=test;set=foo": "units=bytes:hist-width=1048576:bucket-width=1024:buckets=0,1,3,1,6,1,9,1,12,1,15,1,18", - } - - expectedFields := map[string]interface{}{ - "0": int64(1), - "1": int64(4), - "2": int64(7), - "3": int64(10), - "4": int64(13), - "5": int64(16), - "6": int64(18), - } - - expectedTags := map[string]string{ - "aerospike_host": "127.0.0.1:3000", - "node_name": "TestNodeName", - "namespace": "test", - "set": "foo", - } - - nTags := createTags("127.0.0.1:3000", "TestNodeName", "test", "foo") - a.parseHistogram(&acc, stats, nTags, "object-size-linear") - acc.AssertContainsTaggedFields(t, "aerospike_histogram_object_size_linear", expectedFields, expectedTags) -} - -func TestParseHistogramNamespace(t *testing.T) { - a := &Aerospike{ - NumberHistogramBuckets: 10, - } - - var acc testutil.Accumulator - - stats := map[string]string{ - "histogram:type=object-size-linear;namespace=test;set=foo": " units=bytes:hist-width=1048576:bucket-width=1024:buckets=0,1,3,1,6,1,9,1,12,1,15,1,18", - } - - expectedFields := map[string]interface{}{ - "0": int64(1), - "1": int64(4), - "2": int64(7), - "3": int64(10), - "4": int64(13), - "5": int64(16), - "6": int64(18), - } - - expectedTags := map[string]string{ - "aerospike_host": "127.0.0.1:3000", - "node_name": "TestNodeName", - "namespace": "test", - } - - nTags := createTags("127.0.0.1:3000", "TestNodeName", "test", "") - a.parseHistogram(&acc, stats, nTags, "object-size-linear") - acc.AssertContainsTaggedFields(t, "aerospike_histogram_object_size_linear", expectedFields, expectedTags) -} - -func TestAerospikeParseValue(t *testing.T) { - // uint64 with value bigger than int64 max - val := parseAerospikeValue("", "18446744041841121751") - require.Equal(t, uint64(18446744041841121751), val) - - val = parseAerospikeValue("", "true") - v, ok := val.(bool) - require.Truef(t, ok, "bool type expected, got '%T' with '%v' value instead", val, val) - require.True(t, v) - - // int values - val = parseAerospikeValue("", "42") - require.Equal(t, int64(42), val, "must be parsed as an int64") - - // string values - val = parseAerospikeValue("", "BB977942A2CA502") - require.Equal(t, `BB977942A2CA502`, val, "must be left as a string") - - // all digit hex values, unprotected - val = parseAerospikeValue("", "1992929191") - require.Equal(t, int64(1992929191), val, "must be parsed as an int64") - - // all digit hex values, protected - val = parseAerospikeValue("node_name", "1992929191") - require.Equal(t, `1992929191`, val, "must be left as a string") -} - -func FindTagValue(acc *testutil.Accumulator, measurement, key, value string) bool { - for _, p := range acc.Metrics { - if p.Measurement == measurement { - v, ok := p.Tags[key] - if ok && v == value { - return true - } - } - } - return false -} diff --git a/plugins/inputs/aerospike/sample.conf b/plugins/inputs/aerospike/sample.conf deleted file mode 100644 index 80d388ee5d9e1..0000000000000 --- a/plugins/inputs/aerospike/sample.conf +++ /dev/null @@ -1,58 +0,0 @@ -# Read stats from aerospike server(s) -[[inputs.aerospike]] - ## Aerospike servers to connect to (with port) - ## This plugin will query all namespaces the aerospike - ## server has configured and get stats for them. - servers = ["localhost:3000"] - - # username = "telegraf" - # password = "pa$$word" - - ## Optional TLS Config - ## Set to true/false to enforce TLS being enabled/disabled. If not set, - ## enable TLS only if any of the other options are specified. - # tls_enable = - ## Trusted root certificates for server - # tls_ca = "/path/to/cafile" - ## Used for TLS client certificate authentication - # tls_cert = "/path/to/certfile" - ## Used for TLS client certificate authentication - # tls_key = "/path/to/keyfile" - ## Password for the key file if it is encrypted - # tls_key_pwd = "" - ## Send the specified TLS server name via SNI - # tls_server_name = "kubernetes.example.com" - ## Minimal TLS version to accept by the client - # tls_min_version = "TLS12" - ## List of ciphers to accept, by default all secure ciphers will be accepted - ## See https://pkg.go.dev/crypto/tls#pkg-constants for supported values. - ## Use "all", "secure" and "insecure" to add all support ciphers, secure - ## suites or insecure suites respectively. - # tls_cipher_suites = ["secure"] - ## Renegotiation method, "never", "once" or "freely" - # tls_renegotiation_method = "never" - ## Use TLS but skip chain & host verification - # insecure_skip_verify = false - - # Feature Options - # Add namespace variable to limit the namespaces executed on - # Leave blank to do all - # disable_query_namespaces = true # default false - # namespaces = ["namespace1", "namespace2"] - - # Enable set level telemetry - # query_sets = true # default: false - # Add namespace set combinations to limit sets executed on - # Leave blank to do all sets - # sets = ["namespace1/set1", "namespace1/set2", "namespace3"] - - # Histograms - # enable_ttl_histogram = true # default: false - # enable_object_size_linear_histogram = true # default: false - - # by default, aerospike produces a 100 bucket histogram - # this is not great for most graphing tools, this will allow - # the ability to squash this to a smaller number of buckets - # To have a balanced histogram, the number of buckets chosen - # should divide evenly into 100. - # num_histogram_buckets = 100 # default: 10 diff --git a/plugins/inputs/aerospike/sample.conf.in b/plugins/inputs/aerospike/sample.conf.in deleted file mode 100644 index 11409c36fcf00..0000000000000 --- a/plugins/inputs/aerospike/sample.conf.in +++ /dev/null @@ -1,35 +0,0 @@ -# Read stats from aerospike server(s) -[[inputs.aerospike]] - ## Aerospike servers to connect to (with port) - ## This plugin will query all namespaces the aerospike - ## server has configured and get stats for them. - servers = ["localhost:3000"] - - # username = "telegraf" - # password = "pa$$word" - - ## Optional TLS Config -{{template "/plugins/common/tls/client.conf"}} - - # Feature Options - # Add namespace variable to limit the namespaces executed on - # Leave blank to do all - # disable_query_namespaces = true # default false - # namespaces = ["namespace1", "namespace2"] - - # Enable set level telemetry - # query_sets = true # default: false - # Add namespace set combinations to limit sets executed on - # Leave blank to do all sets - # sets = ["namespace1/set1", "namespace1/set2", "namespace3"] - - # Histograms - # enable_ttl_histogram = true # default: false - # enable_object_size_linear_histogram = true # default: false - - # by default, aerospike produces a 100 bucket histogram - # this is not great for most graphing tools, this will allow - # the ability to squash this to a smaller number of buckets - # To have a balanced histogram, the number of buckets chosen - # should divide evenly into 100. - # num_histogram_buckets = 100 # default: 10 diff --git a/plugins/inputs/all/aerospike.go b/plugins/inputs/all/aerospike.go deleted file mode 100644 index 239f3979b2339..0000000000000 --- a/plugins/inputs/all/aerospike.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build !custom || inputs || inputs.aerospike - -package all - -import _ "github.com/influxdata/telegraf/plugins/inputs/aerospike" // register plugin