github.com/mackerelio/mackerel-agent-plugins@v0.89.3/mackerel-plugin-solr/README.md (about) 1 mackerel-plugin-solr 2 ===================== 3 4 Solr custom metrics plugin for mackerel.io agent. 5 6 ## Synopsis 7 8 ```shell 9 mackerel-plugin-solr [-host=<hostname>] [-port=<port>] 10 ``` 11 12 ## Example of mackerel-agent.conf 13 14 ``` 15 [plugin.metrics.solr] 16 command = "/path/to/mackerel-plugin-solr" 17 ``` 18 19 You can explicitly specify a host IP address and a port number. 20 21 ``` 22 [plugin.metrics.solr] 23 command = "/path/to/mackerel-plugin-solr -host=192.168.33.10 -port=8984" 24 ``` 25 26 ## Supported Versions 27 28 * `5.*.*` 29 * `6.*.*` 30 * `7.*.*` 31 * `8.*.*` 32 33 ## Requirement APIs 34 35 * `http://{host}:{port}/solr/admin/info/system` 36 * `http://{host}:{port}/solr/admin/cores` 37 * `http://{host}:{port}/solr/{core name}/admin/mbeans` 38 39 ## Unit tests 40 41 ``` 42 $ cd mackerel-plugin-solr/lib/ 43 $ go test 44 ``` 45 46 Prepare fixture files to `mackerel-plugin-solr/lib/stats/x.x.x/*` if you'd like to support new version. 47 48 ``` 49 $ docker pull solr:x.x 50 $ docker run --name solr_x -d -p 8983:8983 -t solr:x.x 51 $ docker exec -it --user=solr solr_x bin/solr create_core -c testcore 52 $ cd mackerel-plugin-solr/lib/ 53 ``` 54 55 ``` 56 $ curl -s -S 'http://localhost:8983/solr/admin/info/system?wt=json' | jq . > stats/x.x.x/system.json 57 ``` 58 59 ``` 60 $ curl -s -S 'http://localhost:8983/solr/admin/cores?wt=json' | jq . > stats/x.x.x/cores.json 61 ``` 62 63 ``` 64 ### Solr5 or Solr6 65 $ curl -s -S 'http://localhost:8983/solr/testcore/admin/mbeans?wt=json&stats=true&cat=QUERYHANDLER&key=/update/json&key=/select&key=/update/json/docs&key=/get&key=/update/csv&key=/replication&key=/update&key=/dataimport' | jq . > stats/x.x.x/query.json 66 $ curl -s -S 'http://localhost:8983/solr/testcore/admin/mbeans?wt=json&stats=true&cat=UPDATEHANDLER&key=/update/json&key=/select&key=/update/json/docs&key=/get&key=/update/csv&key=/replication&key=/update&key=/dataimport' | jq . > stats/x.x.x/update.json 67 68 ### Solr7 or Solr8 69 $ curl -s -S 'http://localhost:8983/solr/testcore/admin/mbeans?wt=json&stats=true&cat=QUERY&key=/update/json&key=/select&key=/update/json/docs&key=/get&key=/update/csv&key=/replication&key=/update&key=/dataimport' | jq . > stats/x.x.x/query.json 70 $ curl -s -S 'http://localhost:8983/solr/testcore/admin/mbeans?wt=json&stats=true&cat=UPDATE&key=/update/json&key=/select&key=/update/json/docs&key=/get&key=/update/csv&key=/replication&key=/update&key=/dataimport' | jq . > stats/x.x.x/update.json 71 ``` 72 73 ``` 74 $ curl -s -S 'http://localhost:8983/solr/testcore/admin/mbeans?wt=json&stats=true&cat=REPLICATION&key=/update/json&key=/select&key=/update/json/docs&key=/get&key=/update/csv&key=/replication&key=/update&key=/dataimport' | jq . > stats/x.x.x/replication.json 75 $ curl -s -S 'http://localhost:8983/solr/testcore/admin/mbeans?wt=json&stats=true&cat=CACHE&key=filterCache&key=perSegFilter&key=queryResultCache&key=documentCache&key=fieldValueCache' | jq . > stats/x.x.x/cache.json 76 ``` 77 78 ## Documents 79 80 * [Apache Solr official website](http://lucene.apache.org/solr/) 81 * [MBean Request Handler](https://lucene.apache.org/solr/guide/8_1/mbean-request-handler.html) 82 * [Performance Statistics Reference](https://lucene.apache.org/solr/guide/8_1/performance-statistics-reference.html) 83 * [Docker Official Repository Solr](https://hub.docker.com/_/solr/) 84 85 ## Other softwares 86 87 * [Prometheus Exporter](https://github.com/apache/lucene-solr/tree/master/solr/contrib/prometheus-exporter) 88 * [DataDog Integration](https://github.com/DataDog/integrations-core/tree/master/solr) 89 * [Munin Plugin](https://github.com/munin-monitoring/contrib/tree/master/plugins/solr)