使用 OpenTracing 为 Java 应用程序中的第三方库提供自动仪表盘。
NOTE: It is deprecated now. Please migrate to OpenTelemetry Instrumentation.
Automatically instruments 3rd-party libraries in Java applications
[][circleci]
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.
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.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.6 Including custom Integration Rules
4 Supported Integrations and Trace Exporters
4.1 Integrations
4.2 Trace Exporters
4.3 Libraries instrumented via other Integrations
5.1 Goals
5.2 Non-Goals
6.1 Tracer
6.2 Trace Exporter
6.3 Integration
6.4 Integration Rule
7 Credits
9 License
This file contains the operational instructions for the use and development of SpecialAgent.
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.
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.
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.
The latest stable release is: [1.7.4][main-release]
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"The latest development release is: [1.7.5-SNAPSHOT][main-snapshot]
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):
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}')The SpecialAgent is built in 2 passes utilizing different profiles:
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:
mvn clean installNote: 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.
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:
mvn -Dassemble installFor a one-line build command to build SpecialAgent, its rules, run all tests, and create the assemble package:
mvn clean install && mvn -Dassemble installSkipping tests when building SpecialAgent.
mvn -DskipTests clean installSkipping compatibility tests when building SpecialAgent rules.
mvn -DskipCompatibilityTests clean installPackaging SpecialAgent with rules that skipped test execution.
mvn -Dassemble -DignoreMissingTestManifest installThe SpecialAgent supports two kinds of 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,或尚未同步最近议题。