Skip to content

doc: fix TOML otel exporter example — multi-line inline table is invalid #7668

@448523760

Description

@448523760

What is the type of issue?

Documentation is incorrect

What is the issue?

The otel exporter example in docs/config.md is misleading and will cause
the configuration parser to fail if copied verbatim.

Summary

The example uses a TOML inline table but spreads the inline-table braces
across multiple lines. TOML inline tables must be contained on a single line
(key = { a = 1, b = 2 }); placing newlines inside the braces triggers a
parse error in most TOML parsers and prevents Codex from starting.

Reproduction

  1. Paste the snippet below into ~/.codex/config.toml (or your project config).
  2. Run codex (or the command that loads the config).
  3. The process will fail to start with a TOML parse error similar to:
Error loading config.toml: TOML parse error at line 55, column 27
   |
55 | exporter = { otlp-http = {
   |                           ^
newlines are unsupported in inline tables, expected nothing

Problematic snippet (as currently shown in the docs)

[otel]
exporter = { otlp-http = {
  endpoint = "https://otel.example.com/v1/logs",
  protocol = "binary",
  headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }
}}

Recommended fixes

[otel.exporter."otlp-http"]
endpoint = "https://otel.example.com/v1/logs"
protocol = "binary"

[otel.exporter."otlp-http".headers]
"x-otlp-api-key" = "${OTLP_TOKEN}"

Or, keep an inline table but write it on one line (valid but less readable):

[otel]
exporter = { "otlp-http" = { endpoint = "https://otel.example.com/v1/logs", protocol = "binary", headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" } } }

This will avoid confusing users who copy/paste the example and then see a
parse error at startup.

Where did you find it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions