Docker image does not have OTEL libraries installed
Prerequisites
- [x] I am using the latest version of Locust
- [x] I am reporting a bug, not asking a question
Description
When I enable OTEL via the instructions at https://www.locust.cloud/blog/observable-load-testing/ I get the following error when starting the container with the --otel flag:
[2025-12-05 18:53:37,231] e4744a99b8a5/ERROR/locust.opentelemetry: OpenTelemetry SDK is not installed, opentelemetry not enabled. Run 'pip install locust[otel]'
Command line
docker run locustio/locust:latest --host https://host.docker.internal:49942 --users 10 --spawn-rate 2 --run-time 300s --locustfile /mnt/locust/Load --processes -1 --otel
Locustfile contents
Issue triggers before needing a file
Python version
whatever is in the container
Locust version
2.42.6
Operating system
linux
Hmm... Not sure what the best solution here is - I dont think we want to install OTel for everyone by default.
For now I think you'll need to build your own image, so using a Dockerfile like this:
FROM locustio/locust
RUN pip install locust[otel]
I guess we could provide an otel-enabled image too.