Skip to content

SOLR-18533: Developer tooling for monitoring - #5109

Open
janhoy wants to merge 3 commits into
apache:mainfrom
janhoy:SOLR-18533-monitoring-dev-tooling
Open

janhoy wants to merge 3 commits into
apache:mainfrom
janhoy:SOLR-18533-monitoring-dev-tooling

Conversation

@janhoy

@janhoy janhoy commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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 a Makefile and 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.json and prometheus-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.
  • A reference guide page, laid out so the follow-ups fill in sections rather than restructure it.

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 in config.libsonnet is 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:

  • Location — solr/monitoring/, with dev/ and the traffic generator inside it, rather than the root, solr/integrations/, or a separate repo.
  • No Gradle hook — the mixin build stays standalone, so jsonnet and Go tooling stay out of the Solr build and CI. The trade-off is that a committed artifact can drift from its source; the README says plainly to commit them together.
  • Release packaging — the assets ship in the source tarball, dev/ is export-ignored like dev-docs/.
  • Anonymous viewing in the dev stack — Grafana opens straight on the dashboard with no login, since the stack is local and throwaway. Happy to drop this if reviewers would rather keep the login.

Validation

gradlew check -x test passes, including rat and 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 check leaves the tree clean, so the committed output matches its source.

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.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 12, 2026
@janhoy
janhoy requested a balanced review from Copilot October 12, 2026 18:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Configuration overrides, heap aggregation, alert delivery, and default network exposure contain unresolved functional and security issues.

8 open findings
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.

Comment thread solr/monitoring/dev/docker-compose.yml Outdated
Comment thread solr/monitoring/dev/prometheus/prometheus-local.yml
Comment thread solr/monitoring/dev/prometheus/prometheus.yml
Comment thread solr/monitoring/mixin/dashboards/dashboards.libsonnet Outdated
Comment thread solr/monitoring/mixin/make.sh
Comment thread solr/monitoring/mixin/mixin.libsonnet Outdated
Comment thread changelog/unreleased/SOLR-18533-monitoring-dev-tooling.yml Outdated
Comment thread solr/monitoring/README.md Outdated
janhoy and others added 2 commits October 13, 2026 00:00
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.
@janhoy
janhoy requested a review from dsmiley October 15, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants