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. The current version of IBM MQ Tracing user exits is 2023.2.1. The version information can be found in the configuration file of IBM MQ Tracing user exits.
Update Name/Fix ID: IBM-MQ-TRACING-USER-EXITS
Content
Download location
- To download this update, use
_
as the username and a valid Instana agent key as the password.
Fix Download for Multiple Platforms
Product / Component Name | Platforms | Fix |
IBM MQ Tracing User Exits |
AIX pSeries
Linux x86_64 Linux ppc64le Linux s390x Windows x86_64 |
IBM-MQ-TRACING-USER-EXITS |
Prerequisites and co-requisites
This fix provides tracing capability for IBM MQ messages. You can download IBM MQ Tracing 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
You can use Instana AutoTrace WebHook to this component in IBM Cloud Pak for Integration (amd64 only). You don't need to install the MQ tracing user exits manually in the Cloud Pak for Integration environment. For more information about how to enable tracing for container MQ that runs in Cloud Pak for Integration, see Instana AutoTrace webhook documentation.
MONITOR_LEVEL
to debug
in the configuration file of IBM MQ Tracing user exits.Known issues
Installing
mqtracingexit_r
(Linux and AIX) / mqtracingexit.dll (Windows): The IBM MQ user exits, which intercept the IBM MQ API calls and invokes the wrapped OpenTelemetry C++ client library to create spans.- tracelibrary.so (Linux and AIX) / tracelibrary.dll (Windows): The wrapped OpenTelemetry C++ client, which 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.
Configuring
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 qm.ini file contains information relevant to a specific queue manager. The mqs.ini file is located at /var/mqm on Linux and AIX, on Windows it is located in C:\ProgramData\IBM\MQ. The qm.ini file is located at /var/mqm/qmgrs/<QMNAME>
on Linux and AIX, on Windows it is located in C:\ProgramData\IBM\MQ\qmgrs\<QMNAME>
.
Complete the following steps to enable tracing for all the queue managers on a particular node:
/var/mqm/mqs.ini
file on Linux and AIX, or backup C:\ProgramData\IBM\MQ\mqs.ini on Windows.the 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.
Linux and AIX:
ApiExitCommon:
Sequence=100
Function=EntryPoint
Module=/var/mqm/exits64/mqtracingexit
Name=TracingApiExit
Windows:
ApiExitCommon:
Sequence=100
Function=EntryPoint
Module=C:\ProgramData\IBM\MQ\exits64\mqtracingexit
Name=TracingApiExit
Complete the following steps to enable tracing for a particular queue manager or to change user exits settings for a particular queue manager.
/var/mqm/qmgrs/<QMNAME>/qm.ini
file on Linux and AIX, or backup C:\ProgramData\IBM\MQ\qmgrs\<QMNAME>
\qm.ini file on Windows
.qm.ini.
Add the following content on Linux and AIX:
ApiExitLocal:
Sequence=100
Function=EntryPoint
Module=/var/mqm/exits64/mqtracingexit
Name=TracingApiExit
Add the following content on Windows:
ApiExitCommon:
Sequence=100
Function=EntryPoint
Module=C:\ProgramData\IBM\MQ\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 by using the ExitsDefaultPath attribute in the ExitPath in qm.ini.Name
is the descriptive name of the user exits.
For more information, see Configuring API exits in IBM MQ document library.
You need to save changes to the configuration files, and restart queue managers for the changes to take effect.
Configuring IBM MQ tracing
2. Edit mqtracingexit.conf file.
LOG_LEVEL="info" #Log level: info, warn, error, debug
SPAN_FORMAT="instana" #specify opentracing span format as instana or jaeger
MONITOR_LEVEL="normal" #MQ tracing level: normal, quiet, off, debug
JAEGER_ENDPOINT = "http://127.0.0.1:14268/api/traces"
JAEGER_SAMPLER_TYPE = "const"
JAEGER_SAMPLER_PARAM = 1.0
IBMMQ_PUBSUB_SUPPORT = "off" #The switch for the publish/subscribe support: on, off.
#IBMMQ_RFH2_HEADERS_TO_EXPOSE = "" #A list of message headers that should be included in the span payload, with each header separated by commas.
#JAEGER_AGENT_HOST = "127.0.0.1"
#JAEGER_AGENT_PORT = 6831
#INSTANA_AGENT_HOST = "localhost" # instana agent host, localhost will be used by default
#INSTANA_AGENT_PORT = 42699 # instana agent port, 42699 will be used by default
#INSTANA_AGENT_PROTO = "http" # connection type between mq tracing exit and instana agent, http and https are supported, http will be used by default
#HOST_ALIAS="<YOUR-HOST-NAME>" # host name to match with instana agent configuration.yaml
Where:
LOG_LEVEL
specifies the log level, which can be one ofinfo, warn, error
anddebug
. The log files are located at /tmp/ibmmqtrace directory on Linux and AIX. The log files are located at C:\ProgramData\IBM\MQ\trace directory on Windows.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, IBM MQ Tracing user exits sends span data to the Instana host agent endpoint http://localhost:42699 by default. In such a case, you can ignore JAEGER_* parameters in mqtracingexit.conf file. Update the configuration items INSTANA_AGENT_HOST and INSTANA_AGENT_PROTO, if you want to send the span data to a remote host agent by using https protocol. If SPAN_FORMAT is set to Jaeger, you need to configure JAEGER_* parameters. In such a case, you can ignore INSTANA_* parameters. You must use the same SPAN_FORMAT setting for all IBM MQ nodes.- MONITOR_LEVEL specifies the tracing level of IBM MQ, which can be one of off, quiet, normal and debug. If MONITOR_LEVEL is set to off, no tracing data will be collected. If it is set to quiet, the trace correlation information will not be added to all the messages, but the messages can still be traced in the MQ server. If it is set to normal, the trace correlation information will be added to the messages with RFH2 headers or named properties, but will not be added to text messages. If it is set to debug, the trace correlation information will be added to all traced messages. If you encounter the MQRC_HEADER_ERROR (MQRC 2142) error in your message consumer application, you can resolve it by changing the MONITOR_LEVEL property to normal or quiet, or by changing the PROPCTL property of the message destination queues to NONE. Alternatively, you can modify your application to ignore the additional RFH2 header with trace correlation information added by Instana, to avoid the message header error.
JAEGER_ENDPOINT
specifies Jaeger collector endpoint. You can choose to send tracing data to Jaeger collector or to the Jaeger agent. If you want to send tracing data to Jaeger agent, comment this line and specify values for configuration item JAEGER_AGENT_HOST and JAEGER_AGENT_PORT.JAEGER_SAMPLER_TYPE
specifies the sample type. The value can be one of const, probabilistic, ratelimiting, or 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.- JAEGER_AGENT_HOST specifies Jaeger agent host.
- JAEGER_AGENT_PORT specifies Jaeger agent port.
- IBMMQ_PUBSUB_SUPPORT controls whether the support for tracing publish and subscribe messages is enabled. Set it to
'on'
to enable the support, and set it to'off'
to disable the support. - IBMMQ_RFH2_HEADERS_TO_EXPOSE specifies a list of message headers that should be included in the span payload, with each header separated by commas. For example, IBMMQ_RFH2_HEADERS_TO_EXPOSE="rfh2_folder1.header1, rfh2_folder2.header2, header3". To avoid creating a span size that is too large and negatively affecting overall performance, any message header with a size larger than 256 bytes will be truncated. Additionally, the total length of all collected message headers in a span cannot exceed 3K bytes. It is recommended that only the most important headers be configured for collection.
- INSTANA_AGENT_HOST specifies the agent host where the Instana format span data is sent to, and localhost is used by default. If you specify a remote agent host, you also need to add a line
http.listen=*
in<instana-agent-dir>/etc/instana/com.instana.agent.main.config.Agent.cfg
for the remote host agent first as the host agent is not reachable from other hosts by default. - INSTANA_AGENT_PORT specifies the port where the Instana agent is listening on, and 42699 is used by default. You only need to change the port when the agent is listening on another port.
- INSTANA_AGENT_PROTO specifies the connection type between IBM MQ tracing exits and the host agent.
http
andhttps
are supported, andhttp
is used by default. If you want to change it tohttps
, you need to follow https://www.ibm.com/docs/en/obi/current?topic=agent-host-configuration#setting-up-tls-encryption-for-agent-endpoint to secure the agent endpoint first. - HOST_ALIAS specifies a host alias for the span data collected by IBM MQ Tracing user exits, so we can link calls to IBM MQ to the infrastructure entity if the Queue Manager is also monitored by the IBM MQ sensor. The FQDN of IBM MQ host is used by default. The host alias value must match with the IBM MQ host specified in host agent configuration yaml. You only need to specify a host alias if the FQDN of IBM MQ host is not used in IBM MQ sensor configuration when the host agent is not on the local IBM MQ host. The IBM MQ sensor can discover the FQDN for the local Queue Managers.
Trace correlation
Upgrade
file on your Windows
IBM MQ server.Unconfiguring
ApiExitCommon
and ApiExitLocal
stanzas that you configured in /var/mqm/mqs.ini(
C:\ProgramData\IBM\MQ\mqs.ini)
file and /var/mqm/qmgrs/<QMNAME>/qm.ini
(C:\ProgramData\IBM\MQ\qmgrs\<QMNAME>\qm.ini
) file from the IBM MQ hosts that you enabled tracing.Troubleshooting
Additional information
ibm-mq-tracing-exits_aix_64bit.tar.gz:
ibm-mq-tracing-exits_xLinux_64bit.tar.gz:
f28ce46d624747fe0b61bffb72cf9bebfcaa2f495b972c27fa9dec05758192e5
Document change history
Version | Date | Description of change |
18.0 | 2 June 2023 | Updated IBM MQ Tracing user exits version to 2023.2.1. Fixed an unexpected MQ API exit error on AIX. |
17.0 | 8 May 2023 | Updated IBM MQ Tracing user exits version to 2023.2.0. Changed the length of the MQ message header X_INSTANA_T that contains the Instana trace ID to 16 characters in length. |
16.0 | 27 Mar 2023 | Updated IBM MQ Tracing user exits version to 2023.1.1. Added support for displaying message headers on Instana UI. Added support for environment variable INSTANA_SERVICE_NAME. Changed the default value of configuration item IBMMQ_PUBSUB_SUPPORT to off. |
15.0 | 27 Feb 2023 | Updated IBM MQ Tracing user exits version to 2023.1.0. Added support for tracing publish/subscribe messages. Added a new monitor level 'quiet' to prevent trace context propagation. Fixed the service name extraction issue in Instana when the MQ server name contains the character "-". |
14.0 | 2 Dec 2022 | Updated IBM MQ Tracing user exits version to 2022.4.3. Added support for Windows 64. Fixed the correlation issue with the ACE OpenTelemetry trace. |
13.0 | 22 Nov 2022 | Updated IBM MQ Tracing user exits version to 2022.4.2. Fixed the log file permission issue in the environment where both MQ and ACE are installed. Moved the log files of IBM MQ tracing user exit to the directory /tmp/ibmmqtrace. Removed the unexpected message headers from the messages to ACE system queues. Fixed the issue of the unexpected API exit error (reason code 2374) in MQ error logs. |
12.0 | 10 Nov 2022 | Updated IBM MQ Tracing user exits version to 2022.4.1, upgraded the OpenSSL version to 1.1.1s in trace library. |
11.0 | 1 Nov 2022 | Updated IBM MQ Tracing user exits version to 2022.4.0, added support for W3C trace context when the span format is instana. |
10.0 | 30 Sep 2022 | Updated IBM MQ Tracing user exits version to 2022.3.4, added support for non-default Instana agent port. |
9.0 | 22 Sep 2022 | Updated IBM MQ Tracing user exits version to 2022.3.1, added support for AIX 7.3. |
8.0 | 27 July 2022 | Updated IBM MQ Tracing user exits version to 2022.3.0, added support for Linux ppc64le. |
7.0 | 22 June 2022 | Updated IBM MQ Tracing user exits version to 2022.2.2, added support for monitoring level debug. |
6.0 | 3 June 2022 | Updated IBM MQ Tracing user exits version to 2022.2.1, added support for container IBM MQ in CP4I. |
5.0 | 12 May 2022 | Updated IBM MQ Tracing user exits version to 2022.2.0, added support for Linux s390x. |
4.0 | 8 Apr 2022 | Updated IBM MQ Tracing user exits version to 2022.1.1, added support for AIX 7.2. |
3.0 | 17 Mar 2022 | Updated IBM MQ Tracing user exits version to 2022.1.0. |
2.0 | 18 Nov 2021 | Updated IBM MQ Tracing user exits version to 2021.4.0. |
1.0 | 27 Aug 2021 | Initial Version. |
Was this topic helpful?
Document Information
Modified date:
05 June 2023
UID
ibm16484595