Skip to content

Commit

Permalink
new global axios monitoring api
Browse files Browse the repository at this point in the history
  • Loading branch information
dawkaka committed Jun 8, 2024
1 parent a3318aa commit 0a8276e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/apitoolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ export type Config = {
clientMetadata?: ClientMetadata;
serviceVersion?: string;
tags?: string[];
moitorAxios?: AxiosInstance;
monitorAxios?: {
axios: AxiosInstance;
redactHeaders: string[];
redactResponseBody: string[];
redactRequestBody: string[];
};
};

type ClientMetadata = {
Expand Down Expand Up @@ -94,8 +99,9 @@ export class APIToolkit {
}
}
};
if (config.moitorAxios) {
observeAxiosGlobal(config.moitorAxios as any);
if (config.monitorAxios) {
const { axios, redactHeaders, redactRequestBody, redactResponseBody } = config.monitorAxios;
observeAxiosGlobal(axios as any, undefined, redactHeaders, redactRequestBody, redactResponseBody, false, this);

Check failure on line 104 in src/apitoolkit.ts

View workflow job for this annotation

GitHub Actions / build

Expected 1-6 arguments, but got 7.
}
this.expressMiddleware = this.expressMiddleware.bind(this);
}
Expand Down

0 comments on commit 0a8276e

Please sign in to comment.