Skip to content

Commit

Permalink
tracking open spans (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed Sep 16, 2022
1 parent e804671 commit babb279
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/dd-trace/src/opentracing/span.js
Expand Up @@ -44,6 +44,9 @@ class DatadogSpan {
metrics.increment('runtime.node.spans.unfinished')
metrics.increment('runtime.node.spans.unfinished.by.name', `span_name:${operationName}`)

metrics.increment('runtime.node.spans.open') // unfinished for real
metrics.increment('runtime.node.spans.open.by.name', `span_name:${operationName}`)

unfinishedRegistry.register(this, operationName, this)
}
}
Expand Down Expand Up @@ -121,6 +124,9 @@ class DatadogSpan {
metrics.increment('runtime.node.spans.finished')
metrics.increment('runtime.node.spans.finished.by.name', `span_name:${this._name}`)

metrics.decrement('runtime.node.spans.open') // unfinished for real
metrics.decrement('runtime.node.spans.open.by.name', `span_name:${this._name}`)

unfinishedRegistry.unregister(this)
finishedRegistry.register(this, this._name)
}
Expand Down

0 comments on commit babb279

Please sign in to comment.