|
| 1 | +# Apache Solr Mixin |
| 2 | + |
| 3 | +The Apache Solr mixin is a set of configurable Grafana dashboards and alerts. |
| 4 | + |
| 5 | +The Apache Solr mixin contains the following dashboards: |
| 6 | + |
| 7 | +- Apache Solr cluster overview |
| 8 | +- Apache Solr query performance |
| 9 | +- Apache Solr resource monitoring |
| 10 | +- Apache Solr logs overview |
| 11 | + |
| 12 | +and the following alerts: |
| 13 | + |
| 14 | +- ApacheSolrZookeeperChangeInEnsembleSize |
| 15 | +- ApacheSolrHighCPUUsageCritical |
| 16 | +- ApacheSolrHighCPUUsageWarning |
| 17 | +- ApacheSolrHighHeapMemoryUsageCritical |
| 18 | +- ApacheSolrHighHeapMemoryUsageWarning |
| 19 | +- ApacheSolrLowCacheHitRatio |
| 20 | +- ApacheSolrHighCoreErrors |
| 21 | +- ApacheSolrHighDocumentIndexing |
| 22 | + |
| 23 | +## Apache Solr Cluster Overview |
| 24 | + |
| 25 | +The Apache Solr cluster overview dashboard provides details on cluster, shard, replica and Zookeeper health as well as top core and error metrics. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +## Apache Solr Query Performance |
| 31 | + |
| 32 | +The Apache Solr query performance dashboard provides details on various query load and latency, update handlers, cache, timeout and error metrics. |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## Apache Solr Resource Monitoring |
| 39 | + |
| 40 | +The Apache Solr resource monitoring dashboard provides details on connections, threads, core FS usage, as well as JVM and Jetty metrics. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +## Apache Solr Logs Overview |
| 46 | + |
| 47 | +The Apache Solr logs overview dashboard provides details on slow requests, garbage collection, and error logs. [Promtail and Loki needs to be installed](https://grafana.com/docs/loki/latest/installation/) and provisioned for logs with your Grafana instance. The default Apache Solr error log path is `/var/solr/logs/solr.log` for each instance on Linux. |
| 48 | + |
| 49 | +Apache Solr logs are enabled by default in the `config.libsonnet` and can be removed by setting `enableLokiLogs` to `false`. Then run `make` again to regenerate the dashboard: |
| 50 | + |
| 51 | +``` |
| 52 | +{ |
| 53 | + _config+:: { |
| 54 | + enableLokiLogs: false, |
| 55 | + }, |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +In order for the selectors to properly work for system logs ingested into your logs datasource, please also include the matching `job` and `solr_cluster` labels onto the [scrape_configs](https://grafana.com/docs/loki/latest/clients/promtail/configuration/#scrape_configs) as to match the labels for ingested metrics. |
| 60 | + |
| 61 | +```yaml |
| 62 | +scrape_configs: |
| 63 | + - job_name: integrations/apache-solr |
| 64 | + static_configs: |
| 65 | + - targets: [localhost] |
| 66 | + labels: |
| 67 | + job: integrations/apache-solr |
| 68 | + instance: '<your-instance-name>' |
| 69 | + solr_cluster: '<your-cluster-name>' |
| 70 | + __path__: /var/log/logs/*.log |
| 71 | + pipeline_stages: |
| 72 | + - multiline: |
| 73 | + firstline: '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}' |
| 74 | + - regex: |
| 75 | + expression: '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} (?P<level>\w+)' |
| 76 | + - labels: |
| 77 | + level: |
| 78 | +``` |
| 79 | +
|
| 80 | + |
| 81 | +
|
| 82 | +## Alerts Overview |
| 83 | +
|
| 84 | +
|
| 85 | +| Alert | Summary | |
| 86 | +|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------| |
| 87 | +| ApacheSolrZookeeperChangeInEnsembleSize | Changes in the ZooKeeper ensemble size can affect the stability and performance of the cluster. | |
| 88 | +| ApacheSolrHighCPUUsageCritical | High CPU load can indicate that Solr nodes are under heavy load, potentially impacting performance. | |
| 89 | +| ApacheSolrHighCPUUsageWarning | High CPU load can indicate that Solr nodes are under heavy load, potentially impacting performance. | |
| 90 | +| ApacheSolrHighHeapMemoryUsageCritical | High heap memory usage can lead to garbage collection issues, out-of-memory errors, and overall system instability. | |
| 91 | +| ApacheSolrHighHeapMemoryUsageWarning | High heap memory usage can lead to garbage collection issues, out-of-memory errors, and overall system instability. | |
| 92 | +| ApacheSolrLowCacheHitRatio | Low cache hit ratios can lead to increased disk I/O and slower query response times. | |
| 93 | +| ApacheSolrHighCoreErrors | A spike in core errors can indicate serious issues at the core level, affecting data integrity and availability. | |
| 94 | +| ApacheSolrHighDocumentIndexing | A sudden spike in document indexing could indicate unintended or malicious bulk updates. | |
| 95 | +
|
| 96 | +Default thresholds can be configured in `config.libsonnet` |
| 97 | + |
| 98 | +```js |
| 99 | +{ |
| 100 | + _config+:: { |
| 101 | + alertsCriticalCPUUsage: 85, |
| 102 | + alertsWarningCPUUsage: 75, |
| 103 | + alertsWarningMemoryUsage: 85, |
| 104 | + alertsCriticalMemoryUsage: 75, |
| 105 | + alertsWarningCacheUsage: 75, |
| 106 | + alertsWarningCoreErrors: 15, |
| 107 | + alertsWarningDocumentIndexing: 30, |
| 108 | + }, |
| 109 | +} |
| 110 | +``` |
| 111 | + |
| 112 | +## Install Tools |
| 113 | + |
| 114 | +```bash |
| 115 | +go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest |
| 116 | +go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest |
| 117 | +# or in brew: brew install go-jsonnet |
| 118 | +``` |
| 119 | + |
| 120 | +For linting and formatting, you would also need `mixtool` and `jsonnetfmt` installed. If you |
| 121 | +have a working Go development environment, it's easiest to run the following: |
| 122 | + |
| 123 | +```bash |
| 124 | +go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest |
| 125 | +``` |
| 126 | + |
| 127 | +The files in `dashboards_out` need to be imported |
| 128 | +into your Grafana server. The exact details will be depending on your environment. |
| 129 | + |
| 130 | +`prometheus_alerts.yaml` needs to be imported into Prometheus. |
| 131 | + |
| 132 | +## Generate Dashboards And Alerts |
| 133 | + |
| 134 | +Edit `config.libsonnet` if required and then build JSON dashboard files for Grafana: |
| 135 | + |
| 136 | +```bash |
| 137 | +make |
| 138 | +``` |
| 139 | + |
| 140 | +For more advanced uses of mixins, see |
| 141 | +https://github.com/monitoring-mixins/docs. |
0 commit comments