Help Docs

Installing S247DataExporter and the Python agent in a Docker container (same container)

Follow the steps below to install S247DataExporter and the Python agent in a Docker container:

  1. Install the APM Insight Python package in the Dockerfile and set your Python application name using the APM_APP_NAME environment variable.
  2. Add the S247DataExporter install command with install arguments in the Dockerfile.
  3. Start the S247DataExporter and your Python application by passing it as an argument to the apminsight-run command in the entrypoint script file.

An example Dockerfile

FROM python:3.9
#
#Your code
#
#Prerequisite (ignore if already installed)
RUN apt-get update && apt-get install -y wget unzip procps
#installing the Python agent
pip3 install -U apminsight
#Set your Python appplication name to be shown in site24x7 apm client
ENV APM_APP_NAME="Python-Application"
#installing the S247DataExporter (This is mandatory for the Python agent to work)
RUN wget -O InstallDataExporter.sh https://staticdownloads.site24x7.com/apminsight/S247DataExporter/linux/InstallDataExporter.sh
RUN sh InstallDataExporter.sh -root -nsvc -lk "license key"
#Entrypoint script
COPY ./example-entrypoint.sh /example-entrypoint.sh
ENTRYPOINT [ "sh","/example-entrypoint.sh" ]

An example entrypoint script

#!/bin/sh
#Start S247DataExporter
sh /opt/S247DataExporter/bin/service.sh start
# Pass your application start command to the apminsight-run script
apminsight-run <user application execute command> 

If you want to change the data port and status port values, follow the below:

#!/bin/sh
#Start S247DataExporter
export AGENT_STATUS_PORT=20023
export AGENT_DATA_PORT=20024
sh /opt/S247DataExporter/bin/service.sh start
apminsight-run --apm_exp_status_port "$AGENT_STATUS_PORT" --apm_exp_data_port "$AGENT_DATA_PORT" <user application execute command>  

 

Related articles

How to install various APM Insight agents in a Docker container
Java | .NET | PHP | Node.js

How to install various APM Insight agents in a Kubernetes environment
Java | .NET | PHP | Node.js | Python

Was this document helpful?

Shortlink has been copied!