-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support attributes with circular references in OTLP exporters #2713
Comments
It looks like an attribute is being created with a circular reference. If that's the case, I would say this is a feature request and not really a bug. Can you provide an example of a circular reference that you would want to be exported and how you might expect that to look? Circular objects are not easily serializable in e.g. JSON. |
In our case: we use opentracing shim. According to OT conventions, we create error log with
At least it should be mentioned in the docs or in methods comments that you shouldn't pass complex objects as attribute values |
ok cool thanks for the additional info |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
What version of OpenTelemetry are you using?
What version of Node are you using?
v16.13.0
Please provide the code you used to setup the OpenTelemetry SDK
What did you do?
Sometimes nested libraries or us may generate objects with circular object references. It would be awesome if @opentelemetry will be able to successfully transform and serialize those objects instead of failing.
Pass circular object to function
toCollectorAttributes
in@opentelemetry/exporter-trace-otlp-http/build/src/transform.js
What did you expect to see?
Spans are written to opentelemetry-collector successfully.
What did you see instead?
{"stack":"RangeError: Maximum call stack size exceeded\n at toCollectorKeyValueList (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:47:33)\n at toCollectorAnyValue (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:90:32)\n at toCollectorAttributeKeyValue (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:58:22)\n at /Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:29:16\n at Array.map (<anonymous>)\n at toCollectorAttributes (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:28:36)\n at toCollectorKeyValueList (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:49:17)\n at toCollectorAnyValue (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:90:32)\n at /Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:39:37\n at Array.map (<anonymous>)\n at toCollectorArrayValue (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:39:24)\n at toCollectorAnyValue (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:87:31)\n at toCollectorAttributeKeyValue (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:58:22)\n at /Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:29:16\n at Array.map (<anonymous>)\n at toCollectorAttributes (/Users/misak/lerua/channels/ap--otelemetry-channel/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js:28:36)","message":"Maximum call stack size exceeded","name":"RangeError"}
The text was updated successfully, but these errors were encountered: