Skip to content

Instantly share code, notes, and snippets.

@tedsuo
Created November 11, 2020 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedsuo/42ce479dd3e8e7232ddc00b7478950ac to your computer and use it in GitHub Desktop.
Save tedsuo/42ce479dd3e8e7232ddc00b7478950ac to your computer and use it in GitHub Desktop.
node_errors.js
try {
throw ("ooops");
} catch (error) {
// Add the exception as a properly formatted event.
span.recordException(error);
// Set the status code to make the exception count
// as an error.
span.setStatus({ code:
opentelemetry.CanonicalCode.UNKNOWN });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment