Skip to content

Commit

Permalink
feat(amqplib): cap supported versions to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir committed May 10, 2024
1 parent c1c3650 commit 9d76835
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-amqplib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-amqplib

## Supported Versions

- `>=0.5.5`
`>=0.5.5 <1`

## Usage

Expand Down
10 changes: 6 additions & 4 deletions plugins/node/instrumentation-amqplib/src/amqplib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ import {
} from './utils';
import { VERSION } from './version';

const supporterVersions = ['>=0.5.5 <1'];

export class AmqplibInstrumentation extends InstrumentationBase {
protected override _config!: AmqplibInstrumentationConfig;

Expand All @@ -92,28 +94,28 @@ export class AmqplibInstrumentation extends InstrumentationBase {
protected init() {
const channelModelModuleFile = new InstrumentationNodeModuleFile(
'amqplib/lib/channel_model.js',
['>=0.5.5'],
supporterVersions,
this.patchChannelModel.bind(this),
this.unpatchChannelModel.bind(this)
);

const callbackModelModuleFile = new InstrumentationNodeModuleFile(
'amqplib/lib/callback_model.js',
['>=0.5.5'],
supporterVersions,
this.patchChannelModel.bind(this),
this.unpatchChannelModel.bind(this)
);

const connectModuleFile = new InstrumentationNodeModuleFile(
'amqplib/lib/connect.js',
['>=0.5.5'],
supporterVersions,
this.patchConnect.bind(this),
this.unpatchConnect.bind(this)
);

const module = new InstrumentationNodeModuleDefinition(
'amqplib',
['>=0.5.5'],
supporterVersions,
undefined,
undefined,
[channelModelModuleFile, connectModuleFile, callbackModelModuleFile]
Expand Down

0 comments on commit 9d76835

Please sign in to comment.