Skip to content

Commit

Permalink
chore: fixed typos and simplified bundle check
Browse files Browse the repository at this point in the history
  • Loading branch information
kirrg001 committed Aug 24, 2024
1 parent 7b945bd commit 54d446a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/aws-lambda/src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ function postHandler(entrySpan, error, result, callback) {
// When the Lambda handler finishes we send all spans via `sendBundle`.
// If there is any span collected afterwards (async operations), we send them out
// directly and that's why we set `setTransmitImmediate` to true.
// We need to rework the default behavior via https://jsw.ibm.com/browse/INSTA-13498
spanBuffer.setTransmitImmediate(true);

const metricsData = metrics.gatherData();
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-lambda/test/multiple_data/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('multiple data lambda handler', function () {
control.getRawBundles(),
control.getRawSpanArrays()
]).then(([spans, rawBundles, rawSpanArrays]) => {
// 1 X bundle requestat the end of the lambda fn
// 1 X bundle request at the end of the lambda fn
expect(rawBundles.length).to.equal(1);

// All spans are sent at the end of the lambda fn
Expand Down
4 changes: 1 addition & 3 deletions packages/serverless/src/backend_connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ exports.setLogger = function setLogger(_logger) {
* the variable is always true.
*/
exports.sendBundle = function sendBundle(bundle, finalLambdaRequest, callback) {
logger.debug(
`Sending bundle to Instana (no. of spans: ${(bundle && bundle.spans && bundle.spans.length) || 'unknown'})`
);
logger.debug(`Sending bundle to Instana (no. of spans: ${bundle?.spans?.length ?? 'unknown'})`);

send('/bundle', bundle, finalLambdaRequest, callback);
};
Expand Down

0 comments on commit 54d446a

Please sign in to comment.