observability-edot-python-instrument
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEDOT Python Instrumentation
EDOT Python 插桩
Read the setup guide before making changes:
Guidelines
指南
- Install via pip (add to
elastic-opentelemetryor equivalent)requirements.txt - Run during image build to install auto-instrumentation packages for detected libraries
edot-bootstrap --action=install - Wrap the application entrypoint with — e.g.
opentelemetry-instrumentoropentelemetry-instrument gunicorn app:app. Without this, no telemetry is collectedopentelemetry-instrument python app.py - Set exactly three required environment variables:
OTEL_SERVICE_NAME- — must be the managed OTLP endpoint or EDOT Collector URL. Never use an APM Server URL (no
OTEL_EXPORTER_OTLP_ENDPOINT, noapm-server, no:8200)/intake/v2/events - —
OTEL_EXPORTER_OTLP_HEADERSor"Authorization=ApiKey <key>""Authorization=Bearer <token>"
- Do NOT set ,
OTEL_TRACES_EXPORTER, orOTEL_METRICS_EXPORTER— the defaults are already correctOTEL_LOGS_EXPORTER - Do NOT add code-level SDK setup (no , no
TracerProvider, etc.) —configure_azure_monitorhandles everythingopentelemetry-instrument - Never run both classic and EDOT on the same application
elastic-apm
- 通过pip安装(添加至
elastic-opentelemetry或等效依赖文件中)requirements.txt - 在镜像构建期间运行,为检测到的库安装自动插桩包
edot-bootstrap --action=install - 使用包裹应用程序入口点——例如
opentelemetry-instrument或opentelemetry-instrument gunicorn app:app。如果不执行此步骤,将不会收集任何遥测数据opentelemetry-instrument python app.py - 准确设置三个必填环境变量:
OTEL_SERVICE_NAME- —— 必须是托管式OTLP端点或EDOT Collector的URL。切勿使用APM Server URL(不包含
OTEL_EXPORTER_OTLP_ENDPOINT、apm-server或:8200)/intake/v2/events - ——
OTEL_EXPORTER_OTLP_HEADERS或"Authorization=ApiKey <key>""Authorization=Bearer <token>"
- 请勿设置、
OTEL_TRACES_EXPORTER或OTEL_METRICS_EXPORTER——默认配置已为正确设置OTEL_LOGS_EXPORTER - 请勿添加代码层面的SDK设置(无需、
TracerProvider等)——configure_azure_monitor会处理所有相关操作opentelemetry-instrument - 切勿在同一应用程序中同时运行传统与EDOT
elastic-apm
Examples
示例
See the EDOT Python setup guide for
complete examples.
请查看EDOT Python setup guide获取完整示例。