Karma-Lens for Java
Production runtime metrics. Inside your editor. On every method.
Karma-Lens overlays live production telemetry onto your Java source — QPM, latency, error rates, dead-code, and traffic-weighted call graphs — so you can refactor, debug, and review code with the same data your services emit at runtime.
Stop tab-switching between APM dashboards and your IDE. The numbers come to the code.
Why Karma-Lens
- Refactor with confidence — see how often each method actually runs before you touch it.
- Delete dead code safely — methods that never execute in production are marked automatically.
- Find real hotspots — call hierarchies and usages ranked by traffic, not file order.
- Catch regressions early — error % and latency overlays surface anomalies as you read code.
- Review faster — open a PR, hover a method, get the production story in one place.
Features
- Inline CodeLens overlays on every method showing live QPM, error %, and latency.
- Dead-code detection with strikethrough decoration on methods that never execute in production.
- Code-block coverage marks in the gutter so you can see which branches actually run.
- Rich hover cards with detailed method and code-block metrics.
- Call Hierarchy with Metrics and Find Usages with Metrics — navigate your code weighted by real traffic.
- Method Dashboard, Timeseries, and Metrics Graph webview panels for deep-dive analysis.
- Pinned Metrics side-bar — keep an eye on the methods that matter.
- Project Insights view summarizing hotspots and anomalies across your codebase.
- Secure sign-in via OAuth (PKCE) with tokens stored in VS Code SecretStorage; automatic refresh on expiry.
- Configurable background polling so overlays stay current without manual refresh.
Getting Started
- Install Karma-Lens for Java from the Marketplace. The Red Hat Java extension is installed for you.
- Open a Java project. Click the Karma-Lens icon in the Activity Bar.
- Sign in via the panel — uses your CodeKarma account.
- Pick a domain and service. Metrics begin streaming onto your code.
Requirements
|
|
| VS Code |
1.84.0+ |
| Node.js |
20+ |
| Java tooling |
Red Hat Java (auto-installed) |
| Backend |
Reachable Karma (Nexus) instance |
Opening Karma-Lens
Open the Karma-Lens sidebar from the Activity Bar icon, or run View: Show Karma-Lens from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
The sidebar hosts three views:
- Settings — backend endpoint, sign in/out, domain, service, time window, dead-code toggle.
- Insights — project-wide method counts, dead-code list, hotspots.
- Pinned — methods you've pinned for quick monitoring.
Actions
All actions live in the editor — there is no command palette surface for individual features.
| Where |
Action |
Right-click in a .java file |
Find Usages with Metrics · Open Call Hierarchy with Metrics · Show Method Metrics Graph · Copy Method Signature · Pin Metric · Open Insights |
| CodeLens above a method |
Click to open the Method Dashboard with detailed metrics, timeseries, graph |
| Settings view → Time Window |
Calendar + aggregation picker. Apply to refresh all overlays |
| Pinned view item → context |
Unpin |
| Insights tree item → context |
Show Method Metrics Graph |
Settings
Configure under Settings → Extensions → Karma-Lens, or edit settings.json directly.
| Key |
Type |
Default |
Description |
karmaLens.enabled |
boolean |
true |
Show overlays (CodeLens, gutter, dead-code, hover) in this project. |
karmaLens.aggregationMinutes |
5 | 10 | 15 |
15 |
Inlay metrics aggregation window (minutes). |
karmaLens.metricsEndTimeEpochMs |
number |
0 |
Window end time (epoch ms). 0 = live. |
karmaLens.deadMethod.strikethrough |
boolean |
true |
Strikethrough decoration on dead methods. |
karmaLens.pollingIntervals.apiMetricsMs |
number |
120000 |
API metrics poll interval (ms). |
karmaLens.pollingIntervals.classMethodMs |
number |
120000 |
Class/method metrics poll interval (ms). |
karmaLens.pollingIntervals.classStatusMs |
number |
1800000 |
Class status poll interval (ms). |
karmaLens.extraCaCerts |
string[] |
[] |
Absolute paths to PEM files with additional trusted CA certificates. See Sign-in on networks with private certificate authorities below. |
Sign-in on networks with private certificate authorities
If you are on a corporate network that runs TLS inspection (Zscaler, Palo Alto, Netskope, Fortinet, etc.), behind a self-hosted CodeKarma deployment with an internal CA, or pointing at a self-signed development backend, sign-in will fail with one of:
unable to verify the first certificate
self signed certificate in certificate chain
UNABLE_TO_VERIFY_LEAF_SIGNATURE
Karma-Lens validates the TLS chain against Node's default root store, which does not contain private corporate or self-signed CAs. To extend the trust store, configure karmaLens.extraCaCerts with the path(s) to the required root CA certificate(s) in PEM format.
Option 1 — per-user setting
Obtain the root CA certificate in PEM format from your IT team, or export it from your OS keychain. The file usually looks like:
-----BEGIN CERTIFICATE-----
MIIE...
-----END CERTIFICATE-----
Save it locally, for example ~/karma-lens/corp-root.pem.
Add the path under Settings → Extensions → Karma-Lens → Extra Ca Certs, or edit settings.json directly:
{
"karmaLens.extraCaCerts": [
"/Users/<you>/karma-lens/corp-root.pem"
]
}
Retry sign-in. No VS Code reload is required — the change is picked up immediately.
Option 2 — fleet rollout via environment variable
For IT-managed deployments, set the NODE_EXTRA_CA_CERTS environment variable to the corporate root CA PEM before launching VS Code:
export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/corp-root.pem
Node extends its default trust store automatically; no plugin configuration is needed.
Security notes
- The configured certificates are merged with Node's default roots, never replacing them. Default-chain validation runs first.
- Hostname verification stays strict — there is no
rejectUnauthorized: false, no custom hostname check, and no code-level trust bypass.
- Trust extension requires an explicit user action (editing the setting or the environment variable) and is auditable via
settings.json.
Privacy
Karma-Lens talks only to the backend URL you configure (karmaLens.apiBaseUrl). Auth tokens are stored in VS Code SecretStorage. No source code leaves your machine.
Support
License
License: See LICENSE file - Proprietary License
(c) 2026 CodeKarma Technologies. All Rights Reserved.