Skip to main content
Skip table of contents

Configure Code Profiling for Java

Here is details on how to configure Code Profiling for Java.

Each property described below is necessary to include as a line in a properties file if the desired setting is different than the default value. A minimal properties file includes the agent.url of the APM server, and *.enabled=true for the desired features. Logging functionality is there to assist advanced debugging and is not necessary to configure under normal circumstances.

Note: The agent properties file uses the Properties File Format, and as such, backslash (\) is an escape character, and lines starting with a pound sign (#) or exclamation mark (!) are ignored and can be used to comment out the line.

agent.*

TEXT
agent.application = My application's name
agent.numThreads  = 2
agent.runtimeJar  = C:\\germain\\agent\\apm-agent-runtime.jar
agent.url         = http://localhost:8080/ingestion/agent

Property name

Description

Default value

agent.application

The name of the application being monitored.

The auto-detected name of the application.

agent.numThreads

Number of threads used by the germain agent.

2

agent.runtimeJar

Path to apm-agent-runtime.jar.

The same path as the apm-agent.jar appended with /apm-agent-runtime.jar

agent.url

The URL of the APM server.

http://localhost:8080/ingestion/agent

agent.feature.*

TEXT
agent.feature.servlet.enabled = true
agent.feature.outboundHttp.enabled = true
agent.feature.jdbc.enabled = true
agent.feature.jms.enabled = true
agent.feature.processMetrics.enabled = true
agent.feature.processMetrics.interval = 60
agent.feature.cpuProfiling.enabled = true
agent.feature.method.enabled = true
agent.feature.method.0.path = com.packagename.ClassName.methodName
agent.feature.method.0.type = eventName0
agent.feature.method.1.path = com.packagename.ClassName.methodName
agent.feature.method.1.type = eventName1

Property name

Description

Default value

agent.feature.servlet.enabled

HTTP Servlet monitoring

false

agent.feature.outboundHttp.enabled

Outbound HTTP request monitoring

false

agent.feature.jdbc.enabled

JDBC SQL database monitoring

false

agent.feature.jms.enabled

JMS monitoring

false

agent.feature.processMetrics.enabled

Java process metrics

false

agent.feature.processMetrics.interval

Time between each sample (seconds)

60

agent.feature.cpuProfiling.enabled

CPU profiling

false

agent.feature.cpuProfiling.duration

Sampler duration (seconds)

60

agent.feature.method.enabled

Custom method monitoring

false

agent.feature.method.0.path

The fully qualified method name of the first method to be monitored.

agent.feature.method.0.type

A keyword to label this kind of event. Required for each corresponding path.

agent.feature.method.1.path

The fully qualified method name of a second method to be monitored.

agent.feature.method.1.type

A keyword to label this kind of event. Does not necessarily have to be distinct from other type values if it captures the same kind of event.

agent.feature.method...

Any number of methods can be monitored as long as they are numbered sequentially starting with 0.

agent.log.*

TEXT
agent.log.type = FILE
agent.log.level = DEBUG
agent.log.name = agent
agent.log.path = C:\\germain\\logs

Property name

Description

Default value

agent.log.type

NULL, FILE, CONSOLE

agent.log.level

ERROR, WARN, INFO, DEBUG, TRACE, NONE

NONE

agent.log.name

The prefix for log file names.

agent.log.path

Directory path for file logger.

agent.packages.*

TEXT
agent.packages.skiplist = java,javax,sun,com.germainsoftware.agent,com.mysql,com.zaxxer.hikari,oracle,org.apache,org.glassfish,org.springframework
agent.packages.blacklist = com.germainsoftware.agent

Property name

Description

Default value

agent.packages.skiplist

Comma-delimited list of Class packages that should be ignored when the agent is determining the application-level caller.

java,

javax,

sun,

com.germainsoftware.agent,

com.mysql,

com.zaxxer.hikari,

oracle,

org.apache,

org.glassfish,

org.springframework

agent.packages.blacklist

Comma-delimited list of Class packages whose Classes should never generate data as application-level callers.

com.germainsoftware.agent

agent.queue.*

TEXT
agent.queue.maxSize = 10000
agent.queue.batchSize = 500
agent.queue.threads = 2

Property name

Description

Default value

agent.queue.maxSize

The number of data points that will be held before dropping data from the APM Datamart queue.

10000

agent.queue.batchSize

The number of data points to send per batch.

500

agent.queue.threads

Threads used for submitting batches.

1

 

Component: Code Profiler

Feature Availability: 2022.1 or later

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.