exporter_type: sidecar
app_name_short: Solr
app_name: Apache {{app_name_short}}
app_site_name: {{app_name}}
app_site_url: https://solr.apache.org/
exporter_name: the JMX exporter
exporter_pkg_name: jmx-exporter
exporter_repo_url: https://github.com/bitnami/containers/tree/main/bitnami/jmx-exporter
dashboard_available: true
minimum_exporter_version: "0.17.0"
multiple_dashboards: false
dashboard_display_name: {{app_name_short}} Prometheus Overview
config_mods: |
  apiVersion: v1
  kind: ConfigMap
  metadata:
    name: solr-exporter
  data:
    config.yml: |
      hostPort: 127.0.0.1:9999
  ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: solr
  spec:
    selector:
      matchLabels:
  +     app.kubernetes.io/name: solr
    template:
      metadata:
        labels:
  +       app.kubernetes.io/name: solr
      spec:
        containers:
        - name: solr
          image: solr:8.8.2
  +       ports:
  +       - containerPort: 9999
  +         name: jmx
  +       env:
  +       - name: ENABLE_REMOTE_JMX_OPTS
  +         value: "true"
  +       - name: RMI_PORT
  +         value: "9999"
  +     - name: exporter
  +       image: bitnami/jmx-exporter:0.17.0
  +       ports:
  +       - containerPort: 9000
  +         name: prometheus
  +       command:
  +         - java
  +         - -jar
  +         - jmx_prometheus_httpserver.jar
  +       args:
  +         - "9000"
  +         - /opt/jmx_exporter/config.yml
  +       volumeMounts:
  +       - mountPath: /opt/jmx_exporter/config.yml
  +         subPath: config.yml
  +         name: solr-exporter
  +     volumes:
  +     - name: solr-exporter
  +       configMap:
  +         name: solr-exporter
  +         items:
  +         - key: config.yml
  +           path: config.yml
podmonitoring_config: |
  apiVersion: monitoring.googleapis.com/v1
  kind: PodMonitoring
  metadata:
    name: solr
    labels:
      app.kubernetes.io/name: solr
      app.kubernetes.io/part-of: google-cloud-managed-prometheus
  spec:
    endpoints:
    - port: prometheus
      scheme: http
      interval: 30s
      path: /metrics
    selector:
      matchLabels:
        app.kubernetes.io/name: solr
additional_prereq_info: |
  Solr supports JMX and can be [configured](https://solr.apache.org/guide/6_6/using-jmx-with-solr.html#UsingJMXwithSolr-ConfiguringaRemoteConnectiontoSolrJMX){:class="external"}
  by setting the environment variables `ENABLE_REMOTE_JMX_OPTS` to `true`
  and `RMI_PORT` to the desired port for remote JMX connections.
sample_promql_query: up{job="solr", cluster="{{cluster_name}}", namespace="{{namespace_name}}"}
alerts_config: |
  apiVersion: monitoring.googleapis.com/v1
  kind: Rules
  metadata:
    name: solr-rules
    labels:
      app.kubernetes.io/component: rules
      app.kubernetes.io/name: solr-rules
      app.kubernetes.io/part-of: google-cloud-managed-prometheus
  spec:
    groups:
    - name: solr
      interval: 30s
      rules:
      - alert: SolrHighCacheEvictions
        annotations:
          description: |-
            Solr high cache evictions
              VALUE = {{ $value }}
              LABELS: {{ $labels }}
          summary: Solr high cache evictions (instance {{ $labels.instance }})
        expr: solr_core_evictions > 0
        for: 5m
        labels:
          severity: warning
      - alert: SolrHighRequestCount
        annotations:
          description: |-
            Solr high request count
              VALUE = {{ $value }}
              LABELS: {{ $labels }}
          summary: Solr high request count (instance {{ $labels.instance }})
        expr: solr_core_Count{name="requests"} > 10
        for: 5m
        labels:
          severity: warning
      - alert: SolrHighRequestErrors
        annotations:
          description: |-
            Solr high request errors
              VALUE = {{ $value }}
              LABELS: {{ $labels }}
          summary: Solr high request errors (instance {{ $labels.instance }})
        expr: solr_core_Count{name="errors"} > 0
        for: 5m
        labels:
          severity: warning
additional_alert_info: You can adjust the alert thresholds to suit your application.
