Skip to content

Commit c8daa63

Browse files
feat: add firestore v8 support (#126)
1 parent cae3367 commit c8daa63

27 files changed

Lines changed: 79 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Tusk Drift currently supports the following packages and versions:
4545
- **HTTP/HTTPS**: All versions (Node.js built-in)
4646
- **GRPC**: `@grpc/grpc-js@1.x` (Outbound requests only)
4747
- **PG**: `pg@8.x`, `pg-pool@2.x-3.x`
48-
- **Firestore**: `@google-cloud/firestore@7.x`
48+
- **Firestore**: `@google-cloud/firestore@7.x-8.x`
4949
- **Postgres**: `postgres@3.x`
5050
- **MySQL**: `mysql2@3.x`, `mysql@2.x`
5151
- **IORedis**: `ioredis@4.x-5.x`

src/instrumentation/libraries/fetch/e2e-tests/cjs-fetch/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ services:
2929
- ./src:/app/src
3030
# Mount .tusk config (but traces/logs are created inside container)
3131
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
32+
# Persist traces and logs on host
33+
- ./.tusk/traces:/app/.tusk/traces
34+
- ./.tusk/logs:/app/.tusk/logs
3235
depends_on:
3336
- mock-upstream
3437
working_dir: /app

src/instrumentation/libraries/fetch/e2e-tests/esm-fetch/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ services:
2727
- ../../../../../..:/sdk:ro
2828
# Mount .tusk config
2929
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
30+
# Persist traces and logs on host
31+
- ./.tusk/traces:/app/.tusk/traces
32+
- ./.tusk/logs:/app/.tusk/logs
3033
# Mount app source for development
3134
- ./src:/app/src
3235
depends_on:

src/instrumentation/libraries/firestore/Instrumentation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { TdFirestoreWriteResultMock } from "./mocks/TdFirestoreWriteResultMock";
2020
import { PackageType } from "@use-tusk/drift-schemas/core/span";
2121
import { logger } from "../../../core/utils/logger";
2222

23-
const FIRESTORE_VERSION = "7.*";
23+
const FIRESTORE_VERSIONS = ["7.*", "8.*"];
2424
const PACKAGE_NAME = "@google-cloud/firestore";
2525

2626
export class FirestoreInstrumentation extends TdInstrumentationBase {
@@ -39,24 +39,24 @@ export class FirestoreInstrumentation extends TdInstrumentationBase {
3939
return [
4040
new TdInstrumentationNodeModule({
4141
name: PACKAGE_NAME,
42-
supportedVersions: [FIRESTORE_VERSION],
42+
supportedVersions: FIRESTORE_VERSIONS,
4343
files: [
4444
// Patch DocumentReference methods
4545
new TdInstrumentationNodeModuleFile({
4646
name: "@google-cloud/firestore/build/src/reference/document-reference.js",
47-
supportedVersions: [FIRESTORE_VERSION],
47+
supportedVersions: FIRESTORE_VERSIONS,
4848
patch: (moduleExports: any) => this._patchDocumentReference(moduleExports),
4949
}),
5050
// Patch CollectionReference methods
5151
new TdInstrumentationNodeModuleFile({
5252
name: "@google-cloud/firestore/build/src/reference/collection-reference.js",
53-
supportedVersions: [FIRESTORE_VERSION],
53+
supportedVersions: FIRESTORE_VERSIONS,
5454
patch: (moduleExports: any) => this._patchCollectionReference(moduleExports),
5555
}),
5656
// Patch Query methods
5757
new TdInstrumentationNodeModuleFile({
5858
name: "@google-cloud/firestore/build/src/reference/query.js",
59-
supportedVersions: [FIRESTORE_VERSION],
59+
supportedVersions: FIRESTORE_VERSIONS,
6060
patch: (moduleExports: any) => this._patchQuery(moduleExports),
6161
}),
6262
],

src/instrumentation/libraries/firestore/e2e-tests/cjs-firestore/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ services:
1919
- ../../../../../..:/sdk:ro
2020
# Mount .tusk config
2121
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
22+
# Persist traces and logs on host
23+
- ./.tusk/traces:/app/.tusk/traces
24+
- ./.tusk/logs:/app/.tusk/logs
2225
# Mount app source for development
2326
- ./src:/app/src
2427
working_dir: /app

src/instrumentation/libraries/firestore/e2e-tests/esm-firestore/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ services:
1919
- ../../../../../..:/sdk:ro
2020
# Mount .tusk config
2121
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
22+
# Persist traces and logs on host
23+
- ./.tusk/traces:/app/.tusk/traces
24+
- ./.tusk/logs:/app/.tusk/logs
2225
# Mount app source for development
2326
- ./src:/app/src
2427
working_dir: /app

src/instrumentation/libraries/firestore/e2e-tests/esm-firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@use-tusk/drift-node-sdk": "file:/sdk",
14-
"@google-cloud/firestore": "^7.0.0",
14+
"@google-cloud/firestore": "8.3.0",
1515
"express": "^4.18.2"
1616
},
1717
"devDependencies": {

src/instrumentation/libraries/grpc/e2e-tests/cjs-grpc/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ services:
1818
- ../../../../../..:/sdk:ro
1919
# Mount .tusk folder to persist traces
2020
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
21+
# Persist traces and logs on host
22+
- ./.tusk/traces:/app/.tusk/traces
23+
- ./.tusk/logs:/app/.tusk/logs
2124
# Mount app source for development
2225
- ./src:/app/src
2326
working_dir: /app

src/instrumentation/libraries/grpc/e2e-tests/esm-grpc/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ services:
1818
- ../../../../../..:/sdk:ro
1919
# Mount .tusk folder to persist traces
2020
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
21+
# Persist traces and logs on host
22+
- ./.tusk/traces:/app/.tusk/traces
23+
- ./.tusk/logs:/app/.tusk/logs
2124
# Mount app source for development
2225
- ./src:/app/src
2326
working_dir: /app

src/instrumentation/libraries/http/e2e-tests/cjs-http/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ services:
3131
- ./src:/app/src
3232
# Mount .tusk config (but traces/logs are created inside container)
3333
- ./.tusk/config.yaml:/app/.tusk/config.yaml:ro
34+
# Persist traces and logs on host
35+
- ./.tusk/traces:/app/.tusk/traces
36+
- ./.tusk/logs:/app/.tusk/logs
3437
depends_on:
3538
- mock-upstream
3639
working_dir: /app

0 commit comments

Comments
 (0)