dd-trace
Version:
Datadog APM tracing client for JavaScript
24 lines (16 loc) • 509 B
JavaScript
const ClientPlugin = require('./client')
class StoragePlugin extends ClientPlugin {
static type = 'storage'
constructor (...args) {
super(...args)
this.system = this.constructor.system || this.component
}
startSpan (name, options, ctx) {
if (!options.service?.name && this.system) {
options.service = { name: `${this.tracer._service}-${this.system}`, source: this.system }
}
return super.startSpan(name, options, ctx)
}
}
module.exports = StoragePlugin