← Back to PRs

#10199: fix(diagnostics-otel): opentelemetry bug fix

by yourtion open 2026-02-06 06:58 View on GitHub →
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