|
| 1 | +# Migrate Instrumentation Library to contrib Repo |
| 2 | + |
| 3 | +## Copy Other Instrumentation as Template |
| 4 | +Copy existing instrumentation from `plugins/node` directory (you can use `instrumentation-mongoose` as tamplate) |
| 5 | + |
| 6 | +- update `package.json` to your instrumentation library (including `name`, `dependencies`, `sciprts`, `homepage`, `keywords` and anything else that might be related |
| 7 | + |
| 8 | +- update `README.md`. use the contrib template as it's different from `ext-js` template, and just update all the text and links according to your instrumentation. |
| 9 | + |
| 10 | +- `rm CHANGELOG.md`. It will be auto generated on next release. |
| 11 | + |
| 12 | +## src and test Directory |
| 13 | +``` |
| 14 | +mkdir src |
| 15 | +mkdir test |
| 16 | +``` |
| 17 | +Copy instrumentation files to `src` and `test` directories and apply changes to make `yarn compile` and `yarn lint:fix` pass successfully. |
| 18 | + |
| 19 | +You should apply the following changes to the files: |
| 20 | +- Don't use `moduleVersionAttributeName` from config. Store the value in an hook to make it accessible. |
| 21 | +- Use `fooInfo` for hooks configuration. e.g don't use many parameters to hook function signature, use just one paraameter and store everything inside. |
| 22 | +- Document any breaking changes in the README |
| 23 | +- use the new package name in instrumentation constructor |
| 24 | + |
| 25 | +## Test All Versions |
| 26 | +If missing, add `.tav.yaml` file and verify `yarn test-all-versions` succeeded for all versions. Check if a new version not in tav is available. |
| 27 | + |
| 28 | +Also check that tav config is aligned with version in instrumentation constructor |
| 29 | + |
| 30 | +## auto-instrumentation-node |
| 31 | +Add the instrumentation to auto-instrumentation-node package. |
| 32 | +Make sure you add it in all relevant places: `package.json`, `src`, `test`, `release-please-config.json`, `.release-please-manifest.json` and that test is green for the auto instrumentation package. |
| 33 | + |
| 34 | +## Component Owner |
| 35 | +Add your name in `.github/component_owners.yml` file. |
0 commit comments