Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 895195b

Browse files
author
Amir Blum
authored
docs(amqplib): fix types of options in README (#86)
1 parent dfc298a commit 895195b

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

packages/instrumentation-amqplib/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ amqplib instrumentation has few options available to choose from. You can set th
3333

3434
| Options | Type | Description |
3535
| -------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------- |
36-
| `publishHook` | `strAmqplibPublishCustomAttributeFunctioning` | hook for adding custom attributes before publish message is sent |
36+
| `publishHook` | `AmqplibPublishCustomAttributeFunction` | hook for adding custom attributes before publish message is sent |
3737
| `consumeHook` | `AmqplibConsumerCustomAttributeFunction` | hook for adding custom attributes before consumer message is processed |
38-
| `consumeEndHook` | `strAmqplibPublishCustomAttributeFunctioning` | hook for adding custom attributes after consumer message is acked to server |
38+
| `consumeEndHook` | `AmqplibConsumerEndCustomAttributeFunction` | hook for adding custom attributes after consumer message is acked to server |
3939
| `moduleVersionAttributeName` | `string` | If passed, a span attribute will be added to all spans with key of the provided `moduleVersionAttributeName` and value of the patched module version |
4040
| `consumeTimeoutMs` | `number` | default is 1 minute. read [description below](#InstrumentationTimeout)|
4141
---

packages/instrumentation-amqplib/test/amqplib-promise.spec.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('amqplib instrumentation promise model', function () {
7676
await channel.purgeQueue(queueName);
7777
// install an error handler, otherwise when we have tests that create error on the channel,
7878
// it throws and crash process
79-
channel.on('error', () => {});
79+
channel.on('error', (err) => {});
8080
});
8181
afterEach(async () => {
8282
try {
@@ -331,9 +331,7 @@ describe('amqplib instrumentation promise model', function () {
331331
]);
332332
});
333333

334-
// what should we do in this case?
335-
// can cause memory leak since the plugin saves a copy of the msg which will never gets collected
336-
it('throw exception from consumer callback trigger timeout', async () => {
334+
it('not acking the message trigger timeout', async () => {
337335
instrumentation.disable();
338336
instrumentation.setConfig({
339337
consumeEndHook: endHookSpy,
@@ -343,15 +341,7 @@ describe('amqplib instrumentation promise model', function () {
343341

344342
lodash.times(1, () => channel.sendToQueue(queueName, Buffer.from(msgPayload)));
345343

346-
try {
347-
await asyncConsume(channel, queueName, [
348-
(msg) => {
349-
throw Error('error from unit test');
350-
},
351-
]);
352-
} catch (err) {
353-
// console.log(err);
354-
}
344+
await asyncConsume(channel, queueName, [null]);
355345

356346
// we have timeout of 1 ms, so we wait more than that and check span indeed ended
357347
await new Promise((resolve) => setTimeout(resolve, 10));

0 commit comments

Comments
 (0)