OpenTelemetry tracing add (default off, k8s me on)
All checks were successful
Tests / Test passed: 3
demo-app-mb/pipeline/head This commit looks good

This commit is contained in:
devops 2026-09-17 02:52:47 +00:00
parent e9ed75d510
commit 7b946b1182
2 changed files with 14 additions and 3 deletions

View File

@ -22,4 +22,12 @@ USER appuser
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=3s CMD python -c "import urllib.request;urllib.request.urlopen('http://127.0.0.1:8000/health')"
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "app.main:app"]
# Tracing default OFF. k8s manifest me OTEL_SDK_DISABLED=false karke on hota hai,
# taaki build/smoke test ke waqt export ki koshish na ho.
ENV OTEL_SDK_DISABLED=true \
OTEL_TRACES_EXPORTER=otlp \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORTER=none \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
CMD ["opentelemetry-instrument", "gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "app.main:app"]

View File

@ -1,2 +1,5 @@
flask==3.0.3
gunicorn==22.0.0
flask
gunicorn
opentelemetry-distro
opentelemetry-exporter-otlp-proto-http
opentelemetry-instrumentation-flask