From 8186fbdffe1c53543d60a8db037c601d87a7304e Mon Sep 17 00:00:00 2001 From: William Conti Date: Thu, 19 Sep 2024 16:47:49 -0400 Subject: [PATCH] ensure shcmeas only added if dsm is enabled --- packages/datadog-plugin-protobufjs/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datadog-plugin-protobufjs/src/index.js b/packages/datadog-plugin-protobufjs/src/index.js index 0ef40bb2d63..e11170862ab 100644 --- a/packages/datadog-plugin-protobufjs/src/index.js +++ b/packages/datadog-plugin-protobufjs/src/index.js @@ -18,7 +18,7 @@ class ProtobufjsPlugin extends Plugin { handleSerializeStart ({ message }) { const activeSpan = this.tracer.scope().active() - if (activeSpan) { + if (activeSpan && this.config.dsmEnabled) { SchemaExtractor.attachSchemaOnSpan( message.$type ?? message, activeSpan, SERIALIZATION, this.tracer._dataStreamsProcessor ) @@ -27,7 +27,7 @@ class ProtobufjsPlugin extends Plugin { handleDeserializeFinish ({ message }) { const activeSpan = this.tracer.scope().active() - if (activeSpan) { + if (activeSpan && this.config.dsmEnabled) { SchemaExtractor.attachSchemaOnSpan(message.$type, activeSpan, DESERIALIZATION, this.tracer._dataStreamsProcessor) } }