Operations 9 min read

How Arthas Hit 25K Stars: A Year of Java Diagnostic Innovations

This article reviews Arthas’s rapid growth to over 25,000 GitHub stars, highlighting its technical advancements, release highlights, community contributions, usage statistics, and future roadmap, while providing code examples and links to its open‑source repositories and documentation.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
How Arthas Hit 25K Stars: A Year of Java Diagnostic Innovations

Background

Micro‑service architectures make live Java diagnostics difficult because traditional debugging requires restarting the service, which loses runtime context. Arthas, open‑sourced by Alibaba in September 2018, solves this by using bytecode weaving to inspect call stacks, generate flame graphs, perform hot code updates, and diagnose large clusters without restarting the JVM.

Key Technical Features (2022‑2023 releases)

Bytekit framework – a new annotation‑driven bytecode enhancement library (see https://github.com/alibaba/bytekit).

Full HTTP API – all commands are exposed via JSON‑structured REST endpoints (e.g., https://arthas.aliyun.com/doc/http-api.html).

Unified authentication – a single auth mechanism for Telnet, WebSocket, and HTTP APIs (see https://arthas.aliyun.com/doc/auth.html).

retransform command – a safe hot‑update operation that coexists with watch and trace without interfering with them.

Tunnel Server – supports cluster deployment, Redis‑backed storage, HTTP proxy, and flame‑graph viewing (see https://arthas.aliyun.com/doc/tunnel.html).

arthas-spring-boot-starter – a Spring Boot starter that allows programmatic integration of Arthas (see https://arthas.aliyun.com/doc/spring-boot-starter.html).

Bytekit Framework Example

Bytekit enables concise bytecode injection via annotations. The following interceptor prints the first argument of a method at entry:

public static class SampleInterceptor {
    @AtEnter(inline = true, suppress = RuntimeException.class,
             suppressHandler = PrintExceptionSuppressHandler.class)
    public static void atEnter(@Binding.This Object object,
                               @Binding.Class Object clazz,
                               @Binding.Args Object[] args,
                               @Binding.MethodName String methodName,
                               @Binding.MethodDesc String methodDesc) {
        System.out.println("atEnter, args[0]: " + args[0]);
    }
}

Bytekit also supports inline injection, dynamic binding, and programmable exception handling.

retransform Command Flow

The retransform command is executed before watch and trace, ensuring that hot‑updates do not affect ongoing tracing: retransform → watch → trace Thus, applying retransform leaves existing watch / trace commands unaffected.

Tunnel Server Cluster Support

The Tunnel Server can be deployed in a cluster, uses Redis for state storage, supports an HTTP proxy, and provides a built‑in flame‑graph viewer for performance analysis.

Spring Boot Starter Integration

The arthas-spring-boot-starter module adds an endpoint that allows developers to start Arthas from a Spring Boot application, simplifying cluster‑wide management when combined with the Tunnel Server.

Future Roadmap

Full RESTful API support for all commands.

Completion and stabilization of the Bytekit framework.

Plugin architecture via the One Java Agent project ( https://github.com/alibaba/one-java-agent) to provide install/uninstall interfaces and backward compatibility with existing Java agents.

Repository Links

Arthas source code: https://github.com/alibaba/arthas Bytekit source code:

https://github.com/alibaba/bytekit
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javabytecodeopen sourcediagnosticsArthas
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.