Config.java 2.6 KB
Newer Older
1
package org.skywalking.apm.agent.core.conf;
2

3 4
import org.skywalking.apm.agent.core.logging.LogLevel;
import org.skywalking.apm.agent.core.logging.WriterFactory;
5

wu-sheng's avatar
wu-sheng 已提交
6 7 8 9 10
/**
 * This is the core config in sniffer agent.
 *
 * @author wusheng
 */
11
public class Config {
12

13
    public static class Agent {
wu-sheng's avatar
wu-sheng 已提交
14 15 16 17
        /**
         * Application code is showed in sky-walking-ui.
         * Suggestion: set a unique name for each application, one application's nodes share the same code.
         */
18
        public static String APPLICATION_CODE = "";
Z
zhangxin10 已提交
19

wu-sheng's avatar
wu-sheng 已提交
20 21 22 23 24
        /**
         * One, means sampling OFF.
         * Greater than one, select one trace in every N traces.
         * Zero and negative number are illegal.
         */
25
        public static int SAMPLING_CYCLE = 1;
26
    }
A
ascrutae 已提交
27

28
    public static class Collector {
wu-sheng's avatar
wu-sheng 已提交
29 30 31 32 33 34
        /**
         * Collector REST-Service address.
         * e.g.
         * SERVERS="127.0.0.1:8080"  for single collector node.
         * SERVERS="10.2.45.126:8080,10.2.45.127:7600"  for multi collector nodes.
         */
35 36
        public static String SERVERS = "";

wu-sheng's avatar
wu-sheng 已提交
37 38 39
        /**
         * Collector receive segments REST-Service name.
         */
40
        public static String SERVICE_NAME = "/segments";
41

wu-sheng's avatar
wu-sheng 已提交
42 43 44
        /**
         * The max size to send traces per rest-service call.
         */
45
        public static int BATCH_SIZE = 50;
A
ascrutae 已提交
46
    }
A
ascrutae 已提交
47

48
    public static class Buffer {
wu-sheng's avatar
wu-sheng 已提交
49 50 51 52 53
        /**
         * The in-memory buffer size. Based on Disruptor, this value must be 2^n.
         *
         * @see {https://github.com/LMAX-Exchange/disruptor}
         */
54
        public static int SIZE = 512;
A
ascrutae 已提交
55
    }
56

57
    public static class Logging {
wu-sheng's avatar
wu-sheng 已提交
58 59 60
        /**
         * Log file name.
         */
61
        public static String FILE_NAME = "skywalking-api.log";
wu-sheng's avatar
wu-sheng 已提交
62 63 64 65 66 67 68

        /**
         * Log files directory.
         * Default is blank string, means, use "system.out" to output logs.
         *
         * @see {@link WriterFactory#getLogWriter()}
         */
69
        public static String DIR = "";
wu-sheng's avatar
wu-sheng 已提交
70 71 72 73 74

        /**
         * The max size of log file.
         * If the size is bigger than this, archive the current file, and write into a new file.
         */
75 76
        public static int MAX_FILE_SIZE = 300 * 1024 * 1024;

wu-sheng's avatar
wu-sheng 已提交
77 78 79 80 81
        /**
         * The log level. Default is debug.
         *
         * @see {@link LogLevel}
         */
82
        public static LogLevel LEVEL = LogLevel.DEBUG;
83
    }
B
baiyang 已提交
84 85 86

    public static class Plugin {
        public static class MongoDB {
B
baiyang 已提交
87 88 89 90 91 92 93
            /**
             * If true, trace all the parameters, default is false.
             * Only trace the operation, not include parameters.
             */
            public static boolean TRACE_PARAM = false;
        }
    }
A
ascrutae 已提交
94
}