-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate datadog to backend for traces and logs (#1299)
Issue #1217 **Key changes:** - Add ddtrace library - Wrap application to datadog serverless-init to collect traces and logs
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM python:3.11 AS builder | ||
|
||
ENV PATH="/opt/venv/bin:$PATH" | ||
RUN python -m venv /opt/venv | ||
|
||
COPY backend/requirements.txt /tmp/requirements.txt | ||
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt | ||
|
||
FROM python:3.11-slim | ||
|
||
WORKDIR /app | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
RUN apt-get update && apt-get -y install ffmpeg curl unzip && rm -rf /var/lib/apt/lists/* && \ | ||
pip install --target /dd_tracer/python/ ddtrace | ||
|
||
COPY --from=builder /opt/venv /opt/venv | ||
COPY --from=gcr.io/datadoghq/serverless-init:1 /datadog-init /app/datadog-init | ||
COPY backend/ . | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["/app/datadog-init"] | ||
CMD ["/dd_tracer/python/bin/ddtrace-run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"] |