Skip to content

Commit

Permalink
ensure shcmeas only added if dsm is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
wconti27 committed Sep 19, 2024
1 parent be68bd5 commit 8186fbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/datadog-plugin-protobufjs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 8186fbd

Please sign in to comment.