pinpoint-node-agent
Version:
Pinpoint APM agent for Node.js — distributed tracing, error analysis, and URI statistics
30 lines (23 loc) • 871 B
JavaScript
/**
* Pinpoint Node.js Agent
* Copyright 2020-present NAVER Corp.
* Apache License v2.0
*/
const { SpanRecorderFactory } = require('../../context/trace/span-recorder-factory')
const { SpanRecorderEnricher } = require('./span-recorder-enricher')
class UriStatsSpanRecorderFactory extends SpanRecorderFactory {
constructor(config, uriStatsConfig) {
super(config)
this.uriStatsConfig = uriStatsConfig
}
create(spanBuilder) {
const spanRecorder = super.create(spanBuilder)
return new SpanRecorderEnricher(spanRecorder, this.uriStatsConfig, spanBuilder.getTraceRoot())
}
createDisable(traceRoot) {
const spanRecorder = super.createDisable(traceRoot)
return new SpanRecorderEnricher(spanRecorder, this.uriStatsConfig, traceRoot)
}
}
module.exports = { UriStatsSpanRecorderFactory }