How to use the @opencensus/core.CanonicalCode.UNKNOWN function in @opencensus/core

To help you get started, we’ve selected a few @opencensus/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 census-instrumentation / opencensus-node / packages / opencensus-instrumentation-http / src / http.ts View on Github external
case 504:
          return CanonicalCode.DEADLINE_EXCEEDED;
        case 404:
          return CanonicalCode.NOT_FOUND;
        case 403:
          return CanonicalCode.PERMISSION_DENIED;
        case 401:
          return CanonicalCode.UNAUTHENTICATED;
        case 429:
          return CanonicalCode.RESOURCE_EXHAUSTED;
        case 501:
          return CanonicalCode.UNIMPLEMENTED;
        case 503:
          return CanonicalCode.UNAVAILABLE;
        default:
          return CanonicalCode.UNKNOWN;
      }
    }
  }
github census-instrumentation / opencensus-node / packages / opencensus-instrumentation-redis / src / redis.ts View on Github external
const patchedEnd = function(this: redis.RedisClient, err?: Error) {
      if (err instanceof Error) {
        span.setStatus(CanonicalCode.UNKNOWN, err.message);
      } else {
        span.setStatus(CanonicalCode.OK);
      }
      span.end();
      return resultHandler.apply(this, arguments);
    };
    return this.tracer.wrap(patchedEnd);
github keymetrics / pm2-io-apm / src / census / plugins / http2.ts View on Github external
request.on('error', (err: Error) => {
        span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_NAME, err.name)
        span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_MESSAGE, err.message)
        span.setStatus(CanonicalCode.UNKNOWN, err.message)

        span.end()
      })
github census-instrumentation / opencensus-node / packages / opencensus-instrumentation-http / src / http.ts View on Github external
request.on('error', error => {
        span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_NAME, error.name);
        span.addAttribute(
          HttpPlugin.ATTRIBUTE_HTTP_ERROR_MESSAGE,
          error.message
        );
        span.setStatus(CanonicalCode.UNKNOWN, error.message);
        span.end();
      });
github census-instrumentation / opencensus-node / packages / opencensus-instrumentation-ioredis / src / ioredis.ts View on Github external
const patchedEnd = function(this: ioredis.Redis, err?: Error) {
      if (err instanceof Error) {
        span.setStatus(CanonicalCode.UNKNOWN, err.message);
      }
      span.end();
      if (typeof resultHandler === 'function') {
        return resultHandler.apply(this, arguments);
      }
    };
    return this.tracer.wrap(patchedEnd);
github keymetrics / pm2-io-apm / src / census / plugins / http.ts View on Github external
response.on('error', error => {
          span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_NAME, error.name)
          span.addAttribute(
              HttpPlugin.ATTRIBUTE_HTTP_ERROR_MESSAGE, error.message)
          span.setStatus(CanonicalCode.UNKNOWN)
          span.end()
        })
      })
github keymetrics / pm2-io-apm / src / census / plugins / http.ts View on Github external
request.on('error', error => {
        span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_NAME, error.name)
        span.addAttribute(
            HttpPlugin.ATTRIBUTE_HTTP_ERROR_MESSAGE, error.message)
        span.setStatus(CanonicalCode.UNKNOWN)
        span.end()
      })