Skip to content

OTEL stack ignores OTEL_ variables #25839

@maxkomarychev

Description

@maxkomarychev

Description

When running the opencode via SDK with OTEL enabled I am unable to control some fundamental properties of spans. More specifically service name and environment name.

The name seems to be forced to "opencode" and "deployment.environment.name" is forced to "installation channel".

I want to be able to control these via OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES

Plugins

No response

OpenCode version

latest

Steps to reproduce

  1. enable otel via config.experimental.openTelemetry = true
  2. run jaeger:
    docker run --rm --name jaeger \
      -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
      -p 16686:16686 \
      -p 4317:4317 \
      -p 4318:4318 \
      -p 14250:14250 \
      -p 14268:14268 \
      -p 14269:14269 \
      -p 9411:9411 \
      jaegertracing/all-in-one:1.76.0
  3. run opencode: OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 OTEL_SERVICE_NAME='my-name' OTEL_RESOURCE_ATTRIBUTES='deployment.environment.name=my-env' bun dev

Expected:

  1. service name "my-name"
  2. env "my-env"

Actual:

  1. service name: "opencode"
  2. env: "local"

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions