Skip to content

Commit

Permalink
Merge branch 'main' into cloudwatch-metrics-example
Browse files Browse the repository at this point in the history
  • Loading branch information
anitarua committed Nov 1, 2023
2 parents 958f459 + 45a0049 commit 3aa686c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export abstract class ExperimentalMetricsMiddlewareRequestHandler

onRequestBody(request: MiddlewareMessage): Promise<MiddlewareMessage> {
this.requestSize = request.messageLength();
this.requestType = request.constructor.name;
this.requestType = request._grpcMessage.constructor.name;
this.requestBodyTime = new Date().getTime();
return Promise.resolve(request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export class MiddlewareMessage {
}

messageLength(): number {
return this._grpcMessage.serializeBinary().length;
if (this._grpcMessage !== null && this._grpcMessage !== undefined) {
return this._grpcMessage.serializeBinary().length;
}
return 0;
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/client-sdk-nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export {

export {ExperimentalRequestLoggingMiddleware} from './config/middleware/experimental-request-logging-middleware';
export {ExperimentalMetricsCsvMiddleware} from './config/middleware/experimental-metrics-csv-middleware';
export {ExperimentalMetricsLoggingMiddleware} from './config/middleware/experimental-metrics-logging-middleware';

Check failure on line 203 in packages/client-sdk-nodejs/src/index.ts

View workflow job for this annotation

GitHub Actions / Test on Node 18

Multiple exports of name 'ExperimentalMetricsLoggingMiddleware'
export {ExampleAsyncMiddleware} from './config/middleware/example-async-middleware';
export {ExperimentalMetricsLoggingMiddleware} from './config/middleware/experimental-metrics-logging-middleware';

Check failure on line 205 in packages/client-sdk-nodejs/src/index.ts

View workflow job for this annotation

GitHub Actions / Test on Node 18

Multiple exports of name 'ExperimentalMetricsLoggingMiddleware'

Expand Down

0 comments on commit 3aa686c

Please sign in to comment.