Bug Description
The diagnostics-otel plugin fails to initialize when enabled, preventing OpenTelemetry tracing from working.
Error Message
TypeError: _resources.Resource is not a constructor
Root Cause
@opentelemetry/resources v2.5.0 introduced a breaking change that removed the Resource class. The package now exports resourceFromAttributes instead.
The transpiled code references _resources.Resource, suggesting the TypeScript import import { Resource } from "@opentelemetry/resources" is still being used somewhere in the dependency chain.
Steps to Reproduce
- Add OTEL config to
openclaw.json:
"diagnostics": {
"otel": {
"enabled": true,
"endpoint": "https://api.honeycomb.io:443",
"headers": { "x-honeycomb-team": "YOUR_API_KEY" },
"serviceName": "openclaw"
}
}
- Restart the gateway
- Plugin fails to load with the above error
Expected Behavior
The diagnostics-otel plugin should initialize and export traces to the configured OTEL endpoint.
Environment
- OpenClaw: latest (as of 2026-02-06)
- Node: v24.10.0
- OS: macOS Darwin 25.1.0 (arm64)
@opentelemetry/resources: v2.5.0 (or whichever version is in the dependency tree)
Suggested Fix
Update the OTel SDK imports to use the new v2.x API:
// Before (v1.x)
import { Resource } from "@opentelemetry/resources";
const resource = new Resource({ ... });
// After (v2.x)
import { resourceFromAttributes } from "@opentelemetry/resources";
const resource = resourceFromAttributes({ ... });
Or pin the OTel packages to v1.x until the codebase can be updated for v2.x compatibility.
Labels
Bug Description
The
diagnostics-otelplugin fails to initialize when enabled, preventing OpenTelemetry tracing from working.Error Message
Root Cause
@opentelemetry/resourcesv2.5.0 introduced a breaking change that removed theResourceclass. The package now exportsresourceFromAttributesinstead.The transpiled code references
_resources.Resource, suggesting the TypeScript importimport { Resource } from "@opentelemetry/resources"is still being used somewhere in the dependency chain.Steps to Reproduce
openclaw.json:Expected Behavior
The diagnostics-otel plugin should initialize and export traces to the configured OTEL endpoint.
Environment
@opentelemetry/resources: v2.5.0 (or whichever version is in the dependency tree)Suggested Fix
Update the OTel SDK imports to use the new v2.x API:
Or pin the OTel packages to v1.x until the codebase can be updated for v2.x compatibility.
Labels