#10199: fix(diagnostics-otel): opentelemetry bug fix
extensions: diagnostics-otel
stale
error when loading plugin diagnostics-otel
```
error plugins {"subsystem":"plugins"} plugin service failed (diagnostics-otel): TypeError: _resources.Resource is not a constructor
```
see:
- https://www.npmjs.com/package/@opentelemetry/resources
- https://www.npmjs.com/package/@opentelemetry/sdk-logs
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR fixes `diagnostics-otel` failing to load due to `Resource` no longer being constructible in newer `@opentelemetry/resources` versions by switching resource creation to `resourceFromAttributes(...)`. It also updates log pipeline wiring by configuring log record processors on `LoggerProvider` initialization.
The change is localized to the OpenTelemetry diagnostics plugin (`extensions/diagnostics-otel/src/service.ts`), which initializes OTLP exporters for traces/metrics/logs based on config and registers a log transport + diagnostic event handlers to emit OTel telemetry.
<h3>Confidence Score: 3/5</h3>
- This PR is likely safe, but the logging initialization change needs verification against the pinned OpenTelemetry SDK version.
- Resource creation via `resourceFromAttributes` should directly address the reported runtime error. However, the `LoggerProvider({ processors: [...] })` API is version-sensitive; if unsupported in @opentelemetry/sdk-logs@0.211.x, enabling logs will crash on startup.
- extensions/diagnostics-otel/src/service.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#2574: fix(diagnostics-otel): update to @opentelemetry/resources v2.x API
by dillera · 2026-01-27
90.0%
#11530: diagnostics-otel: fix OpenTelemetry v2 resource/logs API compatibility
by erain · 2026-02-07
88.2%
#4255: fix(diagnostics-otel): complete OpenTelemetry v2.x compatibility
by arbgjr · 2026-01-29
86.6%
#19353: fix(diagnostics-otel): fix cross-chunk module isolation breaking even…
by nez · 2026-02-17
80.4%
#22478: fix(diagnostics-otel): wire OTLP exporter to emit traffic to config...
by LuffySama-Dev · 2026-02-21
72.6%
#16865: fix(diagnostics-otel): share listeners/transports across module bun...
by leonnardo · 2026-02-15
72.5%
#21290: feat(diagnostics-otel): OpenTelemetry diagnostics with GenAI semant...
by Baukebrenninkmeijer · 2026-02-19
71.7%
#18901: feat(diagnostics-otel): add trace context propagation and GenAI sem...
by sergical · 2026-02-17
71.6%
#18182: fix(security): redact sensitive data in OTEL log exports (CWE-532)
by brandonwise · 2026-02-16
71.2%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
69.4%