Skip to content

Commit 2ada98a

Browse files
emmettbutlerwatson
andauthored
docs: recipe for new integrations [LANGPLAT-352] (#5984)
* recipe for new integrations * Update CONTRIBUTING.md Co-authored-by: Thomas Watson <thomas.watson@datadoghq.com> * Update CONTRIBUTING.md Co-authored-by: Thomas Watson <thomas.watson@datadoghq.com> * review feedback --------- Co-authored-by: Thomas Watson <thomas.watson@datadoghq.com>
1 parent 3da3ad9 commit 2ada98a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,28 @@ To install dependencies once you have Node and yarn installed, run this in the p
8989
$ yarn
9090
```
9191

92+
## Adding a Plugin
93+
94+
To create a new plugin for a third-party package, follow these steps:
95+
96+
1. `mkdir -p packages/datadog-plugin-<pluginname>/src`
97+
2. Copy an `index.js` file from another plugin to use as a starting point: `cp packages/datadog-plugin-kafkajs/src/index.js packages/datadog-plugin-<pluginname>/src`
98+
3. Edit index.js as appropriate for your new plugin
99+
4. `mkdir -p packages/datadog-plugin-<pluginname>/test`
100+
5. Create an packages/datadog-plugin-<pluginname>/test/index.spec.js file and add the necessary tests. See other plugin tests for inspiration to file structure.
101+
6. Edit index.spec.js as appropriate for your new plugin
102+
7. Add entries to the following files for your new plugin:
103+
- `packages/dd-trace/src/plugins/index.js`
104+
- `index.d.ts`
105+
- `docs/test.ts`
106+
- `docs/API.md`
107+
- `.github/workflows/apm-integrations.yml`
108+
109+
### Adding a Plugin Test to CI
110+
111+
The plugin tests run on pull requests in Github Actions. Each plugin test suite has its own Github job, so adding a new suite to CI
112+
requires adding a new job to the Github Actions config. The file containing these configs is `.github/workflows/apm-integrations.yml`.
113+
You can copypaste and modify an existing plugin job configuration in this file to create a new job config.
92114

93115
## Testing
94116

0 commit comments

Comments
 (0)