How to use the @opencensus/web-types.CanonicalCode function in @opencensus/web-types

To help you get started, we’ve selected a few @opencensus/web-types 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-web / packages / opencensus-web-core / src / trace / model / span.ts View on Github external
/** The display name of the span. */
  name = DEFAULT_SPAN_NAME;

  /** Kind of span. */
  kind: webTypes.SpanKind = webTypes.SpanKind.UNSPECIFIED;

  /** An object to log information to. Logs to the JS console by default. */
  logger: webTypes.Logger = console;

  /**
   * Status associated with this span. Defaults to OK status. Note that the
   * `code` is not an HTTP status, but is a specific trace status code. See:
   * https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/HTTP.md#mapping-from-http-status-codes-to-trace-status-codes
   */
  status: webTypes.Status = { code: webTypes.CanonicalCode.OK };

  /** A set of attributes, each in the format [KEY]:[VALUE] */
  attributes: webTypes.Attributes = {};

  /** Text annotations with a set of attributes. */
  annotations: webTypes.Annotation[] = [];

  /** Event describing messages sent/received between Spans. */
  messageEvents: webTypes.MessageEvent[] = [];

  /** Pointers from the current span to another span */
  links: webTypes.Link[] = [];

  /** Start time of the span as measured by the browser performance clock. */
  startPerfTime = 0;

@opencensus/web-types

OpenCensus Web types is a slightly-patched copy of the `types.ts` files from `@opencensus/core` so that they can be easily imported in web-specific packages.

Apache-2.0
Latest version published 5 years ago

Package Health Score

61 / 100
Full package analysis