core: support OTEL_RESOURCE_ATTRIBUTES environment variable for custom telemetry attributes

Users can now pass custom OpenTelemetry resource attributes via the OTEL_RESOURCE_ATTRIBUTES environment variable (comma-separated key=value format). These attributes are automatically included in all telemetry data sent from both the main process and workspace environments, enabling better observability integration with existing monitoring systems that rely on custom resource tags.
This commit is contained in:
Dax Raad
2026-04-18 11:20:29 -04:00
parent 1ee712e549
commit 078d8a07cf
3 changed files with 64 additions and 1 deletions

View File

@@ -117,6 +117,7 @@ export const create = fn(CreateInput, async (input) => {
OPENCODE_EXPERIMENTAL_WORKSPACES: "true",
OTEL_EXPORTER_OTLP_HEADERS: process.env.OTEL_EXPORTER_OTLP_HEADERS,
OTEL_EXPORTER_OTLP_ENDPOINT: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
OTEL_RESOURCE_ATTRIBUTES: process.env.OTEL_RESOURCE_ATTRIBUTES,
}
await adaptor.create(config, env)