Skip to content

Commit 6f7198f

Browse files
authored
Use uv in instrumentation quickstart (#402)
1 parent e50c7a3 commit 6f7198f

File tree

4 files changed

+664
-15
lines changed

4 files changed

+664
-15
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM python:3.12
1+
FROM python:3.12-slim
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23
WORKDIR /usr/src/app
34
COPY . .
4-
RUN python -m venv /venv && \
5-
/venv/bin/pip install -r requirements.txt
6-
CMD /venv/bin/gunicorn -b 0.0.0.0:8080 -w 4 'app:app' 2>&1 | tee /var/log/app.log
5+
RUN uv sync --frozen
6+
CMD uv run gunicorn -b 0.0.0.0:8080 -w 4 'app:app' 2>&1 | tee /var/log/app.log
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[project]
2+
name = "instrumentation-quickstart"
3+
version = "0.1.0"
4+
description = "A Flask app instrumented with OpenTelemetry and structured logging for GCP"
5+
readme = "README.md"
6+
requires-python = ">=3.9"
7+
dependencies = [
8+
"flask>=3.1.0",
9+
"gunicorn>=23.0.0",
10+
"opentelemetry-api>=1.29.0",
11+
"opentelemetry-exporter-otlp-proto-http>=1.29.0",
12+
"opentelemetry-instrumentation-flask>=0.50b0",
13+
"opentelemetry-instrumentation-logging>=0.50b0",
14+
"opentelemetry-instrumentation-requests>=0.50b0",
15+
"opentelemetry-sdk>=1.29.0",
16+
"python-json-logger>=3.2.0",
17+
"requests>=2.32.3",
18+
]

samples/instrumentation-quickstart/requirements.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)