Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INSPECTIT-1921: Implementation of the opentracing.io API and support …
…for HTTP and JMS tracing
- Loading branch information
Showing
189 changed files
with
11,754 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> | ||
<local-check-config name="inspectIT" location="/inspectit.root/resources/config/checkstyle/inspectit-checkstyle.xml" type="project" description=""> | ||
<additional-data name="protect-config-file" value="false"/> | ||
</local-check-config> | ||
<fileset name="all" enabled="true" check-config-name="inspectIT" local="true"> | ||
<file-match-pattern match-pattern="." include-pattern="true"/> | ||
</fileset> | ||
<filter name="FilesFromPackage" enabled="true"> | ||
<filter-data value="src/test/java"/> | ||
</filter> | ||
</fileset-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src/main/java"> | ||
<attributes> | ||
<attribute name="FROM_GRADLE_MODEL" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="src/test/java"> | ||
<attributes> | ||
<attribute name="FROM_GRADLE_MODEL" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/"/> | ||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<eclipse-pmd xmlns="http://acanda.ch/eclipse-pmd/0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://acanda.ch/eclipse-pmd/0.8 http://acanda.ch/eclipse-pmd/eclipse-pmd-0.8.xsd"> | ||
<analysis enabled="true" /> | ||
<rulesets> | ||
<ruleset name="Custom ruleset" ref="../resources/config/pmd/pmd_rules.xml" refcontext="project" /> | ||
</rulesets> | ||
</eclipse-pmd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/bin | ||
/build | ||
/test-output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>inspectit.agent.java.sdk</name> | ||
<comment>Project inspectit.agent.java.sdk created by Buildship.</comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>ch.acanda.eclipse.pmd.builder.PMDBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature> | ||
<nature>ch.acanda.eclipse.pmd.builder.PMDNature</nature> | ||
</natures> | ||
</projectDescription> |
11 changes: 11 additions & 0 deletions
11
inspectit.agent.java.sdk/.settings/org.eclipse.buildship.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
build.commands=org.eclipse.jdt.core.javabuilder | ||
connection.arguments= | ||
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) | ||
connection.java.home=null | ||
connection.jvm.arguments= | ||
connection.project.dir=.. | ||
containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/ | ||
derived.resources=.gradle,build | ||
eclipse.preferences.version=1 | ||
natures=org.eclipse.jdt.core.javanature | ||
project.path=\:inspectit.agent.java.sdk |
13 changes: 13 additions & 0 deletions
13
inspectit.agent.java.sdk/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
eclipse.preferences.version=1 | ||
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.6 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.6 | ||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Gradle build file for the inspectit.agent.java.sdk project. | ||
* | ||
* @author Ivan Senic | ||
*/ | ||
defaultTasks 'releaseAndAnalyze' | ||
|
||
/** used by the eclipse buildship plugin */ | ||
sourceCompatibility = '1.6' | ||
targetCompatibility = '1.6' | ||
|
||
/** defined to have it included in Eclipse as source */ | ||
sourceSets { | ||
externalResources { | ||
resources { | ||
srcDir mainExtResources | ||
} | ||
} | ||
} | ||
|
||
/** Some agent specific properties */ | ||
ext { | ||
distJarName = 'inspectit-agent-java-sdk' | ||
} | ||
|
||
/** Setting compile configuration as plugin in Eclipse needs it */ | ||
configurations { | ||
compile { | ||
extendsFrom configurations.agentJavaSdkProd | ||
} | ||
testCompile { | ||
extendsFrom configurations.agentJavaSdkTest | ||
extendsFrom configurations.jmhbase | ||
} | ||
} | ||
|
||
/** Must depend on shared all test sources because of TestBase class */ | ||
dependencies { | ||
testCompile project (path: ':inspectit.shared.all', configuration: 'testArchives') | ||
} | ||
|
||
/** Compile compatibility to 1.6 for all compile tasks */ | ||
tasks.withType(JavaCompile) { t -> | ||
sourceCompatibility = '1.6' | ||
targetCompatibility = '1.6' | ||
|
||
options.bootClasspath = configurations.java16rt.asPath | ||
} | ||
|
||
/** | ||
* Creates the jar. | ||
*/ | ||
jar { | ||
archivesBaseName = distJarName | ||
|
||
manifest {} | ||
} | ||
|
||
task releaseAndAnalyze { | ||
description = "Runs all unit tests, all checks and releases the jar." | ||
group = 'Release' | ||
dependsOn(analyze, jar) | ||
} |
81 changes: 81 additions & 0 deletions
81
...ent.java.sdk/src/main/java/rocks/inspectit/agent/java/sdk/opentracing/ExtendedTracer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package rocks.inspectit.agent.java.sdk.opentracing; | ||
|
||
import io.opentracing.Tracer; | ||
import io.opentracing.propagation.Format; | ||
import rocks.inspectit.agent.java.sdk.opentracing.propagation.Propagator; | ||
|
||
/** | ||
* This interface defines additional methods that inspectIT tracer provides for usage. | ||
* <p> | ||
* There are additional two methods for creating a {@link SpanBuilder} where user can choose if | ||
* current thread context should be referenced or not. | ||
* <p> | ||
* The tracer allows registration of the {@link Propagator} for a specific format. This method | ||
* allows overwriting of the tracer default propagators. Note that inspectIT tracer by default uses | ||
* {@link rocks.inspectit.agent.java.sdk.opentracing.internal.propagation.TextMapPropagator} for the | ||
* <code>io.opentracing.propagation.Format.Builtin.TEXT_MAP</code> and | ||
* {@link rocks.inspectit.agent.java.sdk.opentracing.internal.propagation.UrlEncodingPropagator} for | ||
* the <code>io.opentracing.propagation.Format.Builtin.HTTP_HEADERS</code> format. | ||
* | ||
* @author Ivan Senic | ||
* | ||
*/ | ||
public interface ExtendedTracer extends Tracer { | ||
|
||
/** | ||
* Registers propagator. This method allows overwriting of the tracer default propagators. Note | ||
* that inspectIT tracer by default uses | ||
* {@link rocks.inspectit.agent.java.sdk.opentracing.internal.propagation.TextMapPropagator} for | ||
* the <code>io.opentracing.propagation.Format.Builtin.TEXT_MAP</code> and | ||
* {@link rocks.inspectit.agent.java.sdk.opentracing.internal.propagation.UrlEncodingPropagator} | ||
* for the <code>io.opentracing.propagation.Format.Builtin.HTTP_HEADERS</code> format. | ||
* | ||
* @param <C> | ||
* format type | ||
* @param format | ||
* opentracing {@link Format} | ||
* @param propagator | ||
* {@link Propagator} | ||
*/ | ||
<C> void registerPropagator(Format<C> format, Propagator<C> propagator); | ||
|
||
/** | ||
* Sets the implementation of the {@link Timer} to use. | ||
* <p> | ||
* By default inspectIT tracer uses | ||
* {@link rocks.inspectit.agent.java.sdk.opentracing.util.SystemTimer} that has millisecond | ||
* start time precision. This done so inspectIT can be compatible with Java 6. Users can provide | ||
* better timers if they run on higher Java versions or have third party dependencies that could | ||
* do better. | ||
* | ||
* @param timer | ||
* {@link Timer} to set. Must not be <code>null</code>. | ||
* @throws IllegalArgumentException | ||
* If timer provided is <code>null</code>. | ||
*/ | ||
void setTimer(Timer timer) throws IllegalArgumentException; | ||
|
||
/** | ||
* Builds span with no operation name. The thread context reference will added if the one exists | ||
* as the CHILD_OF reference. | ||
* | ||
* @return {@link SpanBuilder}. | ||
*/ | ||
SpanBuilder buildSpan(); | ||
|
||
/** | ||
* Creates {@link SpanBuilder} that optionally adds the reference to the current thread context | ||
* span. | ||
* | ||
* @param operationName | ||
* Operation name of the span. | ||
* @param referenceType | ||
* Reference type to the current context. Can be <code>null</code> if | ||
* <code>useThreadContext=false</code> | ||
* @param useThreadContext | ||
* If thread context should be used. | ||
* @return {@link SpanBuilder}. | ||
*/ | ||
SpanBuilder buildSpan(String operationName, String referenceType, boolean useThreadContext); | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...tit.agent.java.sdk/src/main/java/rocks/inspectit/agent/java/sdk/opentracing/Reporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package rocks.inspectit.agent.java.sdk.opentracing; | ||
|
||
import rocks.inspectit.agent.java.sdk.opentracing.internal.impl.SpanImpl; | ||
|
||
/** | ||
* Reporter serves as class handling finished spans. | ||
* <p> | ||
* This SDK only provides the {@link rocks.inspectit.agent.java.sdk.opentracing.noop.NoopReporter} | ||
* as the implementation. However, if the inspectit agent is active on the target application, the | ||
* "real" reporter will be used which sends spans to the inspectIT CMR. In this case the | ||
* initialization of the reported and the tracer is done by inspectIT and can be obtained in | ||
* {@link rocks.inspectit.agent.java.sdk.opentracing.TracerProvider}. | ||
* | ||
* @author Ivan Senic | ||
* | ||
*/ | ||
public interface Reporter { | ||
|
||
/** | ||
* Reports span once it's finished. Spans that are started, but not finished are not reported. | ||
* | ||
* @param span | ||
* Span to report. | ||
*/ | ||
void report(SpanImpl span); | ||
} |
25 changes: 25 additions & 0 deletions
25
inspectit.agent.java.sdk/src/main/java/rocks/inspectit/agent/java/sdk/opentracing/Timer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package rocks.inspectit.agent.java.sdk.opentracing; | ||
|
||
/** | ||
* Timer interface for measuring. | ||
* | ||
* @author Ivan Senic | ||
* | ||
*/ | ||
public interface Timer { | ||
|
||
/** | ||
* Returns current time in microseconds (microseconds since epoch). | ||
* | ||
* @return Returns current time in microseconds (microseconds since epoch). | ||
*/ | ||
long getCurrentTimeMicroseconds(); | ||
|
||
/** | ||
* Returns the current nano time. Simple implementation can use | ||
* {@link java.lang.System#nanoTime()}. | ||
* | ||
* @return Returns the current nano time. | ||
*/ | ||
long getCurrentNanoTime(); | ||
} |
Oops, something went wrong.