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

feat(node): Add fsInstrumentation #13291

Merged
merged 4 commits into from
Aug 9, 2024
Merged

feat(node): Add fsInstrumentation #13291

merged 4 commits into from
Aug 9, 2024

Conversation

lforst
Copy link
Member

@lforst lforst commented Aug 9, 2024

Resolves #13057

This PR adds an integration to instrument fs API. We are using OTEL's @opentelemetry/instrumentation-fs instrumentation under the hood.

The integration creates spans with naming patterns of fs.readFile, fs.unlink, and so on.

Users can configure via option whether they want to include path arguments as attributes, and whether to include error messages as an attribute when an fs call fails.

I have found that the integration can slow down applications massively when there are a lot of fs calls, for example when running a dev server - so I put a disclaimer in the JS doc, and we should also put a similar disclaimer in the docs when we write them.

@lforst lforst marked this pull request as ready for review August 9, 2024 09:46
@lforst lforst requested review from mydea, AbhiPrasad and s1gr1d August 9, 2024 09:47
@@ -0,0 +1,11 @@
some-file.txt.copy
Copy link
Member

Choose a reason for hiding this comment

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

Can we just make this: some-file.txt.* ?

Copy link
Member

Choose a reason for hiding this comment

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

and maybe move them out of the root of the package, into e.g. fixtures/ or something like this?

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

nice!

@lforst lforst merged commit 2a1d8ee into develop Aug 9, 2024
126 checks passed
@lforst lforst deleted the lforst-fs-instrumentation branch August 9, 2024 11:32
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.

Add opt-in instrumentation for fs
2 participants