Repository navigation
Conversation
Establish the build and test plumbing for Solr's Grafana dashboard and Prometheus alert rules, under solr/monitoring. Both artifacts are generated from jsonnet in the style of the monitoring-mixins community, with a Makefile and a Docker wrapper so contributors need no local toolchain. A target checks for its tools before touching anything and writes through a temp file, so a missing tool cannot truncate a committed artifact. Nothing in the Gradle build regenerates or verifies the output; it is committed alongside the source that produced it. dev/ holds a docker-compose stack - Solr, Prometheus, Grafana, Alertmanager and a traffic generator - for seeing a change rendered against live metrics. It is contributor tooling, excluded from the source release, with image versions pinned and overridable. The dashboard and alert rules shipped here are placeholders: two panels and one rule, carrying an example identity so they are not mistaken for the real thing. They exist to prove the pipeline, and every key in config.libsonnet is wired into them. The dashboard follows in SOLR-18534, the alert rules in SOLR-18535, and OTLP push support in SOLR-18536; the reference guide page is laid out with those sections stubbed.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Configuration overrides, heap aggregation, alert delivery, and default network exposure contain unresolved functional and security issues.
8 open findings
Bind Solr and ZooKeeper ports to localhost · New Configure Alertmanager target in Local-Solr mode · New Configure Prometheus Alertmanager target · New Sum heap pools when calculating JVM memory usage · New Run container with invoking user's UID and GID · New Thread external configuration into generated outputs · New Reference SOLR-18534 and SOLR-18535 follow-up issues · New Fix missing opening parenthesis in Apache License header · New
What changed in this PR
Establishes Solr’s monitoring-mixin build pipeline, generated placeholder artifacts, local observability stack, and reference documentation.
Changes:
- Adds Jsonnet generation tooling for Grafana dashboards and Prometheus alerts.
- Adds a Docker Compose development stack and traffic generator.
- Documents monitoring setup and packages generated artifacts.
| File | Description |
|---|---|
.gitattributes |
Configures release exclusions and line endings. |
changelog/unreleased/SOLR-18533-monitoring-dev-tooling.yml |
Adds the changelog entry. |
solr/solr-ref-guide/modules/deployment-guide/deployment-nav.adoc |
Adds monitoring navigation. |
solr/solr-ref-guide/modules/deployment-guide/pages/metrics-reporting.adoc |
Links the new guide. |
solr/solr-ref-guide/modules/deployment-guide/pages/monitoring-with-prometheus-and-grafana.adoc |
Documents the monitoring integration. |
solr/solr-ref-guide/modules/deployment-guide/images/monitoring-with-prometheus-and-grafana/solr-monitoring-diagram.svg |
Provides the architecture source diagram. |
solr/solr-ref-guide/modules/deployment-guide/images/monitoring-with-prometheus-and-grafana/solr-monitoring-diagram.png |
Provides the rendered architecture diagram. |
solr/solr-ref-guide/modules/deployment-guide/images/monitoring-with-prometheus-and-grafana/grafana-solr-dashboard.png |
Shows the placeholder dashboard. |
solr/monitoring/README.md |
Documents artifact usage and development. |
solr/monitoring/grafana-solr-dashboard.json |
Adds the generated placeholder dashboard. |
solr/monitoring/prometheus-solr-alerts.yml |
Adds the generated placeholder alert. |
solr/monitoring/mixin/.gitignore |
Excludes generated dependencies. |
solr/monitoring/mixin/Dockerfile |
Builds the mixin toolchain image. |
solr/monitoring/mixin/Makefile |
Defines generation and validation targets. |
solr/monitoring/mixin/make.sh |
Wraps builds in Docker. |
solr/monitoring/mixin/license-header.yml |
Supplies the generated YAML header. |
solr/monitoring/mixin/jsonnetfile.json |
Declares Grafonnet dependencies. |
solr/monitoring/mixin/jsonnetfile.lock.json |
Locks Jsonnet dependencies. |
solr/monitoring/mixin/config.libsonnet |
Defines mixin configuration. |
solr/monitoring/mixin/mixin.libsonnet |
Exposes generated artifacts. |
solr/monitoring/mixin/dashboards/dashboards.libsonnet |
Defines the placeholder dashboard. |
solr/monitoring/mixin/alerts/alerts.libsonnet |
Defines the placeholder alert. |
solr/monitoring/dev/docker-compose.yml |
Defines the development stack. |
solr/monitoring/dev/stack.sh |
Launches local or bundled modes. |
solr/monitoring/dev/alertmanager/alertmanager.yml |
Configures example alert routing. |
solr/monitoring/dev/prometheus/prometheus.yml |
Scrapes bundled Solr nodes. |
solr/monitoring/dev/prometheus/prometheus-local.yml |
Scrapes host-local Solr. |
solr/monitoring/dev/grafana/provisioning/dashboards/dashboards.yml |
Provisions the dashboard. |
solr/monitoring/dev/grafana/provisioning/datasources/prometheus.yml |
Provisions Prometheus. |
solr/monitoring/dev/trafficgen/Dockerfile |
Builds the traffic generator. |
solr/monitoring/dev/trafficgen/requirements.txt |
Declares Python dependencies. |
solr/monitoring/dev/trafficgen/trafficgen.py |
Generates indexing and query traffic. |
solr/monitoring/dev/trafficgen/trafficgen.yml |
Configures generated traffic. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Added alerting configuration for Prometheus. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The documented override API did nothing: dashboards and alerts each imported
config.libsonnet directly, so extending the mixin root left the generated
selectors untouched. Compose the mixin from config, dashboards and alerts and
build both outputs from the merged root instead, so that
`(import 'mixin.libsonnet') + { _config+:: ... }` reaches them.
The Heap Used panel reported the largest heap pool rather than the heap: on a
live node `max by (instance)` gave 283 MiB where the pools total 389 MiB. Sum
the pools, taking the max per pool first to collapse the instrumentation scopes
that report the same pool on Solr 10.0.
Prometheus loaded the alert rules but had no Alertmanager configured, so a
firing alert reached nothing; the bundled Alertmanager was decorative. Point
both scrape configs at it.
The stack published Solr, ZooKeeper and the monitoring UIs on every interface
while running without authentication. Bind them to loopback.
make.sh ran the build container as root, which on native Linux leaves the
regenerated artifacts and vendor/ owned by root. Run it as the invoking user.
Also name SOLR-18534 and SOLR-18535 in the changelog, since those replace the
placeholders, and restore the opening parenthesis in the README license header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



https://issues.apache.org/jira/browse/SOLR-18533
Establishes the build and test plumbing for Solr's Grafana dashboard and Prometheus alert rules, under
solr/monitoring. This is the foundation split out of the #4210 POC, so that the dashboard, alert rules and OTLP collector support can land as focused follow-ups.What's here
mixin/— jsonnet sources in the style of the monitoring-mixins community, with aMakefileand a Docker wrapper (make.sh) so contributors need no local toolchain. A target checks for its tools before touching anything and writes through a temp file, so a missing tool cannot truncate a committed artifact.grafana-solr-dashboard.jsonandprometheus-solr-alerts.yml— the generated artifacts, committed alongside the source that produced them. Nothing in the Gradle build regenerates or verifies them.dev/— a docker-compose stack (Solr, Prometheus, Grafana, Alertmanager and a traffic generator) for seeing a change rendered against live metrics. Contributor tooling, excluded from the source release, with image versions pinned and overridable.The artifacts are placeholders
Two panels and one alert rule, carrying an example identity (
solr-mixin-example,SolrExampleAlerts) so they are not mistaken for the real thing. They exist to prove the pipeline end to end, and every key inconfig.libsonnetis wired into them. The real dashboard follows in SOLR-18534, the alert rules in SOLR-18535, and OTLP push support in SOLR-18536.Decisions worth a look
These close the threads left open on #4210:
solr/monitoring/, withdev/and the traffic generator inside it, rather than the root,solr/integrations/, or a separate repo.dev/isexport-ignored likedev-docs/.Validation
gradlew check -x testpasses, includingratand the ref guide build. The stack was run end to end: both Solr nodes scraped, the alert rule loaded healthy, and both panels drawing live data (the screenshot in the ref guide page is a real render of it). Re-running./make.sh all checkleaves the tree clean, so the committed output matches its source.