Java (JVM)
Collect JVM runtime and HTTP metrics from any JVM application and get curated dashboards and alerts for them with a single import.
JVM apps instrumented with the OpenTelemetry Java agent export their metrics over OTLP to your LeanSignal agent gateway (one per cluster or environment) — never to a remote or third-party endpoint. The gateway keeps full fidelity locally and forwards only the demanded subset to your central dataplane. This integration covers JVM runtime health (heap/non-heap memory, GC duration, threads, classes, CPU) plus HTTP server request metrics.
Metric names follow the standard OTLP → Prometheus normalization (dots become
underscores, unit/_total suffixes are added), so jvm.memory.used becomes
jvm_memory_used_bytes and http.server.request.duration becomes
http_server_request_duration_seconds. The demands below are built against those
names.
Prerequisites
Section titled “Prerequisites”- A LeanSignal agent gateway deployed and connected — one per cluster or
environment. If you haven’t deployed it yet, follow
Install the agent (source:
LeanSignal/leansignal-agent). It should show as Connected under Agents in the LeanSignal app. - Network reachability to the gateway’s OTLP port —
4317(gRPC) or4318(HTTP). See Agent configuration. - Your Java (JVM) app instrumented with the OpenTelemetry SDK, exporting metrics over OTLP to the gateway — configured in Setup.
- Editor or admin role in the LeanSignal app (importing a demand creates dashboards and alert rules).
Attach the OpenTelemetry Java agent and point it at your LeanSignal agent gateway
(OTLP gRPC :4317 / HTTP :4318) — not a SaaS endpoint. No code changes are
required; JVM runtime and HTTP server metrics are on by default.
# 1. Download the agent (pin a version in production)curl -Lo opentelemetry-javaagent.jar \ https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
# 2. Configure export to the gatewayexport OTEL_SERVICE_NAME=orders-serviceexport OTEL_EXPORTER_OTLP_ENDPOINT=http://<gateway-host>:4317export OTEL_EXPORTER_OTLP_PROTOCOL=grpc # or http/protobuf against :4318export OTEL_METRICS_EXPORTER=otlp # default; keep metrics enabled
# 3. Run with the agent attachedjava -javaagent:/path/opentelemetry-javaagent.jar -jar app.jarThe equivalent as JVM system properties: -Dotel.service.name=orders-service -Dotel.exporter.otlp.endpoint=http://<gateway-host>:4317.
Logs and traces
Section titled “Logs and traces”The Java agent from Setup already exports all three signals: with
OTEL_EXPORTER_OTLP_ENDPOINT set, traces and logs flow to the gateway by
default alongside metrics — Logback and Log4j output is captured automatically,
and every supported framework is traced with no code changes. To turn a signal
off, set OTEL_TRACES_EXPORTER=none or OTEL_LOGS_EXPORTER=none. See the
Java zero-code instrumentation docs.
Demands
Section titled “Demands”Java (JVM) ships as a ready-made demand in three variants. You don’t copy any JSON — in the LeanSignal app go to Demands, press the ˅ arrow on the Add Demand button (the arrow opens the import menu), choose Import from catalog…, and pick the variant. Each variant below lists the slug that identifies its published bundle. See Integrations for the full import flow.
The variants are nested — Standard is a superset of Essential, Extended a superset of Standard. Pick whichever is closest to what you need and treat it as a starting point: after import everything is a normal, editable copy, so retune thresholds, add or drop panels, and adjust queries for your environment — your edits reshape the demand automatically. Start small and re-import a larger variant later if you outgrow it.
The golden signals. 1 dashboard · 4 panels · 3 alerts — traffic, errors, latency, and heap headroom at a glance.
Import this variant from the catalog. Its demand slug:
java-otel-demand-essentialDashboard — HTTP request rate, HTTP 5xx error rate, HTTP request duration p95, and Heap utilization vs limit.
Alerts (3)
| Alert | Severity | Fires when |
|---|---|---|
| High HTTP 5xx error rate | critical | 5xx ratio > 5% for 5m |
| High HTTP p95 latency | warning | p95 latency > 1s for 5m |
| Heap memory near limit | critical | post-GC heap floor > 90% of limit for 5m |
Well-rounded runtime coverage. 1 dashboard · 7 panels · 5 alerts — adds heap usage, GC pauses, and thread health. The recommended default.
Import this variant from the catalog. Its demand slug:
java-otel-demand-standardDashboard — everything in Essential, plus Heap memory used, GC pause duration p95, and Live thread count.
Alerts (5)
| Alert | Severity | Fires when |
|---|---|---|
| High HTTP 5xx error rate | critical | 5xx ratio > 5% for 5m |
| High HTTP p95 latency | warning | p95 latency > 1s for 5m |
| Heap memory near limit | critical | post-GC heap floor > 90% of limit for 5m |
| Elevated GC pause p95 | warning | GC pause p95 > 0.5s for 5m |
| High heap utilization | warning | post-GC heap floor > 80% of limit for 10m |
Deep JVM visibility. 1 dashboard · 14 panels · 9 alerts — CPU, memory pools, GC behavior, and leak indicators for services you need to diagnose, not just watch.
Import this variant from the catalog. Its demand slug:
java-otel-demand-extendedDashboard — everything in Standard, plus JVM CPU utilization, Heap used after last GC, Heap memory used by pool, Non-heap memory used, GC collection rate, Time spent in GC, and Threads by state.
Alerts (9)
| Alert | Severity | Fires when |
|---|---|---|
| High HTTP 5xx error rate | critical | 5xx ratio > 5% for 5m |
| High HTTP p95 latency | warning | p95 latency > 1s for 5m |
| Heap memory near limit | critical | post-GC heap floor > 90% of limit for 5m |
| Elevated GC pause p95 | warning | GC pause p95 > 0.5s for 5m |
| High heap utilization | warning | post-GC heap floor > 80% of limit for 10m |
| Excessive time in GC | warning | GC time fraction > 10% for 10m |
| Very high HTTP p99 latency | warning | p99 latency > 2.5s for 5m |
| High thread count | warning | > 300 threads for 10m |
| Live heap high after GC (possible leak) | critical | post-GC heap > 90% for 15m |
Dashboards
Section titled “Dashboards”Each variant imports one Java (JVM) dashboard, its panels grouped into
collapsible sections. Every dashboard carries an Instance filter (on the
instance label), so one import covers the whole fleet — view every instance
at once, or focus on one. Legends are sortable tables showing last/mean/max per
series, so the outlier instance stands out. Dashboards are demand-driven:
importing one tells your agents to forward exactly the timeseries its panels
query, and nothing else. Panels are ordinary Perses panels — edit queries, add
panels, or retune them after import, and your changes reshape the demand
automatically.
Alerts
Section titled “Alerts”Thresholds are conservative starting points — tune them to your workload.
Next steps
Section titled “Next steps”- Demand-driven observability — why importing a demand also shapes what your agents collect.
- Agent configuration — the full agent config surface.
Thanks for your feedback!
Report sent — thank you!