How to use the @opentelemetry/core.NoopLogger function in @opentelemetry/core

To help you get started, we’ve selected a few @opentelemetry/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github open-telemetry / opentelemetry-js / packages / opentelemetry-exporter-jaeger / src / jaeger.ts View on Github external
constructor(config: jaegerTypes.ExporterConfig) {
    this._logger = config.logger || new NoopLogger();
    const tags: jaegerTypes.Tag[] = config.tags || [];
    this._forceFlushOnShutdown =
      typeof config.forceFlush === 'boolean' ? config.forceFlush : true;
    this._onShutdownFlushTimeout =
      typeof config.flushTimeout === 'number' ? config.flushTimeout : 2000;

    this._sender = new jaegerTypes.UDPSender(config);
    this._process = {
      serviceName: config.serviceName,
      tags: jaegerTypes.ThriftUtils.getThriftTags(tags),
    };
    this._sender.setProcess(this._process);
  }
github open-telemetry / opentelemetry-js / packages / opentelemetry-shim-opentracing / src / shim.ts View on Github external
constructor(tracer: types.Tracer, logger?: types.Logger) {
    super();

    this._tracer = tracer;
    this._logger = logger || new NoopLogger();
  }
github open-telemetry / opentelemetry-js / packages / opentelemetry-exporter-prometheus / src / prometheus.ts View on Github external
constructor(config: ExporterConfig = {}, callback?: () => void) {
    this._logger = config.logger || new NoopLogger();
    this._port = config.port || PrometheusExporter.DEFAULT_OPTIONS.port;
    this._prefix = config.prefix || PrometheusExporter.DEFAULT_OPTIONS.prefix;
    this._server = createServer(this._requestHandler);

    this._endpoint = (
      config.endpoint || PrometheusExporter.DEFAULT_OPTIONS.endpoint
    ).replace(/^([^/])/, '/$1');

    if (config.startServer || PrometheusExporter.DEFAULT_OPTIONS.startServer) {
      this.startServer(callback);
    } else if (callback) {
      callback();
    }
  }
github open-telemetry / opentelemetry-js / packages / opentelemetry-exporter-zipkin / src / zipkin.ts View on Github external
constructor(config: zipkinTypes.ExporterConfig) {
    const urlStr = config.url || ZipkinExporter.DEFAULT_URL;
    const urlOpts = url.parse(urlStr);

    this._forceFlush = config.forceFlush || true;
    this._logger = config.logger || new NoopLogger();
    this._reqOpts = Object.assign(
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          [OT_REQUEST_HEADER]: 1,
        },
      },
      urlOpts
    );
    this._serviceName = config.serviceName;
    this._statusCodeTagName = config.statusCodeTagName || statusCodeTagName;
    this._statusDescriptionTagName =
      config.statusDescriptionTagName || statusDescriptionTagName;
    this._isShutdown = false;
  }