The WildFly integration collects WildFly logs and parses them into a JSON payload. The result includes source, message code, level, and message.
For more information about WildFly, see wildfly.org/.
Prerequisites
To collect and ingest WildFly logs, you must install Ops Agent version 2.12.0 or higher.
This receiver supports WildFly versions 25.x and 26.x.
Configure your WildFly instance
To expose the JMX endpoint remotely, you must set the
jboss.bind.address.management
system property. By default, this property is
set in WildFly's configuration. The default WildFly installation requires no JMX
authentication with JMX exposed locally on 127.0.0.1:9990
.
To collect session metrics, you must enable statistics on the undertow subsystem by running the following command using the JBoss CLI:
/subsystem=undertow:write-attribute(name=statistics-enabled,value=true)
Configure the Ops Agent for WildFly
Following the guide for Configuring the Ops Agent, add the required elements to collect logs from your WildFly instances, and restart the agent.
Example configuration
The following command creates the configuration file to collect and ingest logs for WildFly and restarts the Ops Agent on Linux.
sudo tee /etc/google-cloud-ops-agent/config.yaml > /dev/null << EOF
logging:
receivers:
wildfly_system:
type: wildfly_system
service:
pipelines:
wildfly_system:
receivers:
- wildfly_system
metrics:
receivers:
wildfly:
type: wildfly
service:
pipelines:
wildfly:
receivers:
- wildfly
EOF
sudo service google-cloud-ops-agent restart
Configure logs collection
To ingest logs from WildFly, you must create receivers for the logs WildFly
produces and then create a pipeline for the new receivers. To configure a
receiver for your wildfly_system
logs, specify the following fields:
Field | Default | Description |
---|---|---|
type |
The value must be wildfly_system . |
|
include_paths |
[/opt/wildfly/standalone/log/server.log, /opt/wildfly/domain/servers/*/log/server.log] |
A list of filesystem paths to read by tailing each file. A wild card (* ) can be used in the paths; for example, /var/log/wildfly*/*.log . |
exclude_paths |
A list of filesystem path patterns to exclude from the set matched by include_paths . |
|
record_log_file_path |
false |
If set to true , then the path to the specific file from which the log record was obtained appears in the output log entry as the value of the agent.googleapis.com/log_file_path label. When using a wildcard, only the path of the file from which the record was obtained is recorded. |
wildcard_refresh_interval |
60s |
The interval at which wildcard file paths in include_paths are refreshed. Given as a time duration, for example 30s or 2m . This property might be useful under high logging throughputs where log files are rotated faster than the default interval. Must be a multiple of 1s. |
What is logged
The logName
of the wildfly_system
logs are derived from the receiver IDs
specified in the configuration. Detailed fields inside the
LogEntry
are as follows.
Field | Type | Description |
---|---|---|
timestamp |
string (Timestamp ) |
Time the request was received. |
jsonPayload.thread |
string | Thread where the log originated. |
jsonPayload.source |
string | Source where the log originated. |
jsonPayload.messageCode |
string | Wildfly-specific message code preceding the log, where applicable. |
jsonPayload.message |
string | Log message. |
severity |
string (LogSeverity ) |
Log entry level (translated). |
Log entries don't contain any fields that are blank or missing.
Configure metrics collection
To collect metrics from WildFly, you must create a receiver for WildFly metrics and then create a pipeline for the new receiver. To configure a receiver for your WildFly metrics, specify the following fields:
Field | Default | Description |
---|---|---|
type |
This value must be wildfly . |
|
endpoint |
service:jmx:remote+http://localhost:9990 |
The JMX Service URL or host and port used to construct the service URL. This value must be in the form of host:port , which is used to create a service URL of service:jmx:remote+http://<host>:<port>/jmxrmi . |
username |
The configured username if JMX is configured to require authentication. | |
password |
The configured password if JMX is configured to require authentication. | |
collection_interval |
60s |
A time.Duration value, such as 30s or 5m . |
additional_jars |
/opt/wildfly/bin/client/jboss-client.jar |
The path to the jboss-client.jar file, which is required to monitor WildFly through JMX. |
What is monitored
The following table provides the list of metrics that the Ops Agent collects from the WildFly instance.
Metric type | |
---|---|
Kind, Type Monitored resources |
Labels |
workload.googleapis.com/wildfly.jdbc.connection.open
|
|
GAUGE , INT64 gce_instance |
data_source state
|
workload.googleapis.com/wildfly.jdbc.request.wait
|
|
CUMULATIVE , INT64 gce_instance |
data_source
|
workload.googleapis.com/wildfly.jdbc.rollback.count
|
|
CUMULATIVE , INT64 gce_instance |
cause
|
workload.googleapis.com/wildfly.jdbc.transaction.count
|
|
CUMULATIVE , INT64 gce_instance |
|
workload.googleapis.com/wildfly.network.io
|
|
CUMULATIVE , INT64 gce_instance |
listener server state
|
workload.googleapis.com/wildfly.request.count
|
|
CUMULATIVE , INT64 gce_instance |
listener server
|
workload.googleapis.com/wildfly.request.server_error
|
|
CUMULATIVE , INT64 gce_instance |
listener server
|
workload.googleapis.com/wildfly.request.time
|
|
CUMULATIVE , INT64 gce_instance |
listener server
|
workload.googleapis.com/wildfly.session.active
|
|
GAUGE , INT64 gce_instance |
deployment
|
workload.googleapis.com/wildfly.session.count
|
|
CUMULATIVE , INT64 gce_instance |
deployment
|
workload.googleapis.com/wildfly.session.expired
|
|
CUMULATIVE , INT64 gce_instance |
deployment
|
workload.googleapis.com/wildfly.session.rejected
|
|
CUMULATIVE , INT64 gce_instance |
deployment
|
Sample dashboard
You can view the metrics from this integration using a sample Cloud Monitoring dashboard. Complete the Installing sample dashboards procedures to import the WildFly GCE Overview dashboard from the Sample library and view charts that display your WildFly metrics.Verify the configuration
You can use the Logs Explorer and Metrics Explorer to verify that you correctly configured the WildFly receiver. It might take one or two minutes for the Ops Agent to begin collecting logs and metrics.
To verify the logs are ingested, go to the Logs Explorer and run the following query to view the WildFly logs:
resource.type="gce_instance"
logName=("projects/PROJECT_ID/logs/wildfly_system")
To verify the metrics are ingested, go to Metrics Explorer and run the following query in the MQL tab.
fetch gce_instance
| metric 'workload.googleapis.com/wildfly.request.count'
| align rate(1m)
| every 1m
What's next
For a walkthrough on how to use Ansible to install the Ops Agent, configure a third-party application, and install a sample dashboard, see the Install the Ops Agent to troubleshoot third-party applications video.