Data-Slinger is a base Docker image designed to run a Django project with integrated telemetry (logging, metrics, and tracing) using OpenTelemetry and uWSGI. It is built to serve as a foundational image that you can extend for your Django applications.
- Docker installed and running.
- (Optional) Git to clone the repository.
- (Optional) An existing
.envfile with your environment variables (see Configuration below).
Clone the repository from GitHub (or your source control) and change into the project directory:
git clone https://github.com/your-username/data-slinger.git
cd data-slingerBefore building or running the Docker container, create a .env file in the root of the project directory with the following content:
OTEL_RESOURCE_ATTRIBUTES=service.name=<service-name>
OTEL_EXPORTER_OTLP_HEADERS=api-key=<your-license-key>
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://otlp.nr-data.net/v1/metrics
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://otlp.nr-data.net/v1/tracesBuild the Docker image using the following command:
docker build -t data-slinger-image .This command does the following:
- Reads the Dockerfile in the current directory.
- Creates an image tagged data-slinger-image.
Once the image is built, run it to test the application using:
docker run --rm -p 8000:8000 --env-file .env data-slinger-imageThis will start the Django server on port 8000, integrated with OpenTelemetry and uWSGI.