Commit 54614a05 authored by kezhenxu94's avatar kezhenxu94 Committed by 吴晟
Browse files

Support gateway without agent (#3308)

* Support Gateway without agent
parent b3a2c647
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -27,6 +27,10 @@ pipeline {
        skipStagesAfterUnstable()
    }

    environment {
        MAVEN_OPTS = '-Dmaven.repo.local=.m2/repository -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -Xmx3g'
    }

    stages {
        stage('Install & Test') {
            parallel {
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ pipeline {
    }

    environment {
        MAVEN_OPTS = '-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -Xmx3g'
        MAVEN_OPTS = '-Dmaven.repo.local=.m2/repository -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -Xmx3g'
    }

    stages {
@@ -55,7 +55,7 @@ pipeline {

        stage('Compile Test Codes') {
            steps {
                sh './mvnw -f test/e2e/pom.xml clean'
                sh './mvnw -f test/e2e/pom.xml -pl e2e-base clean install'
            }
        }

+6 −25
Original line number Diff line number Diff line
@@ -23,13 +23,11 @@ import com.google.common.collect.Lists;
import org.apache.skywalking.apm.agent.core.conf.Config;
import org.apache.skywalking.apm.agent.core.conf.Constants;
import org.hamcrest.core.StringContains;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;

import java.io.PrintStream;
import java.util.List;

import static org.mockito.Matchers.anyString;
@@ -42,28 +40,20 @@ public class PatternLoggerTest {

    public static final String PATTERN = "%timestamp+0800 %level [%agent_name,,,] [%thread] %class:-1 %msg %throwable";

    private static PrintStream OUT_REF;
    private static PrintStream ERR_REF;

    @BeforeClass
    public static void initAndHoldOut() {
        OUT_REF = System.out;
        ERR_REF = System.err;
        Config.Agent.SERVICE_NAME = "testAppFromConfig";
    }


    @Test
    public void testLog() {
        PrintStream output = Mockito.mock(PrintStream.class);
        System.setOut(output);
        PrintStream err = Mockito.mock(PrintStream.class);
        System.setErr(err);
        final IWriter output = Mockito.mock(IWriter.class);
        PatternLogger logger = new PatternLogger(PatternLoggerTest.class, PATTERN) {
            @Override
            protected void logger(LogLevel level, String message, Throwable e) {
                String r = format(level, message, e);
                SystemOutWriter.INSTANCE.write(r);
                output.write(r);
            }
        };

@@ -84,19 +74,16 @@ public class PatternLoggerTest {
        logger.error(new NullPointerException(), "hello {}", "world");

        Mockito.verify(output, times(9))
                .println(anyString());
                .write(anyString());
    }

    @Test
    public void testLogWithSpecialChar() {
        PrintStream output = Mockito.mock(PrintStream.class);
        System.setOut(output);
        PrintStream err = Mockito.mock(PrintStream.class);
        System.setErr(err);
        final IWriter output = Mockito.mock(IWriter.class);
        PatternLogger logger = new PatternLogger(PatternLoggerTest.class, PATTERN) {
            @Override
            protected void logger(LogLevel level, String message, Throwable e) {
                SystemOutWriter.INSTANCE.write(format(level, message, e));
                output.write(format(level, message, e));
            }
        };

@@ -117,7 +104,7 @@ public class PatternLoggerTest {
        logger.error(new NullPointerException(), "hello {}", "&&&**%%");

        Mockito.verify(output, times(9))
                .println(anyString());
                .write(anyString());
    }

    @Test
@@ -156,10 +143,4 @@ public class PatternLoggerTest {
    }


    @AfterClass
    public static void reset() {
        System.setOut(OUT_REF);
        System.setErr(ERR_REF);
    }

}
+3 −1
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ system.
set the expired time for each dimension.
1. [Dynamic Configuration](dynamic-config.md). Make configuration of OAP changed dynamic, from remote service
or 3rd party configuration management system.
1. [Uninstrumented Gateways](uninstrumented-gateways.md). Configure gateways/proxies that are not supported by SkyWalking agent plugins,
to reflect the delegation in topology graph.

## Telemetry for backend
OAP backend cluster itself underlying is a distributed streaming process system. For helping the Ops team,
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ Right now, SkyWalking supports following dynamic configurations.
| Config Key | Value Description | Value Format Example |
|:----:|:----:|:----:|
|receiver-trace.default.slowDBAccessThreshold| Thresholds of slow Database statement, override `receiver-trace/default/slowDBAccessThreshold` of `applciation.yml`. | default:200,mongodb:50|
|receiver-trace.default.uninstrumentedGateways| The uninstrumented gateways, override `gateways.yml`. | not set |


This feature depends on upstream service, so it is **OFF** as default.
Loading