@mwcp/otel
Version:
midway component for open telemetry
23 lines (14 loc) • 481 B
text/typescript
import assert from 'node:assert'
import { Provide } from '@midwayjs/core'
import { MConfig } from '@mwcp/share'
import { Trace } from '##/lib/index.js'
import { Config, ConfigKey } from '##/lib/types.js'
()
export class DefaultOtelComponentService {
(ConfigKey.config) readonly config: Config
({ startActiveSpan: false })
async hello(input: string): Promise<string> {
assert(typeof this.config.enable !== 'undefined')
return input
}
}