Instrument ingress-nginx

The instructions below are relevant only for the official Kubernetes ingress controller implementation from Google.

The NGINX process of the official Kubernetes ingress-nginx controller container image can't be instrumented automatically. To manually instrument ingress-nginx on Kubernetes, follow the instructions below.

Prerequisites

  • OneAgent version 1.227+

Instrument Kubernetes ingress-nginx

To instrument ingress-nginx on Kubernetes, you need to load the NGINX module manually via a ConfigMap.

OneAgent needs to be running when the ingress-nginx ConfigMap changes are being applied, otherwise NGINX won't start.

  1. Edit the ConfigMap.

    kubectl edit configmap ingress-nginx-controller
  2. Add the following value to the main-snippet key (below data).

    Example:

    data:
    main-snippet: load_module /opt/dynatrace/oneagent/agent/bin/current/linux-musl-x86-64/liboneagentnginx.so;

    For cloudNativeFullStack deployments, the path becomes:

    data:
    main-snippet: load_module /opt/dynatrace/oneagent-paas/agent/bin/current/linux-musl-x86-64/liboneagentnginx.so;

Verify your configuration

If your pod isn't up and running, make sure that it hasn't exceeded either of the following:

  • Its resource quota (especially for memory).
  • The initial liveness/readiness probe timeouts. You might need to increase initialDelaySeconds for these probes.