v2/trace: exporting cannot be turned off, so services without a collector log export errors forever

Problem

trace.Config.Endpoint has no "do not export" value. Leaving it empty falls back to localhost:4318 rather than disabling the exporter:

  • v2/trace/trace.go:44: Default: "" — the SDK honours OTEL_EXPORTER_OTLP_ENDPOINT or falls back to http://localhost:4318
  • v2/trace/env.go:213: an empty Endpoint is filled from the environment, never left unset
  • v2/trace has no noop or off path at v2.29.2

So a LabKit v2 service deployed without a collector retries forever. From an Artifact Registry pod:

traces export: Post "https://localhost:4318/v1/traces": dial tcp [::1]:4318: connect: connection refused

repeating every few seconds for the life of the process.

Two wrinkles:

Ask

Let a service say "no tracing" without inventing a fake endpoint: treat an unset Endpoint as no exporter, or add an explicit switch.

This matters most for self-managed deployments, where a collector is optional. Surfaced while documenting the Artifact Registry self-managed install (gitlab-org/ops/artifact-registry!921 (merged)).