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

NewRelic error trace and spans dashboard support #4336

Closed
smyrick opened this issue Dec 5, 2023 · 3 comments · Fixed by #4987
Closed

NewRelic error trace and spans dashboard support #4336

smyrick opened this issue Dec 5, 2023 · 3 comments · Fixed by #4987
Assignees
Labels
component/open-telemetry OTLP, Datadog, Prometheus, etc. and the integrations around it. raised by user story/observability

Comments

@smyrick
Copy link
Member

smyrick commented Dec 5, 2023

Is your feature request related to a problem? Please describe.
NewRelic uses a non-standard format for tracking error dashboards on traces. It requires that you set a span attribute of otel.status_code which it uses to track error counts

https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/view-your-data/opentelemetry-errors-page/

Describe the solution you'd like
Add the ability to configure this property to be set or include it in all spans on either HTTP or GraphQL errors

Describe alternatives you've considered
We could customize an Otel collector between the Router and New Relic, however directly configuring Router to send info directly to NR does work minus this one feature: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/get-started/opentelemetry-set-up-your-app/#review-settings

@bnjjj
Copy link
Contributor

bnjjj commented Dec 13, 2023

I think having that kind of configuration:

telemetry:
  instrumentation:
    spans:
      supergraph:
        attributes:
          "span.kind": "server"
          "otel.status_code":
            condition:
              - exists:
                  response_body: ".errors[0].message"
            value: "ERROR"

woud make sense

@bnjjj bnjjj self-assigned this Dec 13, 2023
@abernix
Copy link
Member

abernix commented Jan 8, 2024

@bnjjj Is there a part of this that isn't available already? Is it the condition part?

@abernix abernix added the component/open-telemetry OTLP, Datadog, Prometheus, etc. and the integrations around it. label Jan 8, 2024
@garypen garypen removed the component/open-telemetry OTLP, Datadog, Prometheus, etc. and the integrations around it. label Jan 8, 2024
@abernix abernix added component/open-telemetry OTLP, Datadog, Prometheus, etc. and the integrations around it. story/observability labels Jan 8, 2024
@bnjjj
Copy link
Contributor

bnjjj commented Jan 8, 2024

Yes the condition part doesn't already exist

bnjjj added a commit that referenced this issue Apr 23, 2024
…aphql error (#4987)

Currently the router does not set otel.status_description on spans. This
is a special attribute that will also set the span status.

This means that even responses have errors or http status is not 200
spans are not flagged as an error.

To complicate matters further, other languages usually use exceptions
and stack unwinding to set span status, both of which are not available
to us in rust.



Example:

```yaml
telemetry:
  instrumentation:
    spans: 
      router: 
        attributes:    
          otel.status_description: 
            static: "there was an error"
            condition:
              any:
              - not:
                  eq:
                  - response_status: code
                  - 200
              - eq:
                - on_graphql_error
                - true
```

This will allow the user to set the description to something if there
was an issue.

Suggest implementing using the existing condition logic and add two new
selectors. This would check http status and if there are 1 or more
graphql errors.

Fixes #4336

---------

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: bryn <bryn@apollographql.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/open-telemetry OTLP, Datadog, Prometheus, etc. and the integrations around it. raised by user story/observability
Projects
None yet
4 participants