AppDynamics Proxy Support for Linux x64

11.86.0 · active · verified Fri Apr 17

This package provides platform-specific native (C/C++) extensions for proxy support and network communication for the AppDynamics Python Agent. It is an internal runtime dependency automatically managed by the main `appdynamics` agent package and is not intended for direct user interaction or import. The current version is 11.86.0 and it is released in conjunction with the main AppDynamics Python Agent.

Common errors

Warnings

Install

Imports

Quickstart

This package is an internal dependency of the AppDynamics Python Agent. The quickstart demonstrates the typical initialization of the *main* AppDynamics agent, which transparently utilizes this proxy support package for its network communications, especially when a proxy is configured (often via environment variables like `AD_PROXY_HOST`). Users generally install `appdynamics` directly, which then pulls in the correct platform-specific proxy support package.

import os
import appdynamics.agent
from appdynamics.agent import initialize

# AppDynamics Agent Initialization (typical setup)
# Ensure these environment variables are set in your deployment environment
# e.g., in a Dockerfile, k8s manifest, or shell script
# AD_CONTROLLER_HOST: Your AppDynamics Controller Hostname
# AD_CONTROLLER_PORT: Your AppDynamics Controller Port (e.g., 8090)
# AD_AGENT_ACCOUNT_NAME: Your AppDynamics Account Name
# AD_AGENT_ACCOUNT_ACCESS_KEY: Your AppDynamics Account Access Key
# AD_APPLICATION_NAME: Your Application Name
# AD_TIER_NAME: Your Tier Name
# AD_NODE_NAME: Your Node Name

controller_host = os.environ.get('AD_CONTROLLER_HOST', 'localhost')
controller_port = int(os.environ.get('AD_CONTROLLER_PORT', '8090'))
account_name = os.environ.get('AD_AGENT_ACCOUNT_NAME', 'customer1')
account_access_key = os.environ.get('AD_AGENT_ACCOUNT_ACCESS_KEY', '')
application_name = os.environ.get('AD_APPLICATION_NAME', 'MyPythonApp')
tier_name = os.environ.get('AD_TIER_NAME', 'WebTier')
node_name = os.environ.get('AD_NODE_NAME', 'Node1')

try:
    initialize(
        controller={'host': controller_host, 'port': controller_port, 'ssl': False},
        account={'name': account_name, 'access_key': account_access_key},
        application={'name': application_name, 'tier_name': tier_name, 'node_name': node_name},
        # For proxy settings, these would usually be set via environment variables as well
        # e.g., AD_PROXY_HOST, AD_PROXY_PORT, etc.
        # The appdynamics-proxysupport-linux-x64 package provides the native
        # libraries that handle these proxy connections internally.
        log={'log_level': 'INFO', 'output_path': 'stdout'},
        auto_instrument=True # Usually enabled for web frameworks
    )
    print("AppDynamics Agent initialized successfully.")
except Exception as e:
    print(f"Failed to initialize AppDynamics Agent: {e}")
    print("Ensure environment variables are set correctly and controller is reachable.")

# Your application code would go here
def my_application_function():
    print("Application function running...")

if __name__ == "__main__":
    my_application_function()

view raw JSON →