Skip to content

Commit

Permalink
fix(serverless): do not send x-instana-time header
Browse files Browse the repository at this point in the history
This header is not actually required when sending data to the Instana
back end.
  • Loading branch information
basti1302 committed Oct 17, 2022
1 parent 9d72c1b commit 7ce7673
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/aws-fargate/test/integration_test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ describe('AWS fargate integration test', function () {
expect(headers).to.exist;
expect(headers['x-instana-host']).to.equal(taskArn);
expect(headers['x-instana-key']).to.equal(instanaAgentKey);
expect(headers['x-instana-time']).to.be.a('string');
expect(headers['x-instana-time']).to.not.exist;
}

function verifyNoSpansAndMetrics(control) {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-fargate/test/using_api/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('Using the API', function () {
expect(headers).to.exist;
expect(headers['x-instana-host']).to.equal(taskArn);
expect(headers['x-instana-key']).to.equal(instanaAgentKey);
expect(headers['x-instana-time']).to.be.a('string');
expect(headers['x-instana-time']).to.not.exist;
}

function verifyNoOp(control, response) {
Expand Down
3 changes: 1 addition & 2 deletions packages/aws-lambda/test/infra-mock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ function sendPayload(callback) {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(payload),
[constants.xInstanaHost]: 'some-random-host-that-runs-the-aws-agent',
[constants.xInstanaKey]: instanaKey,
[constants.xInstanaTime]: Date.now()
[constants.xInstanaKey]: instanaKey
},
rejectUnauthorized: !disableCaCheck
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ function registerTests(handlerDefinitionPath) {
expect(headers).to.exist;
expect(headers['x-instana-host']).to.equal(qualifiedArn);
expect(headers['x-instana-key']).to.equal(instanaAgentKey);
expect(headers['x-instana-time']).to.be.a('string');
expect(headers['x-instana-time']).to.not.exist;
}

function getHeaderCaseInsensitive(headers, header) {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-lambda/test/using_api/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,6 @@ describe('Using the API', () => {
expect(headers).to.exist;
expect(headers['x-instana-host']).to.equal(qualifiedArn);
expect(headers['x-instana-key']).to.equal(instanaAgentKey);
expect(headers['x-instana-time']).to.be.a('string');
expect(headers['x-instana-time']).to.not.exist;
}
});
2 changes: 1 addition & 1 deletion packages/google-cloud-run/test/integration_test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ describe('Google Cloud Run integration test', function () {
expect(headers).to.exist;
expect(headers['x-instana-host']).to.equal(host);
expect(headers['x-instana-key']).to.equal(instanaAgentKey);
expect(headers['x-instana-time']).to.be.a('string');
expect(headers['x-instana-time']).to.not.exist;
}

function verifyNoSpansAndMetrics(control) {
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-run/test/using_api/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('Using the API', function () {
expect(headers).to.exist;
expect(headers['x-instana-host']).to.equal(host);
expect(headers['x-instana-key']).to.equal(instanaAgentKey);
expect(headers['x-instana-time']).to.be.a('string');
expect(headers['x-instana-time']).to.not.exist;
}

function verifyNoOp(control, response) {
Expand Down
3 changes: 1 addition & 2 deletions packages/serverless/src/backend_connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ function send(resourcePath, payload, finalLambdaRequest, callback) {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(serializedPayload),
[constants.xInstanaHost]: hostHeader,
[constants.xInstanaKey]: environmentUtil.getInstanaAgentKey(),
[constants.xInstanaTime]: Date.now()
[constants.xInstanaKey]: environmentUtil.getInstanaAgentKey()
},
rejectUnauthorized: !disableCaCheck
};
Expand Down
1 change: 0 additions & 1 deletion packages/serverless/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@

exports.xInstanaHost = 'x-instana-host';
exports.xInstanaKey = 'x-instana-key';
exports.xInstanaTime = 'x-instana-time';

0 comments on commit 7ce7673

Please sign in to comment.