Skip to content

Commit 7158625

Browse files
committed
feat: move to redis from ioredis per connect-redis
1 parent f11ee77 commit 7158625

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

__tests__/vitest.test-setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { afterAll, beforeAll } from 'vitest';
22

3-
import { shutdownGlobalTelemetry, startGlobalTelemetry } from '../src/telemetry';
3+
import { shutdownGlobalTelemetry, startGlobalTelemetry } from '../src/telemetry/index.js';
44

55
// Even in testing, this needs to run first so that the instrumentation
66
// is loaded BEFORE express is loaded.
@@ -11,5 +11,5 @@ beforeAll(async () => {
1111
});
1212

1313
afterAll(async () => {
14-
await shutdownGlobalTelemetry();
14+
await shutdownGlobalTelemetry().catch(() => undefined);
1515
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
"@opentelemetry/instrumentation-generic-pool": "^0.51.0",
7878
"@opentelemetry/instrumentation-graphql": "^0.55.0",
7979
"@opentelemetry/instrumentation-http": "^0.207.0",
80-
"@opentelemetry/instrumentation-ioredis": "^0.55.0",
8180
"@opentelemetry/instrumentation-net": "^0.51.0",
8281
"@opentelemetry/instrumentation-pg": "^0.60.0",
8382
"@opentelemetry/instrumentation-pino": "^0.54.0",
83+
"@opentelemetry/instrumentation-redis": "^0.56.0",
8484
"@opentelemetry/instrumentation-undici": "^0.18.0",
8585
"@opentelemetry/resource-detector-container": "^0.7.10",
8686
"@opentelemetry/resource-detector-gcp": "^0.42.0",

src/express-app/app.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ export async function listen<SLocals extends AnyServiceLocals = ServiceLocals<Co
380380
shutdownInProgress = true;
381381
app.locals.logger.info('Shutdown requested');
382382
if (app.locals.internalApp) {
383-
app.locals.internalApp.locals.server?.close();
383+
if (app.locals.internalApp.locals.server?.listening) {
384+
app.locals.internalApp.locals.server?.close();
385+
}
384386
}
385387
shutdownApp(app);
386388
}

src/telemetry/instrumentations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
HttpInstrumentation,
88
IgnoreIncomingRequestFunction,
99
} from '@opentelemetry/instrumentation-http';
10-
import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
10+
import { RedisInstrumentation } from '@opentelemetry/instrumentation-redis';
1111
import { NetInstrumentation } from '@opentelemetry/instrumentation-net';
1212
import { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';
1313
import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
@@ -20,7 +20,7 @@ const InstrumentationMap = {
2020
'@opentelemetry/instrumentation-graphql': GraphQLInstrumentation,
2121
'@opentelemetry/instrumentation-undici': UndiciInstrumentation,
2222
'@opentelemetry/instrumentation-generic-pool': GenericPoolInstrumentation,
23-
'@opentelemetry/instrumentation-ioredis': IORedisInstrumentation,
23+
'@opentelemetry/instrumentation-redis': RedisInstrumentation,
2424
'@opentelemetry/instrumentation-net': NetInstrumentation,
2525
'@opentelemetry/instrumentation-pg': PgInstrumentation,
2626
'@opentelemetry/instrumentation-pino': PinoInstrumentation,

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,10 @@ __metadata:
806806
"@opentelemetry/instrumentation-generic-pool": ^0.51.0
807807
"@opentelemetry/instrumentation-graphql": ^0.55.0
808808
"@opentelemetry/instrumentation-http": ^0.207.0
809-
"@opentelemetry/instrumentation-ioredis": ^0.55.0
810809
"@opentelemetry/instrumentation-net": ^0.51.0
811810
"@opentelemetry/instrumentation-pg": ^0.60.0
812811
"@opentelemetry/instrumentation-pino": ^0.54.0
812+
"@opentelemetry/instrumentation-redis": ^0.56.0
813813
"@opentelemetry/instrumentation-undici": ^0.18.0
814814
"@opentelemetry/resource-detector-container": ^0.7.10
815815
"@opentelemetry/resource-detector-gcp": ^0.42.0

0 commit comments

Comments
 (0)