Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix(doc): TOML otel exporter example — multi-line inline table is inv… (#7669)

Robby He57ba9fa100f8
diff --git a/docs/config.md b/docs/config.md
index 0ba711f02c..b7d44142aa 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -615,12 +615,12 @@ Set `otel.exporter` to control where events go:
endpoint, protocol, and headers your collector expects:
```toml
- [otel]
- exporter = { otlp-http = {
- endpoint = "https://otel.example.com/v1/logs",
- protocol = "binary",
- headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }
- }}
+ [otel.exporter."otlp-http"]
+ endpoint = "https://otel.example.com/v1/logs"
+ protocol = "binary"
+
+ [otel.exporter."otlp-http".headers]
+ "x-otlp-api-key" = "${OTLP_TOKEN}"
```
- `otlp-grpc` – streams OTLP log records over gRPC. Provide the endpoint and any
@@ -628,27 +628,24 @@ Set `otel.exporter` to control where events go:
```toml
[otel]
- exporter = { otlp-grpc = {
- endpoint = "https://otel.example.com:4317",
- headers = { "x-otlp-meta" = "abc123" }
- }}
+ exporter = { otlp-grpc = {endpoint = "https://otel.example.com:4317",headers = { "x-otlp-meta" = "abc123" }}}
```
Both OTLP exporters accept an optional `tls` block so you can trust a custom CA
or enable mutual TLS. Relative paths are resolved against `~/.codex/`:
```toml
-[otel]
-exporter = { otlp-http = {
- endpoint = "https://otel.example.com/v1/logs",
- protocol = "binary",
- headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" },
- tls = {
- ca-certificate = "certs/otel-ca.pem",
- client-certificate = "/etc/codex/certs/client.pem",
- client-private-key = "/etc/codex/certs/client-key.pem",
- }
-}}
+[otel.exporter."otlp-http"]
+endpoint = "https://otel.example.com/v1/logs"
+protocol = "binary"
+
+[otel.exporter."otlp-http".headers]
+"x-otlp-api-key" = "${OTLP_TOKEN}"
+
+[otel.exporter."otlp-http".tls]
+ca-certificate = "certs/otel-ca.pem"
+client-certificate = "/etc/codex/certs/client.pem"
+client-private-key = "/etc/codex/certs/client-key.pem"
```
If the exporter is `none` nothing is written anywhere; otherwise you must run or point to your
diff --git a/docs/example-config.md b/docs/example-config.md
index f5b3c62904..1f326ac14b 100644
--- a/docs/example-config.md
+++ b/docs/example-config.md
@@ -341,30 +341,28 @@ environment = "dev"
exporter = "none"
# Example OTLP/HTTP exporter configuration
-# [otel]
-# exporter = { otlp-http = {
-# endpoint = "https://otel.example.com/v1/logs",
-# protocol = "binary", # "binary" | "json"
-# headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }
-# }}
+# [otel.exporter."otlp-http"]
+# endpoint = "https://otel.example.com/v1/logs"
+# protocol = "binary" # "binary" | "json"
+
+# [otel.exporter."otlp-http".headers]
+# "x-otlp-api-key" = "${OTLP_TOKEN}"
# Example OTLP/gRPC exporter configuration
-# [otel]
-# exporter = { otlp-grpc = {
-# endpoint = "https://otel.example.com:4317",
-# headers = { "x-otlp-meta" = "abc123" }
-# }}
+# [otel.exporter."otlp-grpc"]
+# endpoint = "https://otel.example.com:4317",
+# headers = { "x-otlp-meta" = "abc123" }
# Example OTLP exporter with mutual TLS
-# [otel]
-# exporter = { otlp-http = {
-# endpoint = "https://otel.example.com/v1/logs",
-# protocol = "binary",
-# headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" },
-# tls = {
-# ca-certificate = "certs/otel-ca.pem",
-# client-certificate = "/etc/codex/certs/client.pem",
-# client-private-key = "/etc/codex/certs/client-key.pem",
-# }
-# }}
+# [otel.exporter."otlp-http"]
+# endpoint = "https://otel.example.com/v1/logs"
+# protocol = "binary"
+
+# [otel.exporter."otlp-http".headers]
+# "x-otlp-api-key" = "${OTLP_TOKEN}"
+
+# [otel.exporter."otlp-http".tls]
+# ca-certificate = "certs/otel-ca.pem"
+# client-certificate = "/etc/codex/certs/client.pem"
+# client-private-key = "/etc/codex/certs/client-key.pem"
```