From 5ec1cb8ba500a5e26c73ff8c0124618fa4ca06cb Mon Sep 17 00:00:00 2001 From: William Conti Date: Thu, 25 Apr 2024 15:55:42 +0200 Subject: [PATCH] fix --- packages/dd-trace/src/plugins/database.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dd-trace/src/plugins/database.js b/packages/dd-trace/src/plugins/database.js index 74481927bee..108c66520b5 100644 --- a/packages/dd-trace/src/plugins/database.js +++ b/packages/dd-trace/src/plugins/database.js @@ -33,11 +33,11 @@ class DatabasePlugin extends StoragePlugin { this.encodingServiceTags('dde', 'encodedDde', this.tracer._env) this.encodingServiceTags('ddps', 'encodedDdps', this.tracer._service) this.encodingServiceTags('ddpv', 'encodedDdpv', this.tracer._version) - if (span._spanContext._tags['db.name']) { - this.encodingServiceTags('ddh', 'encodedDdh', this.tracer._version) - } if (span._spanContext._tags['out.host']) { - this.encodingServiceTags('dddb', 'encodedDddb', this.tracer._version) + this.encodingServiceTags('ddh', 'encodedDdh', span._spanContext._tags['out.host']) + } + if (span._spanContext._tags['db.name']) { + this.encodingServiceTags('dddb', 'encodedDddb', span._spanContext._tags['db.name']) } const { encodedDddb, encodedDddbs, encodedDde, encodedDdh, encodedDdps, encodedDdpv } = this.serviceTags