Skip to content

Commit

Permalink
Add AWS OTEL augmented Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
przemub committed Nov 23, 2024
1 parent ce9c8a5 commit ade8114
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile.opentelemetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Version augmented by opentelemetry.io

RUN --mount=type=cache,target=/root/.cache/pip \
pip install aws-opentelemetry-distro opentelemetry-instrumentation-django opentelemetry-instrumentation-requests \
opentelemetry-instrumentation-celery opentelemetry-instrumentation-redis
RUN opentelemetry-bootstrap -a install

ENV OTEL_RESOURCE_ATTRIBUTES="service.name=Anime Themes Quiz,deployment.environment=generic:default"
ENV OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
ENV OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://172.17.0.1:4316/v1/traces"
ENV OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT="http://172.17.0.1:4316/v1/metrics"
ENV OTEL_METRICS_EXPORTER=none
ENV OTEL_LOGS_EXPORTER=none
ENV OTEL_TRACES_SAMPLER=xray
ENV OTEL_TRACES_SAMPLER_ARG="endpoint=http://172.17.0.1:2000"
ENV OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true

ENV OTEL_PYTHON_DISTRO="aws_distro"
ENV OTEL_PYTHON_CONFIGURATOR="aws_configurator"

CMD opentelemetry-instrument \
uwsgi --ini uwsgi.cfg

0 comments on commit ade8114

Please sign in to comment.