With open source NGINX 1.9.11, dynamic module loading via load_module was introduced. Please note that the classic agent does not support this feature and will cause crashes. Dynamic modules are not supported by Classic Agent and requires to switch the agent platform.

Activate the NGINX Agent

As NGINX offers no user-facing API for interfacing with its functionality programmatically, the NGINX Agent needs to be started in a somewhat non-typical way. The following factors are involved:

A file containing addresses (offsets) of specific functions and data fields within the NGINX binary.

Manual load of the Agent library into NGINX process memory using system LD_PRELOAD functionality.

Offset file

The offsets file contains the instrumentation information which is used at Agent startup to instrument the NGINX binary. In most situations, the Agent generates the file at startup.

Classic Agent
Certain circumstances require manual file generation and the Agent writes an appropriate script to disk to request the user to execute it from command line.

Loading the agent at NGINX startup

The NGINX Agent starts by preloading. You need to set the environment variable LD_PRELOAD in the NGINX startup script:

LD_PRELOAD=/opt/dynatrace-7.0/agent/lib64/libdtagent.so nginx

Make sure to use the Agent library matching the bitness of your NGINX: one from the lib directory for 32-bit NGINX or one from lib64 for 64-bit NGINX.

The agent looks for configuration, including the offset file, in ../conf/ starting from its location on disk. Logs are typically written to ../logs/, although this can be changed in dtwsagent.ini located in the configuration directory.