opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startup
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
阅读_tracer_provider.py、_meter_provider.py和_logger_provider.py中的OTLP HTTP exporter创建路径,然后将其TLS处理方式与gRPC辅助函数_read_tls_file()进行比较。检查HTTP exporter如何接收ca_file、key_file和cert_file,并查找相关的配置测试。完成标准是:HTTP exporter启动时,已配置但无法读取或缺失的TLS文件会引发ConfigurationError。
由索引模型根据 Issue 内容生成。
描述
Describe your environment
- Component:
opentelemetry-configuration - SDK Version:
main(commitaf91f2864c1ce6ee118bbb01e6d6fe7297e05275/ PR #5781) - Python Version: Python 3.10+
- OS: All platforms
What happened?
In PR #5781, TLS and mTLS support was added to declarative configuration for both gRPC and HTTP exporters.
For otlp_grpc, certificate and key file paths are read and validated right away at startup using _read_tls_file(). If a path does not exist or cannot be read, it fails immediately with a clear ConfigurationError:
def _read_tls_file(path: str, field: str) -> bytes:
try:
with open(path, "rb") as file:
return file.read()
except OSError as exc:
raise ConfigurationError(f"Failed to read tls.{field} '{path}': {exc}") from exc
However, for otlp_http exporters (_tracer_provider.py, _meter_provider.py, and _logger_provider.py), the file paths are passed straight to the exporter constructors (OTLPSpanExporter, OTLPMetricExporter, OTLPLogExporter) as raw strings without checking if the files actually exist or can be read.
Why this is a problem in production
- Delayed failures and silent data loss: If a user makes a typo in a certificate path or mounts a Kubernetes secret file with the wrong name or permissions, the service starts up normally without any warning or error. The failure only happens much later when the background worker thread tries to send batches of telemetry over HTTP, causing failed exports and lost data.
- Inconsistent behavior:
otlp_grpcfails fast at startup withConfigurationError, whileotlp_httpsilently ignores missing files until runtime requests fail.
Steps to Reproduce
- Use an
otel-config.yamlwith a missing certificate path:
file_format: "1.0"
tracer_provider:
processors:
- simple:
exporter:
otlp_http:
endpoint: https://collector.example.com:4318/v1/traces
tls:
ca_file: /path/to/missing_ca.pem
- Initialize OpenTelemetry:
from opentelemetry.configuration import load_config_file
load_config_file("otel-config.yaml")
- Startup finishes without any error or validation warning.
- If you change
otlp_httptootlp_grpc, startup immediately fails fast with:
ConfigurationError: Failed to read tls.ca_file '/path/to/missing_ca.pem'
Expected Result
_create_otlp_http_*_exporter should check that configured ca_file, key_file, and cert_file exist and are readable at startup (for example using _read_tls_file or a shared file validation helper), raising ConfigurationError to fail fast just like otlp_grpc.
Would you like to implement a fix?
Yes, happy to help open a pull request.
- 主要语言
- Python
- 星标
- 2.7k
- 派生
- 1.1k
- 平均合并
- 4 天 13 分钟
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-telemetry/opentelemetry-python 的其他 Issue
-
W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagate可能已有人在做 @codedbyadiiii 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
open-telemetry/opentelemetry-python#5913 ·
维护者通常 2 天内回复
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
open-telemetry/opentelemetry-python#5891 ·
维护者通常 2 天内回复
-
Prometheus map_unit incorrectly normalizes percent ratio units such as %/s可能已有人在做 @knowprasad 于 10 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 84/100
open-telemetry/opentelemetry-python#5875 · 1 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
-
OTLP HTTP exporter reports a 3xx response as a successful export, so redirected batches are dropped without any log可能已有人在做 @d4rshnn 于 18 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
open-telemetry/opentelemetry-python#5865 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
open-telemetry/opentelemetry-python#5700 · 1 条评论 ·
维护者通常 2 天内回复
查看 open-telemetry/opentelemetry-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
docling-project/docling-pipelines#669 ·
维护者通常 1 天内回复
-
blocked kind/enhancement
难度 2/5 1-3 小时 新手友好度 78/100
opendatahub-io/agent-eval-harness#329 · 2 条评论 · 1 个 reaction ·
-
cc_wrapper crashes with ValueError on Windows when a path is on another drive可能已有人在做 @TrapsterDK 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
tweag/rules_haskell#2492 ·
维护者通常 1 天内回复