elastic / elastic/apm-agent-nodejs
Add instrumentation in libary vs. using `addPatch`?
Open
agent-nodejs
- Dominant language
- JavaScript
- Stars
- 594
- Forks
- 244
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Description
I am currently trying to understand what would be the best way to add instrumentation for a database library, that I have access to:
a) Should we add some instrumentation code that starts and ends spans in our library
or
b) should we monkey patch our library via `addPatch` only when we actually want to instrument it?
Also, are there examples for both alternatives?
I found multiple PRs like https://github.com/elastic/apm-agent-nodejs/pull/1144/files that add support for a library here in the package itself, but that seems overkill for our custom library.
Thanks.
Contributor guide
Assessment
This issue has not been assessed yet.