OpenTelemetry Agent - Python on Linux Installation



Installation Steps

  1. Install the OpenTelemetry Python Packages
pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
  1. Run the Python Application with OpenTelemetry Environment Variables
  • Find-and-replace $SERVICE_NAME with the name of the Service for the Application
  • Find-and-replace $PROTOCOL with http or https based on the VF Server configuration
  • Find-and-replace $VF_SERVER_ADDRESS with the URL for your organization’s vFunction Server
  • Find-and-replace $VF_APP_ID with the Application UUID created with the Installation Instructions from the vFunction Server UI
  • Find-and-replace $APP_NAME with the name of the Python script
export OTEL_SERVICE_NAME="$MY_SERVICE"
export OTEL_EXPORTER_OTLP_ENDPOINT="$PROTOCOL://$VF_SERVER_ADDRESS/api/unauth/otlp"
export OTEL_EXPORTER_OTLP_HEADERS="$VF_APP_ID"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_LOGS_EXPORTER="none"
opentelemetry-instrument && python $APP_NAME.py