BTrace Documentation

July 16, 2026 · View on GitHub

Welcome to the BTrace documentation! BTrace is a safe, dynamic tracing tool for the Java platform that allows you to instrument running applications without stopping them.

Quick Start

New to BTrace? Start here → Getting Started Guide

Get up and running in 5 minutes with installation, your first script, and common usage patterns.

Documentation Map

DocumentDescriptionTarget Audience
Getting StartedInstallation, first script, deployment modes, common pitfallsNew users, quick start
Oneliner GuideDTrace-style oneliners for quick debugging without scriptsQuick debugging, ops/SRE
Quick ReferenceAnnotations, patterns, CLI commands, built-in functionsExperienced users, quick lookup
BTrace TutorialComprehensive lessons covering all featuresAll users, in-depth learning
Troubleshooting GuideCommon errors, debugging, performance, compatibilityProblem-solving, debugging
FAQCommon questions, best practices, comparisonsAll users, decision-making
MCP ServerUsing BTrace from AI clients via the Model Context ProtocolAI-assisted debugging, LLM integrations
Migration Guide 2.x → 3.0Upgrading from BTrace 2.x: package rename, Java version policy, breaking changesExisting 2.x users
Extension Development GuideWriting, packaging, and publishing BTrace extensionsExtension authors, platform maintainers
3.0 Release ChecklistJDK, protocol, security, packaging, and RC go/no-go gatesRelease maintainers

Learning Paths

I'm New to BTrace

  1. Read Getting Started Guide (10 minutes)
  2. Try the 5-minute quick start example
  3. Learn Oneliner syntax for quick debugging (5 minutes)
  4. Explore BTrace Tutorial lessons 1-3
  5. Keep Quick Reference handy

Tip: Want latency histograms fast? See Quick Start: Histogram Metrics Extension and the tutorial section Using the Histogram Metrics Extension.

I Need to Solve a Problem

  1. Check Troubleshooting Guide for your error
  2. Search FAQ for similar issues
  3. Review Getting Started common pitfalls
  4. Ask on Slack or Gitter

I Need a Quick Lookup

I Want Advanced Features

  1. JFR IntegrationGetting Started: JFR Integration, Tutorial Lesson 5
  2. SamplingQuick Reference: @Sampled, FAQ: Performance
  3. AggregationsQuick Reference: Aggregation Functions
  4. Cloud DeploymentsGetting Started: K8s, FAQ: K8s
  5. Fat Agent JARGetting Started: Fat Agent for single-JAR deployment
  6. Level FilteringQuick Reference: @Level
  7. Extensions ArchitectureExtension invokedynamic Bridge

I'm Working on AI/LLM Applications

  1. Observe LLM API callsTutorial Lesson 12.1 — token counts, latency, cost tracking
  2. Observe RAG pipelinesTutorial Lesson 12.2 — vector DB queries, similarity scores
  3. Observe on-device inferenceTutorial Lesson 12.3 — ONNX, DJL, TensorFlow
  4. Use BTrace from an AI agentMCP Server for Claude Desktop, Claude Code, Cursor

Documentation by Topic

Core Features

Advanced Features

AI/LLM Observability

  • LLM Inference TracingTutorial Lesson 12.1 — token counts, latency, cost, streaming TTFT
  • RAG Pipeline ObservabilityTutorial Lesson 12.2 — vector DB queries, similarity scores, empty retrievals
  • GPU / Inference ObservabilityTutorial Lesson 12.3 — ONNX Runtime, DJL, TensorFlow, Panama FFM
  • AI Agents (MCP)MCP Server — connect Claude Desktop, Claude Code, or Cursor to live JVMs

Deployment & Operations

Problem Solving

Integration

Architecture

Hands-On Tutorials

Sample Scripts

BTrace includes 50+ sample scripts demonstrating real-world use cases:

  • Location: btrace-dist/src/main/resources/samples/
  • Examples: File I/O tracking, JDBC monitoring, HTTP requests, memory allocation, thread analysis
  • Browse: BTrace Samples Directory

External Resources

Official Resources

Community

Tools & Integrations

  • VisualVM Plugin: visualvm.github.io
  • JDK Mission Control: For viewing JFR events created by BTrace

Contributing

BTrace is an open-source project welcoming contributions. To contribute:

  1. Sign the Oracle Contributor Agreement
  2. Read the Contributing Guidelines
  3. Fork the repository and create a pull request
  4. See Build Instructions for development setup

Version Information

  • Current Version: Check GitHub Releases
  • Java Compatibility: BTrace 3.0 runs on Java 8–25+. Running BTrace against a JVM older than Java 17 is deprecated: it continues to work throughout 3.x but emits a deprecation warning. Support for Java < 17 will be removed in the next major release (4.0). See the migration guide.
  • License: Apache License 2.0

Documentation Feedback

Found an issue with the documentation? Please:

  • Report it on GitHub Issues
  • Tag it with documentation label
  • Or submit a pull request with improvements

Ready to get started?Getting Started Guide