Deploy the Dynamic Languages Proxy

The Dynamic Languages Proxy acts as a communication gateway between the Python Agent running in the application process and the AppDynamics Controller.

You can use one of two available options to deploy the Dynamic Languages Proxy, either the:

  • Sidecar Container (recommended): This option follows the best practice of one process per container. The Dynamic Language Proxy runs in a sidecar container separate from the application container, or
  • Application Container: This option uses the default configuration to run the proxy in the same container as the application.

Deploy Dynamic Languages Proxy in a Sidecar Container

AppDynamics recommends following the best practice of maintaining one process per container.
  1. To use a sidecar container to run the Dynamic Languages Proxy, add the --use-manual-proxy parameter when starting the Python application.
    pyagent run --use-manual-proxy python ./app.py
    The --use-manual-proxy parameter prevents the Python Agent agent from starting the Dynamic Languages Proxy as a separate process in the same application container, which is the default behavior.
  2. Configure the deployed sidecar container to run the proxy.
    This Kubernetes deployment spec snippet shows how to define a second container named proxy that uses the dl-proxy image published on Docker Hub.
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: mypython-app
    spec:
    <...>
    spec:
    containers:
    - name: mypython-app
    image: myrepo/python-app-with-appd:v1
    <...>
    - name: proxy
    image: docker.io/appdynamics/dl-proxy:latest
    imagePullPolicy: Always
    env:
    - name: APPDYNAMICS_DEBUG_LOG
    value: "on"
    - name: APPDYNAMICS_LOGGING_LEVEL
    value: "debug"
    - name: APPDYNAMICS_TCP_COMM_HOST
    value: "0.0.0.0"
    - name: APPDYNAMICS_TCP_COMM_PORT
    value: "9091"
    - name: APPDYNAMICS_TCP_PORT_RANGE
    value: "10000-10100"
    ports:
    - containerPort: 9091
    protocol: TCP
    resources:
    ...

Deploy Dynamic Languages Proxy in the Application Container

If you prefer to run the proxy as a separate process in the same container as the application, omit the --use-manual-proxy parameter when starting the Python application.

pyagent run python ./app.py

The Python Agent automatically starts a separate process for the proxy in the same container. Avoid adding a sidecar container to the deployment so only the application container is defined.