- Scavenger is a combination of various server components(API, Frontend, Collector) and agent component. To install scavenger, you need JDK 21 or latest version.
- Scavenger uses 2 ports. if some ports are blocked by your firewall, you should ask the network admin to open the
following ports in the firewall.
These ports can be configured by the configuration.
- Agent: Any ===> Collector: This is dependent on your tomcat configuration. By default, it is set as 8080.
- Agent: Any ===> Collector: This is dependent on your grpc configuration. By default, it is set as 8080.
- API: This is dependent on your tomcat configuration. By default, it is set as 8081.
Download Collector from the following link. https://github.com/naver/scavenger/releases
Or, You can also build it by yourself.
- Build Scavenger manually from the Git clone.
- Run
./gradlew assemble -p scavenger-collector
Start Collector using the following command.
- e.g)
java -jar scavenger-collector.jar
You can override any configuration values with -D
option.
java -Darmeria.port=8080 -jar scavenger-collector.jar
To change the http(default 8080) and grpc(default 8080) ports used by Collector, you can change the settings below.
-Darmeria.port
: http, grpc uses 8080 by default
To change the max message size of gRPC in Collector, change the setting below.
-Darmeria.max-message-size
: 10MB by default- Supports
B
,KB
,MB
,GB
, andTB
units.
- Supports
The collector provides two profiles: h2
and local
(default)
The profile can be enabled with spring.profiles.active
configuration.
The collector uses in-memory H2 in local
profile.
This means that the data is initialised every time the collector application starts.
If you want to work around this using file mode, you can enable the h2
profile.
java -Dspring.profiles.active=h2 -jar scavenger-collector.jar
If you've built your own MySQL, follow the steps below.
- Install MySQL Server using the official MySQL guide.
- Log into MySQL Server.
- Create MySQL Database.
CREATE DATABASE scavenger;
- Use the
-D
option to set the following four properties.spring.profiles.active=mysql
spring.datasource.url={mysql url}
spring.datasource.username={mysql user name}
spring.datasource.password={mysql password}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
You can modify default configuration values or add new profiles under scavenger-collector/src/main/resources/
.
Download API from the following link. https://github.com/naver/scavenger/releases
Or, You can also build it by yourself.
- Build Scavenger manually from the Git clone.
- Run
./gradlew assemble -p scavenger-api
Start API using the following command.
When you start the API, you need to set the value scavenger.collector-server-url
with the -D
option so that the API
knows the collector's url.
- e.g)
java -Dscavenger.collector-server-url=http://localhost:8080 -jar scavenger-api-boot.jar
You can override any configuration values with -D
option.
java -jar scavenger-api-boot.jar
To change the http(default 8081) ports used by API, you can change the settings below.
server.port
: Tomcat uses 8081 by default
The API provides two profiles: h2
and local
(default)
The profile can be enabled with spring.profiles.active
configuration.
The API uses in-memory H2 in local
profile.
This means that the data is initialised every time the API application starts, and the data is independent of the collector because it is using a different h2 than the collector.
If you have enabled the h2 profile on the collector to work around this, you can enable the h2 profile on the API as well.
java -Dspring.profiles.active=h2 -jar scavenger-api-boot.jar
If you've built your own MySQL, follow the steps below.
If you have already deployed MySQL when installing collector, you can skip ahead to step 4.
- Install MySQL Server using the official MySQL guide.
- Log into MySQL Server.
- Create MySQL Database.
CREATE DATABASE scavenger;
- Use the
-D
option to set the following four properties.spring.profiles.active=mysql
spring.datasource.url={mysql url}
spring.datasource.username={mysql user name}
spring.datasource.password={mysql password}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
You can modify default configuration values or add new profiles under scavenger-api/src/main/resources/
.
- Download the latest version from
https://repo1.maven.org/maven2/com/navercorp/scavenger/scavenger-agent-java/{VERSION}/scavenger-agent-java-{VERSION}.jar
- You can find out what latest VERSION is in maven central
You can also build it yourself.
- Build Scavenger manually from the Git clone.
- Run
./gradlew assemble -p scavenger-agent-java
- By default, this is done using the
scavenger.conf
file. - It can also be configured via Java system properties and environment variables, but the agent is developed in such a
way that it will not work if the
scavenger.conf
file does not exist. - Therefore, it is recommended to use scavenger.conf as the default and only to override settings.
- The
scavenger.conf
can be set and downloaded via the UI.
- Example
scavenger.conf
apiKey=eb99ff0f-aaaa-bbbb-cccc-5d1ec81f6183
serverUrl=http://10.106.93.41:8081
environment=dev
appName=apiserver
codeBase=webapps/ROOT/WEB-INF
packages=com.navercorp
- Scavenger configuration
configuration | default | Description |
---|---|---|
enabled | true | |
apiKey (*) | ||
serverUrl (*) | ||
appName (*) | ||
packages (*) | ||
codeBase |
codeBase = /home1/irteam/service/tomcat/webapps/ROOT/WEB-INF . |
|
excludePackages | ||
annotations | ||
additionalPackages | ||
excludeByRegex | ||
additionalByRegex | ||
methodVisibility | protected | |
excludeConstructors | false | |
excludeGetterSetter | false | |
asyncCodeBaseScanMode | false | |
environment | ||
appVersion | unspecified | |
hostname | ||
debugMode | false | |
maxMethodsCount | 100000 |
- Setting up the agent via
-javaagent:path/to/scavenger-agent.jar
- Specify the config file via
-Dscavenger.configuration=path/to/scavenger.conf
- To change the max message size of gRPC in agent, change the setting below.
-Dscavenger.max-message-size
: 10MB by default- Supports
B
,KB
,MB
,GB
, andTB
units.
- Supports
We recommend tuning your codeBase configuration for minimizing tracing ranges before changing
scavenger.max-message-size
.
export JAVA_OPTS="$JAVA_OPTS -Dscavenger.configuration=$CATALINA_BASE/conf/scavenger.conf"
export JAVA_OPTS="$JAVA_OPTS -javaagent:/home1/irteam/scavenger-agent.jar"