> ## Documentation Index
> Fetch the complete documentation index at: https://docs.germainux.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring Monitoring and Automation for Java with GermainUX

> Once the GermainUX Java Agent or Engine is deployed, configure monitoring scope, data collection, analytics, alerts, and automation for Java.

Components
[`Agent`](https://docs.germainux.com/main/germainux-agent)
[`Engine`](https://docs.germainux.com/main/germain-ux-engine)

Availability
2022.1 or later

> **[Configure the Java Agent](#configure-the-java-agent)**
>
> Per-app agent.properties control

> **[JVM & Process Monitoring](#jvm-&-process-monitoring)**
>
> JVM health and processes

> **[Configure Custom Method Monitoring](#configure-custom-method-monitoring)**
>
> Instrument app-specific methods

> **[Validate the Configuration](#validate-the-configuration)**
>
> Expand after initial validation

## Overview

Once the GermainUX Java Agent and/or Engine is deployed, configure the monitoring scope, data collection, analytics, alerts, and automation appropriate for your Java environment.

GermainUX configuration can range from lightweight JVM health monitoring to deep transaction, database, API, code-level, user-impact, and business-process analysis.

## Configure the Java Agent

Java Agent capabilities are controlled through the application's `agent.properties` file.

Monitoring can be enabled or disabled individually, allowing each Java application to collect only the telemetry required for its use case.

## HTTP Monitoring

GermainUX can monitor inbound application requests and outbound HTTP calls.

Enable inbound Servlet monitoring and outbound HTTP monitoring:

```text theme={null}
agent.feature.servlet.enabled=true
agent.feature.outboundHttp.enabled=true
```

Monitoring can capture information such as:

* URL
* HTTP method
* Response code
* Response time
* Payload size
* Outbound target
* Transaction failures

### Session Correlation

HTTP session ID collection can be enabled when session-level correlation is required:

```text theme={null}
agent.feature.servlet.collectSessionId=true
```

For web-based Java applications, this can help correlate backend transactions with user activity and workflows monitored by GermainUX.

### JDBC / SQL Monitoring

Enable JDBC monitoring:

```text theme={null}
agent.feature.jdbc.enabled=true
```

GermainUX can capture:

* SQL statement
* Execution time
* Error state
* Slow database activity
* Database impact on application transactions

Low-value or repetitive SQL statements such as health checks can be excluded:

```sql theme={null}
agent.feature.jdbc.exclusions.0=SELECT 1 FROM DUAL
agent.feature.jdbc.exclusions.1=SELECT @@session.tx_isolation
```

Additional exclusions can be added using sequential indexes.

## JMS Monitoring

Enable JMS monitoring:

```text theme={null}
agent.feature.jms.enabled=true
```

GermainUX can monitor:

* Destination
* Inbound/outbound direction
* Processing time
* Errors

Message-body collection can be disabled when messages contain sensitive information or when payload size could create unnecessary overhead:

```text theme={null}
agent.feature.jms.collectMessageBody=false
```

Always review data-privacy requirements before collecting message content.

## Elasticsearch Monitoring

Elasticsearch monitoring is available but disabled by default.

Enable it with:

```text theme={null}
agent.feature.es.enabled=true
```

GermainUX can monitor Elasticsearch REST activity including:

* Index
* Operation
* Response time

## JVM & Process Monitoring

Enable JVM/process metrics:

```text theme={null}
agent.feature.processMetrics.enabled=true
agent.feature.processMetrics.interval=60
```

GermainUX can collect JVM metrics such as:

* Heap memory
* Non-heap memory
* Garbage collection activity
* Thread counts and states
* Heap histograms

Heap histogram collection can be disabled independently:

```text theme={null}
agent.feature.processMetrics.heapHistogram=false
```

Adjust the collection interval based on the required monitoring granularity and acceptable overhead.

### Thread Pool Monitoring

Enable thread-pool monitoring:

```text theme={null}
agent.feature.threadPool.enabled=true
```

GermainUX can monitor thread-pool activity to identify capacity constraints and thread starvation.

Specific metrics can be selected when required:

```text theme={null}
agent.feature.threadPool.metrics.0=PoolSize
agent.feature.threadPool.metrics.1=ActiveCount
```

## Connection Pool Monitoring

Enable connection-pool monitoring:

```text theme={null}
agent.feature.connectionPool.enabled=true
```

GermainUX can monitor:

* Active connections
* Idle connections
* Waiting threads
* Wait time
* Pool exhaustion

Dedicated HikariCP monitoring is also available:

```text theme={null}
agent.feature.connectionPool.hikari=true
```

Specific metrics can be selected:

```text theme={null}
agent.feature.connectionPool.metrics.0=WaitTime
```

## Configure CPU Profiling

GermainUX's CPU Profiler uses stack sampling to identify CPU-intensive code paths while minimizing application overhead.

Enable CPU profiling:

```text theme={null}
agent.feature.cpuProfiling.enabled=true
```

Configure the sampling window:

```text theme={null}
agent.feature.cpuProfiling.duration=60
agent.feature.cpuProfiling.interval=10000
```

Results can be analyzed in GermainUX using visualizations such as flame graphs and transaction waterfalls.

### Limit Profiling Scope

Exclude framework or low-value packages:

```text theme={null}
agent.feature.cpuProfiling.blacklist=org.hibernate,org.apache.catalina
```

Or restrict profiling to your application code:

```text theme={null}
agent.feature.cpuProfiling.whitelist=com.mycompany.myapp
```

Use filtering to reduce noise, data volume, and monitoring overhead.

### On-Demand CPU Profiling

CPU profiling can also be controlled at runtime through JMX:

```text theme={null}
com.germainsoftware:type=ProfilerAgent
```

This allows profiling to be activated for a specific workload without restarting the JVM.

## Configure Custom Method Monitoring

GermainUX can instrument application-specific Java methods, classes, or packages that are not covered by standard HTTP, JDBC, JMS, or other built-in monitoring.

Enable method monitoring:

```text theme={null}
agent.feature.method.enabled=true
```

### Monitor a Specific Method

```text theme={null}
agent.feature.method.0.path=com.mycompany.myapp.OrderService.processOrder
agent.feature.method.0.type=Java:ProcessOrder
```

### Monitor an Entire Class

```text theme={null}
agent.feature.method.1.path=com.mycompany.myapp.OrderService
agent.feature.method.1.type=Java:OrderService
```

#### Monitor a Package

```text theme={null}
agent.feature.method.2.path=com.mycompany.myapp.service
agent.feature.method.2.type=Java:Service
```

Package-level instrumentation should be used carefully because monitoring large numbers of methods can increase application overhead and telemetry volume.

## Configure Method-Level Data Collection

When required for troubleshooting, GermainUX can capture method arguments and return values:

```text theme={null}
agent.feature.method.0.includeArguments=true
agent.feature.method.0.includeReturnValue=true
```

Non-public methods can also be instrumented:

```text theme={null}
agent.feature.method.0.publicAccessOnly=false
```

Only enable these capabilities when necessary and after reviewing privacy, security, and performance requirements.

## Configure User & Transaction Correlation

For web-based applications, Java telemetry can be correlated with other GermainUX monitoring data to provide visibility across the complete user and application journey:

User Action
Browser
Java Transaction
API / Service
Database

This can help teams determine:

* Which backend transaction affected a user
* Which Java error caused a workflow to fail
* Which SQL call contributed to a slow transaction
* Which backend issue caused repeated user actions
* Which technical issue affected productivity, adoption, conversion, or abandonment

When GermainUX User Monitoring and Session Replay are deployed, backend insights can be combined with the actual user experience for faster root-cause analysis.

## Configure Data Privacy & Exclusions

Review all monitored data before enabling detailed instrumentation in production.

Depending on the application, this can include:

* SQL text
* HTTP/session information
* JMS messages
* Method arguments
* Return values
* User identifiers
* Business data

Configure exclusions or disable unnecessary data collection wherever sensitive information does not need to be monitored.

The objective should be to collect the information necessary for troubleshooting and analysis while minimizing unnecessary or sensitive data collection.

## Configure KPIs, Dashboards & Reports

Java telemetry collected by GermainUX can be analyzed through configurable real-time KPIs, dashboards, and automated reports.

Examples include:

* Application availability
* Error rate
* Response time
* JVM memory and garbage collection
* Slow transactions
* CPU hotspots

> **Show all 12**
>
> * Database performance
> * API performance
> * Connection-pool utilization
> * Thread-pool utilization
> * Business transaction performance
> * User impact

Dashboards and reports can combine Java telemetry with data from other GermainUX monitoring sources to provide application, user, process, and business context.

## Configure Alerts & SLAs

Configure alerts for conditions that require attention, such as:

* New Java errors
* Error-frequency increases
* Slow transactions
* JVM resource saturation
* Excessive garbage collection
* CPU hotspots

> **Show all 12**
>
> * Connection-pool exhaustion
> * Thread-pool saturation
> * Slow SQL
> * API failures
> * Application availability issues
> * SLA violations

Thresholds, frequency, time windows, recipients, and escalation logic can be customized according to operational requirements.

## Configure Automation

GermainUX can trigger automated actions when defined Java application conditions occur.

For example:

Detect
Analyze
Alert
Create Ticket
Trigger Action

Depending on the use case, automation can include:

* Alerts and notifications
* Ticket or incident creation
* Script execution
* Program / RPA execution
* HTTP calls
* SQL execution

> **Show all 10**
>
> * SSH execution
> * Scheduled actions
> * Custom workflows
> * Remediation actions

Automation can be triggered by technical conditions, SLA violations, user impact, business impact, or combinations of monitored events.

Use automated remediation selectively for well-understood and safely recoverable conditions.

## Tune Monitoring Overhead

Monitoring depth should match the diagnostic requirements of each environment.

For production environments:

1. Start with JVM metrics and critical transactions.
2. Enable HTTP, JDBC, pools, and other relevant integrations.
3. Add CPU profiling where deeper performance analysis is required.
4. Instrument specific business-critical methods when built-in monitoring does not provide sufficient visibility.
5. Avoid unnecessarily broad package-level instrumentation.
6. Adjust sampling and collection intervals where appropriate.
7. Review data volume and application overhead after configuration changes.

This progressive approach provides deep visibility where needed while minimizing unnecessary monitoring overhead.

## Validate the Configuration

After making configuration changes:

* Restart the JVM when required for instrumentation changes.
* Confirm that expected telemetry is being collected.
* Validate transaction and application naming.
* Confirm exclusions are working correctly.
* Review CPU and application overhead.
* Test alerts and SLA thresholds.

> **Show all 9**
>
> * Test automation actions in a non-production environment.
> * Validate user/backend correlation where applicable.
> * Confirm that sensitive data is not being collected unintentionally.

Progressively expand monitoring once the initial configuration has been validated.

## Get Help

> **[Contact GermainUX Support](https://docs.germainux.com/main/support.md)**
>
> The Germain Team can help you set this up.

> **Can't find what you need?**
>
> Search all GermainUX docs with **Ctrl + K**, or use the feedback buttons at the bottom of this page to tell us what is missing.

The content of this document is proprietary to GERMAIN SOFTWARE.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.