Skip to content

Commit 0cc7305

Browse files
vordimoustrentm
andauthored
Update plugins/node/opentelemetry-instrumentation-winston/README.md
Co-authored-by: Trent Mick <[email protected]>
1 parent 8772f4c commit 0cc7305

File tree

1 file changed

+17
-14
lines changed
  • plugins/node/opentelemetry-instrumentation-winston

1 file changed

+17
-14
lines changed

plugins/node/opentelemetry-instrumentation-winston/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,24 @@ const logger = winston.createLogger({
139139
```
140140

141141
> [!IMPORTANT]
142-
> Logs will be duplicated if `@opentelemetry/winston-transport` is added as a transport in `winston` and `@opentelemetry/instrumentation-winston` is configured with `disableLogSending: false`. You must import `winston` after you have called `registerInstrumentations`.
142+
> Logs will be **duplicated** if `OpenTelemetryTransportV3` is explicitly added as a Winston logger transport **and** `@opentelemetry/instrumentation-winston` is active with the [Log sending](#log-sending) feature (the default). If you are both using `OpenTelemetryTransportV3` and instrumentation-winston, be sure to either disable instrumentation-winston completely, or disable its Log sending feature (`disableLogSending: false`). For examle:
143+
>
143144
> ```js
144-
>const { WinstonInstrumentation } = require('@opentelemetry/instrumentation-winston');
145-
>const { registerInstrumentations } = require('@opentelemetry/instrumentation');
146-
>registerInstrumentations({
147-
> instrumentations: [
148-
> new WinstonInstrumentation({
149-
> // Disable the duplicate logging from the auto instrumentation
150-
> disableLogSending: true
151-
> }),
152-
> ],
153-
>});
154-
>// Winston import must be after the WinstonInstrumentation creation
155-
>const { OpenTelemetryTransportV3 } = require('@opentelemetry/winston-transport');
156-
>const winston = require('winston');
145+
> const { WinstonInstrumentation } = require('@opentelemetry/instrumentation-winston');
146+
> const { registerInstrumentations } = require('@opentelemetry/instrumentation');
147+
> registerInstrumentations({
148+
> instrumentations: [
149+
> new WinstonInstrumentation({
150+
> disableLogSending: true
151+
> }),
152+
> ],
153+
> });
154+
> const { OpenTelemetryTransportV3 } = require('@opentelemetry/winston-transport');
155+
> // Winston import must be after the WinstonInstrumentation creation
156+
> const winston = require('winston');
157+
>
158+
> // ...
159+
> const logger = winston.createLogger(...);
157160
> ```
158161
159162
## Semantic Conventions

0 commit comments

Comments
 (0)