IBM Support

IBM MQ Tracing Technical Preview 2021.2.0 (2021.2.0-IBM-MQ-TRACING-USER-EXITS)

Fix Readme


Abstract

The document describes how to install and enable IBM MQ tracing on your IBM MQ hosts, the tracing data can be sent to Instana or Jaeger depending on the configurations.
Update Name/Fix ID: 2021.2.0-IBM-MQ-TRACING-USER-EXITS

Content

Download location

IMPORTANT NOTE: To download this update, you must first log in to IBM Fix Central using the following link. After you log in, you can select from the individual download packages. When selecting fixes, ensure that your download options are set to "Include requisites: Yes". 
http://www.ibm.com/support/fixcentral/

Fix Download for Linux

The following is a list of components, platforms, and file names that apply to this Readme file.
Product / Component Name Platform Fix
IBM MQ Tracing User Exits Linux x86_64 2021.2.0-IBM-MQ-TRACING-USER-EXITS

Prerequisites and co-requisites

General description

This is a technical preview for enabling IBM MQ tracing capability. You can download user exits implementation and configure your IBM MQ server to enable tracing for messages. The tracing data is sent to Instana or Jaeger depending on your configuration.

Platforms and prerequisites 

This component supports Linux x86_64 only, and will support more platforms in the future. 
Instana and Jaeger are supported tracing systems. If you choose to send tracing data to Instana, you must have Instana host agent installed on your IBM MQ hosts. Follow https://www.instana.com/docs/setup_and_manage/host_agent/on/linux to install and run Instana Host Agent on Linux platform.
Only IBM MQ messages that include an MQRFH2 header or message properties are supported.
IBM MQ Server and queue managers must be installed and configured before installing and configuring this component.

Known issues

None.

Installing

1. Download the package from FixCentral to your IBM MQ server host, the package includes the following three files.
  • mqtracingexit_r, the IBM MQ user exits, intercepting the IBM MQ API calls and invoking the wrapped go jaeger client library to create spans.
  • tracelibrary.so, the wrapped go jaeger client, provides functions to manage the lifecycle of spans and sends spans to the target tracing system.
  • mqtracingexit.conf, the configuration file to specify the target tracing system (Jaeger or Instana) and the parameters for span generation.
2. Extract tar file into /var/mqm/exits64 directory on your IBM MQ server.

Configuring

This section describes how to configure your IBM MQ to enable tracing, including two parts - Configuring user exits and Configuring IBM MQ tracing.

Configuring user exits

You need to edit mqs.ini or qm.ini file to configure user exits. The mqs.ini file contains information relevant to all the queue managers on a particular node, the mqs.ini file is located at /var/mqm on Linux platform. The qm.ini file contains information relevant to a specific queue manager. The qm.ini file is located at /var/mqm/qmgrs/<QMNAME> on Linux platform.

Follow steps to enable tracing for all the queue managers on a particular node

1. Backup /var/mqm/mqs.ini file.
2. Edit /var/mqm/mqs.ini file.

Add the following content to enable user exits for all queue managers on this node. When any queue manager starts, the attributes in this stanza are read, and then overridden by the user exits defined in qm.ini.

ApiExitCommon:
   Sequence=100
   Function=EntryPoint
   Module=/var/mqm/exits64/mqtracingexit
   Name=TracingApiExit

Follow steps to enable tracing for a particular queue manager or you want to change user exits settings for a particular queue manager.

1. Backup /var/mqm/qmgrs/<QMNAME>/qm.ini file.
2. Edit /var/mqm/qmgrs/<QMNAME>/qm.ini.

Add the following content:

ApiExitLocal:
   Sequence=100
   Function=EntryPoint
   Module=/var/mqm/exits64/mqtracingexit
   Name=TracingApiExit

Where:

  • Sequence identifies the sequence of this exit in relation to other exits. An exit with a low sequence number is called before an exit with a higher sequence number.
  • Function identifies the name of the function entry point into the module containing the user exits code.
  • Module contains the user exits code. If this field contains the full path name of the module, it is used as is. If this field contains only the module name, the module is located using the ExitsDefaultPath attribute in the ExitPath in qm.ini.
  • Name is the descriptive name of the user exits.

See more information at Configuring API exits in IBM MQ document library.

You need to save changes to the configuration files and restart queue managers to make changes taking effect.

Configuring IBM MQ tracing

1. Go to /var/mqm/exits64 directory.

2. Edit mqtracingexit.conf file.

# configuration for MQ exit
LOG_LEVEL="info" #Log level: info, warn, error, debug
SPAN_FORMAT="jaeger" #specify opentracing span format as instana or jaeger
JAEGER_ENDPOINT = "http://<jaeger_collector_host>:14268/api/traces"
JAEGER_SAMPLER_TYPE = "const"
JAEGER_SAMPLER_PARAM = 1.0

Where:

  • LOG_LEVEL specifies the log level, which can be one of infowarnerror and debug, the log file is located at /var/mqm/trace directory on Linux platform.
  • SPAN_FORMAT specifies where the span data is sent to. The SPAN format can be set to instana or jaeger. If SPAN_FORMAT is set to instana, span data is sent to Instana (This requires Instana Host Agent running on the same node), ApiExit code auto-connects to localhost:42699, in such a case you can ignore JAEGER_* parameters in mqtracingexit.conf file. If SPAN_FORMAT is set to jaeger, you need to configure JAEGER_* parameters. You should have the  same SPAN_FORMAT setting for all IBM MQ nodes.
  • JAEGER_ENDPOINT specifies jaeger collector endpoint.
  • JAEGER_SAMPLER_TYPE specifies the sample type. The value can be one of constprobabilisticratelimiting and remote.
  • JAEGER_SAMPLER_PARAM is interpreted based on the value of JAEGER_SAMPLER_TYPE. See more details at https://www.jaegertracing.io/docs/1.22/sampling/#client-sampling-configuration.
3. Save the file and restart queue managers.
Repeat installation and configuration steps on other IBM MQ nodes that you want to enable tracing.
You can view IBM MQ tracing data on Instana UI or Jaeger UI depending on the SPAN_FORMAT settings in mqtracingexit.conf file.

Unconfiguring

1. Remove the ApiExitCommon and ApiExitLocal stanzas that you configured in /var/mqm/mqs.ini file and /var/mqm/qmgrs/<QMNAME>/qm.ini file from the IBM MQ hosts that you enabled tracing.
2. Restart the queue managers.
3. Repeat steps on other IBM MQ nodes.

Troubleshooting

The log files are located at /var/mqm/trace on Linux platform, the file name is mqExit*.log. 
You can set log level in mqtracingexit.conf as described in Configuring IBM MQ tracing section.

Additional information

The Secure Hash Algorithm 1 (SHA256) checksum of the tar file is 
ea1181286188faf200b107f02b670aac17c1cfcc92f1a505eabf3b268cff30cb

Document change history

Version Date Description of change
1.0 1 June 2021 Initial Version

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSVJUL","label":"IBM Application Performance Management"},"Component":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"8.1.4","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
09 June 2021

UID

ibm16459053