JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q34241F
  • License MIT

Package Exports

  • @anxing131/tracing
  • @anxing131/tracing/build/main/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@anxing131/tracing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node.js Tracing(opentelemetry) Lib

已验证的框架

  • koa 2+

使用示例

const config = {
  config: {
    resource: {
      'service.name': "anxing",
      'service.namespace': "my-namespace"
    }
  },
  spanProcessor: {
    SimpleSpanProcessor: {
      spanExpoter: {
        ConsoleSpanExporter: {}
      }
    },
    BatchSpanProcessor: {
      config: {
        /** The maximum batch size of every export. It must be smaller or equal to
         * maxQueueSize. The default value is 512. */
        maxExportBatchSize: 1,
        /** The delay interval in milliseconds between two consecutive exports.
         *  The default value is 5000ms. */
        scheduledDelayMillis: 500,
        /** How long the export can run before it is cancelled.
         * The default value is 30000ms */
        exportTimeoutMillis: 3000,
        /** The maximum queue size. After the size is reached spans are dropped.
         * The default value is 2048. */
        maxQueueSize: 10,
      },
      spanExpoter: {
        JaegerExporter: {
          host: '47.100.254.204', 
          port: 30371
        }
      }
    }
  },
  instrumentation: ['KoaInstrumentation', 'HttpInstrumentation']
}

const tracer = new Tracer(config)

参考链接