Registering a LogRecordProcessor throws an exception reading:
An error occurred while loading instrumentation hook: Cannot read properties of undefined (reading 'attributeCountLimit')
This was possibly introduced in https://github.com/open-telemetry/opentelemetry-js/pull/4564. Upgrading @opentelemetry/sdk-logs seems to fix the issue but only if you do not pass anything to logRecordProcessor and instead create your own logRecordProcessor and pass a resource and empty value for logRecordLimits.
This only happens on the edge runtime, at runtime (not build), when there is a middleware.ts file (NextJS), and using SimpleLogRecordProcessor,
Updating the range for peer dependencies in https://github.com/vercel/otel/pull/89 seems to have solved the warnings from package managers during installation but not actual logic changes.
Registering a
LogRecordProcessor
throws an exception reading:This was possibly introduced in https://github.com/open-telemetry/opentelemetry-js/pull/4564. Upgrading
@opentelemetry/sdk-logs
seems to fix the issue but only if you do not pass anything tologRecordProcessor
and instead create your ownlogRecordProcessor
and pass aresource
and empty value forlogRecordLimits
.This only happens on the
edge
runtime, at runtime (not build), when there is amiddleware.ts
file (NextJS), and usingSimpleLogRecordProcessor
,Updating the range for peer dependencies in https://github.com/vercel/otel/pull/89 seems to have solved the warnings from package managers during installation but not actual logic changes.