From 7e7cade5ab0b3867bdf7ef9c1c74da1a3f056bd5 Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Fri, 20 Sep 2019 01:22:42 -0700 Subject: [PATCH] feat: use external as span type (#1291) Rather than the shortened `ext` use full `external` in span types. Fixes #1225 BREAKING CHANGE: All `ext.*` span types have been renamed to `external.*`. --- lib/instrumentation/http-shared.js | 2 +- lib/instrumentation/modules/http2.js | 2 +- test/instrumentation/modules/elasticsearch.js | 2 +- test/instrumentation/modules/http2.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/instrumentation/http-shared.js b/lib/instrumentation/http-shared.js index c708b07765..cb3a70bda4 100644 --- a/lib/instrumentation/http-shared.js +++ b/lib/instrumentation/http-shared.js @@ -109,7 +109,7 @@ function ensureUrl (v) { } exports.traceOutgoingRequest = function (agent, moduleName, method) { - var spanType = 'ext.' + moduleName + '.http' + var spanType = 'external.' + moduleName + '.http' var ins = agent._instrumentation return function (orig) { diff --git a/lib/instrumentation/modules/http2.js b/lib/instrumentation/modules/http2.js index fa3398ec6b..51d052d1d4 100644 --- a/lib/instrumentation/modules/http2.js +++ b/lib/instrumentation/modules/http2.js @@ -144,7 +144,7 @@ module.exports = function (http2, agent, { enabled }) { function wrapRequest (orig, host) { return function (headers) { - var span = agent.startSpan(null, 'ext.http2') + var span = agent.startSpan(null, 'external.http2') var id = span && span.transaction.id agent.logger.debug('intercepted call to http2.request %o', { id }) diff --git a/test/instrumentation/modules/elasticsearch.js b/test/instrumentation/modules/elasticsearch.js index 5b6f1deafa..6497d745c6 100644 --- a/test/instrumentation/modules/elasticsearch.js +++ b/test/instrumentation/modules/elasticsearch.js @@ -179,7 +179,7 @@ function done (t, method, path, query) { let span1, span2 { - const type = 'ext.http.http' + const type = 'external.http.http' span1 = findObjInArray(data.spans, 'type', type) t.ok(span1, 'should have span with type ' + type) } { diff --git a/test/instrumentation/modules/http2.js b/test/instrumentation/modules/http2.js index 3a43f3b1ed..b323b2c6e1 100644 --- a/test/instrumentation/modules/http2.js +++ b/test/instrumentation/modules/http2.js @@ -284,7 +284,7 @@ isSecure.forEach(secure => { var span = findObjInArray(data.spans, 'transaction_id', root.id) t.ok(span, 'root transaction should have span') - t.equal(span.type, 'ext.http2') + t.equal(span.type, 'external.http2') t.equal(span.name, `undefined http${secure ? 's' : ''}://localhost:${port}/sub`) server.close()