Commit 73d309da authored by 吴晟's avatar 吴晟 Committed by GitHub
Browse files

Merge branch 'master' into feature/365

parents 16611207 2fe5362a
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>apm-application-toolkit</artifactId>
        <groupId>org.skywalking</groupId>
        <version>3.2-2017</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>apm-toolkit-trace</artifactId>
    <packaging>jar</packaging>

    <url>http://maven.apache.org</url>

    <build>
        <plugins>
            <plugin>
                <!-- 源码插件 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <!-- 发布时自动将源码同时发布的配置 -->
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <version>2.4</version>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>bintray-wu-sheng-sky-walking-repository</id>
            <name>wu-sheng-sky-walking-repository</name>
            <url>
                https://api.bintray.com/maven/wu-sheng/skywalking/org.skywalking.apm-toolkit-trace/;publish=1
            </url>
        </repository>
    </distributionManagement>
</project>
+16 −0
Original line number Diff line number Diff line
package org.skywalking.apm.toolkit.trace;

/**
 * provide custom api that set tag for current active span.
 *
 * @author zhangxin
 */
public class ActiveSpan {
    /**
     * @param key tag key
     * @param value tag value
     */
    public static void tag(String key, String value) {

    }
}
+22 −0
Original line number Diff line number Diff line
package org.skywalking.apm.toolkit.trace;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * The agent create local span if the method that annotation with {@link Trace}. The value of span operation name will
 * fetch by {@link #operationName()}.  if the value of {@link #operationName()} is blank string. the operation name will
 * be set the class name + method name.
 *
 * @author zhangxin
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Trace {
    /**
     * @return operation name, the default value is blank string.
     */
    String operationName() default "";
}
+1 −0
Original line number Diff line number Diff line
@@ -19,5 +19,6 @@
        <module>apm-toolkit-logback-1.x</module>
        <module>apm-toolkit-trace-context</module>
        <module>apm-toolkit-opentracing</module>
        <module>apm-toolkit-trace</module>
    </modules>
</project>
+7 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class ContextManager implements TracingContextListener, BootService, Igno
                context = new IgnoredTracerContext();
            } else {
                if (RemoteDownstreamConfig.Agent.APPLICATION_ID != DictionaryUtil.nullValue()
                    || RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID != DictionaryUtil.nullValue()
                    && RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID != DictionaryUtil.nullValue()
                    ) {
                    int suffixIdx = operationName.lastIndexOf(".");
                    if (suffixIdx > -1 && Config.Agent.IGNORE_SUFFIX.contains(operationName.substring(suffixIdx))) {
@@ -108,6 +108,12 @@ public class ContextManager implements TracingContextListener, BootService, Igno
        return span;
    }

    public static AbstractSpan createExitSpan(String operationName, String remotePeer) {
        AbstractTracerContext context = getOrCreate(operationName, false);
        AbstractSpan span = context.createExitSpan(operationName, remotePeer);
        return span;
    }

    public static void inject(ContextCarrier carrier) {
        get().inject(carrier);
    }
Loading