Skip to content
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

chore(otel-node): disable fastify instrumentation and update docs #616

Merged
merged 5 commits into from
Feb 19, 2025

Conversation

david-luna
Copy link
Member

@david-luna david-luna commented Feb 18, 2025

Adds @opentelemetry/instrumentation-fastify into the list of disabled instrumentations. It also places a new section in supported-tchnologies.md to let the user know which instrumentations are disabled and how to re-enable it.

Closes: #556

@david-luna david-luna requested a review from trentm February 18, 2025 12:00
@@ -70,6 +70,24 @@ requires:
| `@opentelemetry/instrumentation-undici` | `undici` version range `>=5.12.0` | [README](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-undici#readme) |
| `@opentelemetry/instrumentation-winston` | `winston` version range `>1 <4` | [README](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-winston#readme) |

### Disabled instrumentations

This Distro takes the upstream package `@opentelemetry/auto-instrumentations-node` as a baseline for technology support. This means additions or removals in its instrumentation list will be revised and usually applied here. As for now the list includes a couple of instrumentations that are disabled by default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested alternative:

The following instrumentations are included in EDOT Node.js, but *disabled by default*:

- `@opentelemetry/instrumentation-fs` (Disabled upstream in [open-telemetry/opentelemetry-js-contrib#2467](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2467).)
- `@opentelemetry/instrumentation-fastify` (Deprecated upstream and slated for removal. See [open-telemetry/opentelemetry-js-contrib#2652](https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2652))

To enable these instrumentations, use the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable, as documented [here in the OpenTelemetry documentation](https://opentelemetry.io/docs/zero-code/js/configuration/#excluding-instrumentation-libraries). Make sure you list all the instrumentations
you need for your service since only the ones in that list will be enabled. For example:

... the example code as you have it ...

EDOT Node.js uses the upstream [`@opentelemetry/auto-instrumentations-node` package's set of instrumentations](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/metapackages/auto-instrumentations-node/README.md#supported-instrumentations) as a guide for instrumentations to include, exclude, or disable by default. This is to maximize compatibility between usage of EDOT Node.js and the vanilla OpenTelemetry JS SDK.
  • I think we are meant to move away from "the Distro" to using "EDOT Node.js"
  • My re-ordering here was to put the "here is how it works and how to configure it" info first, and then finish with the justification/reasoning information.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. I'm going to change it in the next commit

Comment on lines 45 to 50
// ------ trace 9042af (3 spans) ------
// span 5894e1 "GET" (6.8ms, SPAN_KIND_CLIENT, GET http://localhost:3000/ping -> 200)
// +3ms `- span c793a1 "GET /ping" (2.7ms, SPAN_KIND_SERVER, GET http://localhost:3000/ping -> 200)
// ------ trace 8f3ed8 (3 spans) ------
// span 6e0fc9 "GET" (1.6ms, SPAN_KIND_CLIENT, GET http://localhost:3000/hi/Bob -> 200)
// +1ms `- span 40c4a8 "GET /hi/:name" (0.3ms, SPAN_KIND_SERVER, GET http://localhost:3000/hi/Bob -> 200)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is misleading. The expected server spans do NOT have the route info.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it

@david-luna david-luna requested a review from trentm February 19, 2025 08:17
Comment on lines 80 to 81
To enable these instrumentations, use the `OTEL_NODE_ENABLED_INSTRUMENTATIONS` environment variable, as documented [here in the OpenTelemetry documentation](https://opentelemetry.io/docs/zero-code/js/configuration/#excluding-instrumentation-libraries). Make sure you list all the instrumentations
you need for your service since only the ones in that list will be enabled. For example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: join these lines. Given we are using GH to show/render our docs, GitHub uses the line breaks.

@david-luna david-luna merged commit 59bc9b0 into main Feb 19, 2025
9 checks passed
@david-luna david-luna deleted the dluna-disable-fastify branch February 19, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

decide what to do for fastify auto-instrumentation
2 participants