vercel / otel

OTEL tracing for Vercel
https://vercel.com/docs/observability/otel-overview
19 stars 4 forks source link

Registering a `LogRecordProcessor` throws an exception #104

Open mburumaxwell opened 3 weeks ago

mburumaxwell commented 3 weeks ago

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.