Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions scripts/registry-scanner/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (process.argv.length < 3) {
`USAGE: ${path.basename(process.argv[0])} ${path.basename(
process.argv[1],
)} <list>
<list> is a comma separated list of the following options:
<list> is a comma separated list of the following options:
- collector
- python
- ruby
Expand All @@ -63,7 +63,7 @@ if (process.argv.length < 3) {
- php
- go
Use 'all' if you want to run all of them (except go).

Example: ${path.basename(process.argv[0])} ${path.basename(
process.argv[1],
)} python,ruby,erlang`,
Expand All @@ -80,12 +80,21 @@ const scanners = {
);
},
js: () => {
scanByLanguage('instrumentation', 'js', 'plugins/node');
scanByLanguage(
'resource-detector',
'instrumentation',
'js',
'detectors/node',
'packages',
'md',
'opentelemetry-js-contrib',
(pkg) => pkg.name.startsWith('instrumentation-'),
);
scanByLanguage(
'resource-detector',
'js',
'packages',
'md',
'opentelemetry-js-contrib',
(pkg) => pkg.name.startsWith('resource-detector-'),
);
},
java: () => {
Expand Down Expand Up @@ -305,13 +314,14 @@ async function scanByLanguage(
x
.split(/[_-]/)
.filter(
// TODO: This filter doesn't handle skipping registryType='resource-detector'.
(y) =>
!['opentelemetry', registryType].includes(y) &&
!y.match(/^[0-9]+.[0-9]+$/),
)
.join(''),
) {
// https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/
// https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/
const found = await scanForNew(path, repo, filter, keyMapper);
const existing = await scanForExisting(`${registryType}-${language}`);
createFilesFromScanResult(existing, found, {
Expand Down