Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js - add example of equivalent noticeError API using OpenTelemetry #168

Closed
o-alexandrov opened this issue Aug 6, 2022 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@o-alexandrov
Copy link

Summary

Based on the discussion here, please add an example of equivalent noticeError API using OpenTelemetry w/ New Relic.

Additional context

Exception handling is one of the most frequent features devs build.
To not require devs to create the same solution over and over, you could create an example, letting companies to adopt your service easier.

@o-alexandrov o-alexandrov added the enhancement New feature or request label Aug 6, 2022
@o-alexandrov
Copy link
Author

o-alexandrov commented Sep 8, 2022

@martinkuba thanks to your wonderful additions in open-telemetry/opentelemetry-js#3117, are you (NewRelic) by any chance considering to help us here?

@martinkuba
Copy link

Hi, Olzhas! Are you looking to use the OpenTelemetry JS SDK or make an HTTP call to the NR OTLP endpoint directly? If the latter, I could help now. Regarding the former, the Javascript SDK does not have an implementation of the Logs API yet. I am working on that now, but it will take some time to get that merged and released. Also, with either of these options, you will end up with a New Relic Log event with the exception attributes, not a TransactionError event. Is that acceptable to you?

@o-alexandrov
Copy link
Author

Thank you for the reply.
Unfortunately, Log event is not a good alternative, as afaik it won't end up in the Errors inbox.

If possible, please kindly share whether ability to add a TransactionError event is on the roadmap for OTLP endpoint (either using HTTP or w/ OpenTelemetry JS SDK)

@nrcventura
Copy link
Member

TransactionError is a New Relic specific concept. The closest thing that I'm aware of is when a Span is flagged as having an error. It looks like this can be done in otel-js with code similar to the following:

  span.setStatus({ code: SpanStatusCode.ERROR, message });
  span.recordException(error);

What I don't remember is if Errors Inbox will capture all spans that have a status of error or if it only captures the server spans that have a status of error.

@alanwest
Copy link
Member

Hello @o-alexandrov

are you (NewRelic) by any chance considering to help us here?

At this point in time we have kept the scope of this examples repository narrow (outlined here) - essentially how to configure the OTLP exporter to ship metrics, logs, traces to New Relic in a number of languages.

That said, we do have plans to expand our scope to better highlight how to use New Relic features like Errors Inbox. We're doing so in coordination with our documentation team. Using Errors Inbox with OpenTelemetry tooling is documented here. Of course, the thing that's missing are simple examples demonstrating how to achieve what we've documented there.

We're working with our docs team to better connect the dots from our OpenTelemetry documentation to examples within this repository. @rhetoric101 @reese-lee @rkbodenner

In the meantime, the information @nrcventura shared regarding Errors Inbox should work for you. And to clarify, Errors Inbox, currently only counts spans of kind server or consumer. This is because server or consumer spans are considered "entry-point" spans for a process. Furthermore, counting errors in Errors Inbox in this way corresponds to the method we use to calculate error rate on the Summary View of a service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants