Monitoring EJB calls

Configuration options for both tracing and monitoring EJB calls are convention used by all EJB-related extension scripts (eg. jboss-ejb.bsh for JBoss). Common parts of EJB configuration are implemented in ejb.bsh script.

EJB monitoring can provide the following information:

  • performance statistics for EJB calls;

  • contention statistics for EJB calls;

  • logging slow EJB calls and EJB errors;

  • trace EJB calls;

EJB support script also has capability of logging slow EJB calls and EJB errors. As it is integrated with traps.bsh script, standard properties like traps.slow, traps.error, traps.file etc. can be used to configure slow/error logs. See traps.bsh documentation for more details.

Configuration properties for EJB monitoring

Settings for EJB statistics:

  • ejb.stats = yes - monitor EJB statistics;

  • ejb.stats.mbean = zorka:type=ZorkaStats,name=EjbStats - object name of an mbean that will store EJB processing statistics;

EJB tracing:

  • ejb.trace = yes - enable or disable tracing of EJB requests;

  • ejb.trace.time - minimum EJB invocation time to be submitted;

  • ejb.trace.exclude = ** - comma-separated list of classes and methods that will be excluded (the same rules as for general tracer exclusions);

  • ejb.trace.include = ** - comma-separated list of classes and methods that will be included (the same rules as for general tracer inclusions);

Settings for EJB parameter processing:

  • ejb.params - enable EJB parameters processing;

  • ejb.params.include = - argument types to be serialized (only basic types and strings are serialized by default);

  • ejb.params.exclude = - argument types to be excluded from serialization (takes precedence over includes);

  • ejb.params.prefix - prefix for EJB arguments collected by tracer (valid only if both ejb.trace and ejb.params are enabled which is the case if tracer option is enabled);

Slow EJB invocation log:

  • ejb.slow = ${traps.slow} - enable or disable slow invocation log;

  • ejb.slow.time - minimum EJB invocation time;

  • ejb.slow.file.max - maximum slow log file size;

  • ejb.slow.file.num - maximum number of archived slow logs;

  • ejb.slow.file.path = ${zorka.log.dir}/ejb-slow.log - path to slow query log file;

  • ejb.slow.format = [${TIME}] ${CLASS}.${METHOD}(${PARAMS}) -> ${RET} - query log messages format;

EJB error log settings:

  • ejb.error = ${traps.error} - enable or disable EJB error log;

  • ejb.error.file = yes - enable or disable logging to a file;

  • ejb.error.file.max = 8M - maximum error log file size;

  • ejb.error.file.num = 8 - maximum number of archived error logs;

  • ejb.error.file.path = ${zorka.log.dir}/ejb-error.log - path to log file;

  • ejb.error.format = [${TIME}] ${CLASS}.${METHOD}(${PARAMS}) -> ${ERR} - query log messages format;

Zabbix templates

Templates described below have been created for mbeans generated by Zorka and should fit for all Java EE servers:

  • Template_Zorka_EJB.xml - general EJB statistics;

  • Template_Zorka_EJB_MessageHandling.xml - logs for slow EJB calls and EJB errors;