From 4a322a436bd0502231cbce1dbe26ba5ed4425018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=A4fer?= Date: Mon, 4 May 2026 00:12:16 +0200 Subject: [PATCH] chore(docs): add OTLP timeout docs and minor fixes --- .github/CODEOWNERS | 1 + README.md | 2 +- docs/observability.md | 12 ++++++++---- examples/otel-collector-config.yaml | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c5f1403..7d8c330 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,2 @@ * @oschwartz10612 @miloschwartz +internal/observability/** @marcschaeferger diff --git a/README.md b/README.md index e403d88..6c324c1 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ make ### Binary -Make sure to have Go 1.23.1 installed. +Make sure to have Go 1.26 installed. ```bash make local diff --git a/docs/observability.md b/docs/observability.md index 13cb038..64184d5 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -83,6 +83,7 @@ type OTelConfig struct { Endpoint string // default: "localhost:4317" Insecure bool // default: true ExportInterval time.Duration // default: 60s + Timeout time.Duration // default: 10s } ``` @@ -97,6 +98,7 @@ type OTelConfig struct { | `OTEL_METRICS_ENDPOINT` | `localhost:4317` | OTLP collector address | | `OTEL_METRICS_INSECURE` | `true` | Disable TLS for OTLP | | `OTEL_METRICS_EXPORT_INTERVAL` | `60s` | Push interval (e.g. `10s`, `1m`) | +| `OTEL_METRICS_TIMEOUT` | `10s` | Timeout for OTLP exporter connection setup | | `DEPLOYMENT_ENVIRONMENT` | _(unset)_ | OTel deployment.environment attribute | ### CLI flags @@ -108,7 +110,8 @@ type OTelConfig struct { --otel-metrics-protocol string (default: grpc) --otel-metrics-endpoint string (default: localhost:4317) --otel-metrics-insecure bool (default: true) ---otel-metrics-export-interval duration (default: 1m0s) +--otel-metrics-export-interval duration (default: 60s) +--otel-metrics-timeout duration (default: 10s) ``` --- @@ -164,6 +167,7 @@ export OTEL_METRICS_PROTOCOL=grpc export OTEL_METRICS_ENDPOINT=otel-collector:4317 export OTEL_METRICS_INSECURE=true export OTEL_METRICS_EXPORT_INTERVAL=10s +export OTEL_METRICS_TIMEOUT=10s export DEPLOYMENT_ENVIRONMENT=production ``` @@ -176,6 +180,7 @@ export DEPLOYMENT_ENVIRONMENT=production --otel-metrics-endpoint=otel-collector:4317 \ --otel-metrics-insecure \ --otel-metrics-export-interval=10s \ + --otel-metrics-timeout=10s \ --config=/etc/gerbil/config.json ``` @@ -225,7 +230,6 @@ All metrics use the prefix `gerbil__`. | Metric | Type | Labels | |--------|------|--------| | `gerbil_proxy_mapping_active` | UpDownCounter | `ifname` | -| `gerbil_session_active` | UpDownCounter | `ifname` | | `gerbil_active_sessions` | UpDownCounter | `ifname` | | `gerbil_udp_packets_total` | Counter | `ifname`, `type`, `direction` | | `gerbil_hole_punch_events_total` | Counter | `ifname`, `result` | @@ -256,7 +260,7 @@ The `docker-compose.metrics.yml` provides a complete observability stack. **Prometheus mode:** ```bash -METRICS_BACKEND=prometheus docker-compose -f docker-compose.metrics.yml up -d +METRICS_BACKEND=prometheus docker-compose -f docker compose.metrics.yml up -d # Scrape at http://localhost:3003/metrics # Grafana at http://localhost:3000 (admin/admin) ``` @@ -265,5 +269,5 @@ METRICS_BACKEND=prometheus docker-compose -f docker-compose.metrics.yml up -d ```bash METRICS_BACKEND=otel OTEL_METRICS_ENDPOINT=otel-collector:4317 \ - docker-compose -f docker-compose.metrics.yml up -d + docker compose -f docker-compose.metrics.yml up -d ``` diff --git a/examples/otel-collector-config.yaml b/examples/otel-collector-config.yaml index 5c85356..acfa434 100644 --- a/examples/otel-collector-config.yaml +++ b/examples/otel-collector-config.yaml @@ -1,3 +1,4 @@ +file_format: '1.0' receivers: otlp: protocols: @@ -43,4 +44,4 @@ service: metrics: receivers: [otlp] processors: [batch, resource] - exporters: [prometheus, prometheusremotewrite, debug] \ No newline at end of file + exporters: [prometheus, prometheusremotewrite, debug]