Skip to content

tracing: support OTEL_TRACES_EXPORTER=none|otlp|console - #306

Open
gyliu513 wants to merge 1 commit into
llm-d:mainfrom
gyliu513:exporter
Open

gyliu513 wants to merge 1 commit into
llm-d:mainfrom
gyliu513:exporter

Conversation

@gyliu513

Copy link
Copy Markdown
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #305

Release note (write NONE if no user-facing change):

`OTEL_TRACES_EXPORTER` now accepts `none` to disable span export while leaving span creation and trace-context propagation active. The default when the variable is unset has changed from `console` to `otlp`.

/cc @nirrozenbaum

Signed-off-by: Guangya Liu <gyliu513@gmail.com>
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 31, 2026
@github-actions

Copy link
Copy Markdown

This PR is marked as stale after 21d of inactivity. After an additional 14d of inactivity (7d to become rotten, then 7d more), it will be closed. To prevent this PR from being closed, add a comment or remove the lifecycle/stale label.

os.Setenv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317")
}

traceExporter, err := otlptracegrpc.New(ctx, otlptracegrpc.WithInsecure())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about following the approach of llm-d-router? Explicitly pass WithInsecure() only when there are no transport environment variables, otherwise pass nil to let the SDK read from the environment itself.

https://github.com/llm-d/llm-d-router/blob/775957e2c83fdd91237ab9bc075047d70de9c39d/pkg/common/observability/tracing/telemetry.go#L354

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or we can impl it in a separate PR

JaredTan95 added a commit to JaredTan95/llm-d-inference-payload-processor that referenced this pull request Sep 25, 2026
The resource was built with resource.NewWithAttributes, which does not run any environment detectors, so the OTEL_SERVICE_NAME variable (written via os.Setenv) and OTEL_RESOURCE_ATTRIBUTES were never read: service.name was missing from every trace.

Build the resource with resource.New + resource.WithFromEnv() instead, mirroring llm-d-router. OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES now override the built-in defaults, and a malformed OTEL_RESOURCE_ATTRIBUTES degrades to a partial resource with a report rather than stopping startup.

This is a separate, independent fix from the OTEL_TRACES_EXPORTER support in llm-d#306 and does not touch the exporter code.

Signed-off-by: JaredTan95 <jian.tan@daocloud.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tracing: OTEL_TRACES_EXPORTER=none is silently treated as console

2 participants