Skip to content

Mongoose v7 not actually supported by @opentelemetry/instrumentation-mongoose #2568

@mkohlmyr

Description

@mkohlmyr

this._wrap(
moduleExports.Aggregate.prototype,
'exec',
this.patchAggregateExec(moduleVersion)
);

Mongoose v7 does not appear to export .Aggregate which results in Cannot read properties of undefined (reading 'prototype').

The documentation states:

Supported Versions
mongoose versions >=5.9.7 <9

If this is intended to be the case, then wrapping of Aggregate will need to be optional or version dependent similar to instrumentRemove.

Would be happy to provide a patch if you agree this is the case, but might need to wait a few days as I first have to patch this internally somehow for our Sentry integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions