From 53084efd2ea799e983c1412ecf6ea0a6ba03d705 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 15 May 2019 18:52:51 +0000 Subject: [PATCH 1/2] fix(deps): update dependency @google-cloud/datastore to v4 --- system-test/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-test/package.json b/system-test/package.json index e44972cdb..1910f7b5f 100644 --- a/system-test/package.json +++ b/system-test/package.json @@ -2,7 +2,7 @@ "name": "trace-agent-system-test", "version": "1.0.0", "dependencies": { - "@google-cloud/datastore": "^3.0.0", + "@google-cloud/datastore": "^4.0.0", "express": "^4.16.3", "google-auto-auth": "^0.10.0", "got": "^8.0.0", From f1855f62dafa30fe0eab28afbfc70383cd802252 Mon Sep 17 00:00:00 2001 From: Kelvin Jin Date: Thu, 16 May 2019 11:22:03 -0700 Subject: [PATCH 2/2] test: expect http2 client span in system test --- system-test/trace-express.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system-test/trace-express.js b/system-test/trace-express.js index c746eafe1..5be9ec4b9 100644 --- a/system-test/trace-express.js +++ b/system-test/trace-express.js @@ -31,9 +31,10 @@ if (!process.env.GCLOUD_PROJECT || const WRITE_CONSISTENCY_DELAY_MS = 20 * 1000; const projectId = process.env.GCLOUD_PROJECT; const keyFilename = process.env.GOOGLE_APPLICATION_CREDENTIALS; +const EXPECTED_ENDPOINT = 'google.datastore.v1.Datastore/RunQuery'; // trace-agent must be loaded before everything else. -require('../').start({ +const tracer = require('../').start({ projectId: projectId, keyFilename: keyFilename, flushDelaySeconds: 1 @@ -142,8 +143,11 @@ describe('express + datastore', () => { const trace = traces[0]; assert.ok(trace.spans.length >= 2, 'should be at least 2 spans: parent, child'); const parent = trace.spans[0]; - const child = trace.spans.find(span => - span.name === 'grpc:/google.datastore.v1.Datastore/RunQuery'); + const child = trace.spans.find(span => { + const datastoreUrl = `https://datastore.googleapis.com/${EXPECTED_ENDPOINT}`; + return span.name === `grpc:/${EXPECTED_ENDPOINT}` || + span.labels[tracer.labels.HTTP_URL_LABEL_KEY] === datastoreUrl; + }); assert.strictEqual(parent.name, testPath, 'should match unique path'); assert.ok(child);