Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Declarative config max_request_size: 0 fails SDK creation instead of meaning no limit

未关闭
#8,940 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@thswlsqls 已经在做这个了。

开始于 2026年10月13日。

  • #8945 来自 @thswlsqls —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
java
领域
backend

调研方向

Read OtlpDeclarativeConfigUtil.configureOtlpExporterBuilder() and trace how max_request_size reaches the OTLP HTTP and gRPC exporter builders. Check the exporter setters that reject zero and compare their behavior with timeout: 0; done means declarative config accepts zero as no limit for all six span, metric, and log exporters, with tests covering those cases.

由索引模型根据 Issue 内容生成。

描述

Describe the bug
Setting max_request_size: 0 on an otlp_http or otlp_grpc exporter in declarative config makes SDK creation fail. The configuration schema says 0 means no limit.

Steps to reproduce
Declarative config:

tracer_provider:
  processors:
    - batch:
        exporter:
          otlp_http:
            max_request_size: 0

What did you expect to see?
The exporter is created with no request size limit. opentelemetry-configuration v1.2.0 schema/common.yaml defines max_request_size with minimum: 0 and says: "Value must be non-negative. A value of 0 indicates no limit (infinity) and is not recommended." timeout: 0 already works this way.

What did you see instead?
DeclarativeConfigException: Error configuring io.opentelemetry.sdk.trace.export.SpanExporter with name "otlp_http", caused by IllegalArgumentException: maxRequestBodySizeBytes must be positive. OtlpDeclarativeConfigUtil.configureOtlpExporterBuilder() passes 0 to setMaxRequestBodySize / setMaxRequestMessageSize, which only accept positive values. All six OTLP HTTP/gRPC span, metric, and log exporters are affected.

What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-otlp, opentelemetry-sdk-extension-declarative-config
Version: main @ 387f5c5d4
How did you reference these artifacts? N/A

Environment
Compiler: Temurin 21
OS: N/A

Additional context
The option was wired in #8446. The schema meaning of 0 was agreed in open-telemetry/opentelemetry-configuration#700.

主要语言
Java
星标
2.5k
派生
1k
平均合并
2 天 23 小时
30 天内合并 PR
68

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

open-telemetry/opentelemetry-java 的其他 Issue

查看 open-telemetry/opentelemetry-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。