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

fix: loading of mongoose instrumentation due to invalid package name #715

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/instrumentations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const bundledInstrumentations: [string, string][] = [
['@opentelemetry/instrumentation-koa', 'KoaInstrumentation'],
['@opentelemetry/instrumentation-memcached', 'MemcachedInstrumentation'],
['@opentelemetry/instrumentation-mongodb', 'MongoDBInstrumentation'],
['@opentelemetry/instrumentation-mongoose', 'MongooseInstrumentation'],
['@opentelemetry/instrumentation-mysql', 'MySQLInstrumentation'],
['@opentelemetry/instrumentation-mysql2', 'MySQL2Instrumentation'],
['@opentelemetry/instrumentation-nestjs-core', 'NestInstrumentation'],
Expand All @@ -56,7 +57,6 @@ const bundledInstrumentations: [string, string][] = [
'ElasticsearchInstrumentation',
],
['opentelemetry-instrumentation-kafkajs', 'KafkaJsInstrumentation'],
['opentelemetry-instrumentation-mongoose', 'MongooseInstrumentation'],
['opentelemetry-instrumentation-sequelize', 'SequelizeInstrumentation'],
['opentelemetry-instrumentation-typeorm', 'TypeormInstrumentation'],
];
Expand Down
11 changes: 2 additions & 9 deletions test/instrumentations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import * as sinon from 'sinon';
import * as assert from 'assert';
import * as rewire from 'rewire';

Expand All @@ -23,14 +22,8 @@ import * as loader from '../src/instrumentations/loader';

describe('instrumentations', () => {
it('loads instrumentations if they are installed', () => {
const loadStub = sinon.stub(loader, 'load');
try {
const inst = instrumentations.getInstrumentations();
sinon.assert.callCount(loadStub, 36);
} finally {
loadStub.reset();
loadStub.restore();
}
const loadedInstrumentations = instrumentations.getInstrumentations();
assert.equal(loadedInstrumentations.length, 36);
});

it('loader silently fails when instrumentation is not installed', () => {
Expand Down