Skip to content

Commit f25d731

Browse files
committed
Update api dependency
1 parent 14e473b commit f25d731

File tree

3 files changed

+101
-3
lines changed

3 files changed

+101
-3
lines changed

package-lock.json

Lines changed: 91 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/instrumentation-console/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ new ConsoleInstrumentation({
6767

6868
When a console method is called within an active span context, the resulting LogRecord will automatically include `trace_id`, `span_id`, and `trace_flags` attributes for log correlation.
6969

70+
## Important: Infinite Loop Prevention
71+
72+
This instrumentation requires `@opentelemetry/api >= 1.9.1`. Starting from that version, the `DiagConsoleLogger` saves references to the original `console` methods at module load time, so internal OTel diagnostic logging bypasses the instrumentation and avoids infinite loops.
73+
74+
Additionally, this instrumentation includes a re-entrancy guard to prevent loops from exporters that write to the console (e.g., `ConsoleLogRecordExporter`).
75+
76+
> **Note:** Avoid using `ConsoleLogRecordExporter` or `ConsoleSpanExporter` together with this instrumentation in production. Use network-based exporters (e.g., OTLP) instead.
77+
7078
## Useful links
7179

7280
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>

packages/instrumentation-console/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
"access": "public"
4242
},
4343
"peerDependencies": {
44-
"@opentelemetry/api": "^1.3.0"
44+
"@opentelemetry/api": "^1.9.1"
4545
},
4646
"devDependencies": {
47-
"@opentelemetry/api": "^1.3.0",
47+
"@opentelemetry/api": "^1.9.1",
4848
"@opentelemetry/sdk-logs": "^0.213.0",
4949
"@opentelemetry/sdk-trace-base": "^2.0.0",
5050
"@opentelemetry/sdk-trace-node": "^2.0.0"

0 commit comments

Comments
 (0)