Skip to content

Commit

Permalink
fix: loading of mongoose instrumentation due to invalid package name (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk authored Apr 5, 2023
1 parent 86b0cdc commit 0120e7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
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

0 comments on commit 0120e7e

Please sign in to comment.