Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

java-specialagent

> 后端框架
Open source

Automatic instrumentation for 3rd-party libraries in Java applications with OpenTracing.

189 stars0 likes2 views
WebsiteGitHub

About

Automatic instrumentation for 3rd-party libraries in Java applications with OpenTracing.

Java Agent for OpenTracing

NOTE: It is deprecated now. Please migrate to OpenTelemetry Instrumentation.

Automatically instruments 3rd-party libraries in Java applications

[][circleci]

What is SpecialAgent?

The SpecialAgent is software that attaches to Java applications, and automatically instruments 3rd-party libraries within. The SpecialAgent uses the OpenTracing API for Integrations that instrument 3rd-party libraries, as well as Trace Exporters that export trace data to OpenTracing Tracer vendors. The architecture of SpecialAgent was specifically designed to include contributions from the community, whereby its platform automates the installation of OpenTracing Integrations written by individual contributors. In addition to Integrations, the SpecialAgent also supports Trace Exporters, which connect an instrumented runtime to OpenTracing-compliant tracer vendors, such as [LightStep][lightstep], [Wavefront][wavefront], or [Jaeger][jaeger]. Both the Integrations and the Trace Exporters are decoupled from SpecialAgent -- i.e. neither need to know about SpecialAgent. At its core, the SpecialAgent is itself nothing more than an engine that abstracts the functionality for the automatic installation of Integrations, and their connection to Trace Exporters. A benefit of this approach is that the SpecialAgent intrinsically embodies and encourages community involvement.

Both the Integrations and the Trace Exporters are open-source, and are developed and supported by the OpenTracing community.

The SpecialAgent supports Oracle Java and OpenJDK.

Table of Contents

  1 Introduction

  2 Quick Start

    2.1 Installation

       2.1.1 In Application

           2.1.1.1 Stable

           2.1.1.2 Development

       2.1.2 For Development

           2.1.2.1 Integrations

               2.1.2.1.1 Uncoupled Integrations

               2.1.2.1.2 Coupled Integrations

               2.1.2.1.3 Development of Integration Rules

           2.1.2.2 Trace Exporters

               2.1.2.2.1 Short Name

    2.2 Usage

       2.2.1 Static Attach

       2.2.2 Dynamic Attach

       2.2.3 Static Deferred Attach

  3 Configuration

    3.1 Overview

    3.2 Properties

       3.2.1 Logging

       3.2.2 Integration

       3.2.3 General

    3.3 Selecting the Trace Exporter

    3.4 Disabling Integration Rules

       3.4.1 Disabling All Integration Rules

       3.4.2 Disabling (or enabling) One Integration Rule

       3.4.3 Disabling AgentRules of an Integration Rule

    3.5 Disabling Trace Exporters

    3.6 Including custom Integration Rules

    3.7 Rewritable Tracer

  4 Supported Integrations and Trace Exporters

    4.1 Integrations

    4.2 Trace Exporters

    4.3 Libraries instrumented via other Integrations

  5 Objectives

    5.1 Goals

    5.2 Non-Goals

  6 Definitions

    6.1 Tracer

    6.2 Trace Exporter

    6.3 Integration

    6.4 Integration Rule

  7 Credits

  8 Contributing

  9 License

1 Introduction

This file contains the operational instructions for the use and development of SpecialAgent.

2 Quick Start

The SpecialAgent is a Java Agent that attaches to an application (either statically or dynamically). Once attached, the SpecialAgent it loads its bundled Integrations, which are all enabled by default.

The SpecialAgent is stable -- any exception that occurs during attachment of SpecialAgent will not adversely affect the stability of the target application. It is, however, important to note that SpecialAgent bundles Integrations that are developed by 3rd parties and individual contributors. We strive to assert the stability of SpecialAgent with rigorous [integration tests][circleci], yet it is still possible that the code in a bundled Integration may result in an exception that is not properly handled, which could potentially destabilize a target application.

2.1 Installation

The Maven build of the SpecialAgent project generates 2 artifacts: main and test. These artifacts can be obtained by downloading directly from Maven's Central Repository, or by cloning this repository and following the Development Instructions.

2.1.1 In Application

The SpecialAgent is contained in a single JAR file. This JAR file is the main artifact built by Maven, and bundles the Integrations from [opentracing-contrib][opentracing-contrib] for which Integration Rules have been implemented.

To use the SpecialAgent on an application, please download the stable or development main artifact.

The artifact JAR can be provided to an application with the -javaagent:${SPECIAL_AGENT_JAR} vm argument for Static Attach and Static Deferred Attach. The artifact JAR can also be executed in standalone fashion, which requires an argument to be passed for the PID of a target process to which SpecialAgent is to dynamically attach. Please refer to Usage section for usage instructions.

2.1.1.1 Stable

The latest stable release is: [1.7.4][main-release]

bash
wget -O opentracing-specialagent-1.7.4.jar "https://repo1.maven.org/maven2/io/opentracing/contrib/specialagent/opentracing-specialagent/1.7.4/opentracing-specialagent-1.7.4.jar"
2.1.1.2 Development

The latest development release is: [1.7.5-SNAPSHOT][main-snapshot]

bash
wget -O opentracing-specialagent-1.7.5-SNAPSHOT.jar "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=io.opentracing.contrib.specialagent&a=opentracing-specialagent&v=LATEST"

Note: Sometimes the web service call (in the line above) to retrieve the latest SNAPSHOT build fails to deliver the correct download. In order to work around this issue, please consider using the following command (for Linux and Mac OS):

bash
wget -O opentracing-specialagent-1.7.5-SNAPSHOT.jar $(curl -s https://oss.sonatype.org/content/repositories/snapshots/io/opentracing/contrib/specialagent/opentracing-specialagent/1.7.5-SNAPSHOT/ | grep '".*\d\.jar"' | tail -1 | awk -F\" '{print $2}')

2.1.2 For Development

The SpecialAgent is built in 2 passes utilizing different profiles:

  1. The default profile is used for development of Integration Rules. It builds and runs tests for each rule, but does not bundle the rules into the main JAR (i.e. opentracing-specialagent-1.7.5-SNAPSHOT.jar).

    To run this profile:

    bash
    mvn clean install

    Note: If you skip tests, the assemble profile will display an error stating that tests have not been run. See Convenient One-Liners for quick ways to build and package SpecialAgent.

  2. The assemble profile is used to bundle the Integrations into the main JAR (i.e. opentracing-specialagent-1.7.5-SNAPSHOT.jar). It builds each rule, but does not run tests. Once the build with the assemble profile is finished, the main JAR (i.e. opentracing-specialagent-1.7.5-SNAPSHOT.jar) will contain the built rules inside it.

    Note: If you do not run this step, the opentracing-specialagent-1.7.5-SNAPSHOT.jar from the previous step will not contain any Integrations!

    Note: It is important to not run Maven's clean lifecycle when executing the assemble profile, otherwise the Integrations built in with the default profile will be cleared.

    To run this profile:

    bash
    mvn -Dassemble install
  • For a one-line build command to build SpecialAgent, its rules, run all tests, and create the assemble package:

    bash
    mvn clean install && mvn -Dassemble install
Convenient One-Liners
  1. Skipping tests when building SpecialAgent.

    bash
    mvn -DskipTests clean install
  2. Skipping compatibility tests when building SpecialAgent rules.

    bash
    mvn -DskipCompatibilityTests clean install
  3. Packaging SpecialAgent with rules that skipped test execution.

    bash
    mvn -Dassemble -DignoreMissingTestManifest install
2.1.2.1 Integrations

The SpecialAgent supports two kinds of Integrations:

2.1.2.1.1 Uncoupled Integrations

Uncoupled Integrations are those that can be used without SpecialAgent. These Integrations are not coupled to SpecialAgent, and can be used via manual integration in an application.

Uncoupled Integrations are implemented in [opentracing-contrib][opentracing-contrib], and do not know about SpecialAgent.

To support Uncoupled Integrations, SpecialAgent requires the implementation of an Integration Rule that bridges the Uncoupled Integrations to SpecialAgent's auto-instrumentation mechanism.

Th

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaagentawsbytebuddycamel

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架