Skip to content

Commit

Permalink
feat(OTEL): Added span event information that is from another branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rhetoric101 committed Sep 21, 2021
1 parent 08e7283 commit 4e86ffc
Showing 1 changed file with 36 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,117 +22,55 @@ The New Relic **Explorer** tab is a good place to start gathering information ab

3. In the center pane, click the service you want to know more about, or find your service by entering the name in the top filter bar.

If you need help understanding how we display your data, see the following descriptions of the left-pane options in the UI.
If you need help understanding how we display your data, see the left-pane options below.

### Summary page [#summary]

After you click on a service in the **Explorer** tab, you see the **Summary** page listing various golden signals about your entity. Golden signals are key monitoring details such as response time, throughput, and error rate. By using this information, you can quickly decide if you need to dig deeper.

For your data to appear in this section, make sure it has the following:
### Distributed tracing [#tracing]

<table>
<thead>
<tr>
<th style={{ width: "200px" }}>
UI area
</th>
<th>
Attribute
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Response time
</td>
<td>
`span.kind = server` or `consumer`
</td>
</tr>
<tr>
<td>
Throughput
</td>
<td>
`span.kind = server` or `consumer`
</td>
</tr>
<tr>
<td>
Error rate
</td>
<td>
* `span.kind = server` or `consumer`
* `otel.status_code = ERROR`
</td>
</tr>
<tr>
<td>
Service instances pane
</td>
<td>
`service.instance.id` (usually set via the OTel resource API)
</td>
</tr>
</tbody>
</table>
In **Distributed tracing**, you can locate traces and examine span details:

### Distributed tracing [#tracing]
1. To narrow the search for traces you want, you can run queries like these in the filter bar:
* `service.name = YOUR_SERVICE_NAME`
* `trace.id = YOUR_TRACE_ID`
2. When you find an interesting trace, click on it to display a waterfall diagram showing the spans of the trace.
3. Click on specific spans within the trace to display span details in the right panel.

In **Distributed tracing**, you can locate traces and examine span details. For your trace data to appear in the New Relic UI, it needs to conform to the [OpenTelemetry trace semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions#trace-semantic-conventions).
<Callout variant="tip">
For more ways to filter traces, see our [distributed tracing UI page](/docs/understand-dependencies/distributed-tracing/ui-data/understand-use-distributed-tracing-ui).
</Callout>

The following attributes are typically not added explicitly to spans. Rather, they are usually set when creating a span or performing operations (for example, recording an error) on a span using the OpenTelemetry SDK.
#### View spans with errors

<table>
<thead>
<tr>
<th style={{ width: "200px" }}>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
name
</td>
<td>
A span’s name is generally set when [starting a span](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span-creation). The name can generally be anything, but the OpenTelemetry specification provides guidance for certain types of spans like [Database spans](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md#semantic-conventions-for-database-client-calls) or [HTTP spans](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#name).
</td>
</tr>
<tr>
<td>
[span.kind](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind)
</td>
<td>
A span’s kind is generally set when [starting a span](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span-creation). New Relic uses `span.kind` to infer that a span is an entry point to a given service. When `span.kind = server` or `consumer` it is considered an entry point. When `span.kind = client` or `producer`, it is considered a call to an external service or database system.
After you click on a span in the trace waterfall view, you can see span errors in the right panel under **Error details**.

</td>
</tr>
<tr>
<td>
otel.status_code
</td>
<td>
* A span’s [status is set](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status) using the span API. The `otel.status_code` attribute is how it is manifested by New Relic.
* The UI primarily uses `otel.status_code` for the purpose of identifying errors.
</td>
</tr>
</tbody>
</table>
![Screenshot showing the right pane with Error details section](./images/view-span-errors.png "Screenshot showing the right pane with Error details section")

#### Find traces and their associated spans
The error details are populated by spans containing `otel.status_code = ERROR` and display the content of `otel.status_description`.

Here are some ways to target your searches:
To narrow your search for spans with errors, you can enter `otel.status_code = ERROR` directly in the distributed tracing filter bar.

1. To find the traces you want, you can run queries like these in the filter bar:
* `service.name = YOUR_SERVICE_NAME`
* `trace.id = YOUR_TRACE_ID`
2. When you find an interesting trace, click on it to display a waterfall diagram showing the spans of the trace.
3. Click on specific spans within the trace to display span details in the right panel.
#### View span events

If you send span events as described by the [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#add-events), you can view them in the New Relic UI. Span events have two general types:
* Exceptions
* Non-exceptions (for example, logs)

If you have span events, links for these appear in the right pane:

1. Click on a span in the waterfall view.
2. In the right pane, click **View span events**, or you can expand **Error details** and click the link at the bottom of the errors.

![Screenshot showing the right pane showing the two links for span events](./images/view-span-events.png "Screenshot showing the right pane showing the two links for span events")

3. When you're in span events and only want to view exceptions, slide the toggle **Only show exceptions**.

![Screenshot showing span events and how you can filter just for exceptions](./images/span-events-exceptions.png "Screenshot showing span events and how you can filter just for exceptions")

<Callout variant="tip">
For more ways to filter traces, see our [distributed tracing UI page](/docs/understand-dependencies/distributed-tracing/ui-data/understand-use-distributed-tracing-ui).
OpenTelemetry exceptions handled by the app/service are displayed independently of span error status and are not necessarily associated with a span error status.
</Callout>

#### View spans with errors
Expand Down Expand Up @@ -233,6 +171,7 @@ For your data to appear in this section, make sure it has the following:

Externals capture calls to out-of-process services such as web services, resources in the cloud, and other network entities.

<<<<<<< HEAD
For your data to appear in this section, make sure it has the following:

* `span.kind = client` or `producer`
Expand All @@ -252,6 +191,8 @@ For your data to appear in this section, make sure it has the following:
* Requires a unique `service.instance.id` attribute for rendering the list of JVMs
* `Service.instance.id` is an OpenTelemetry resource attribute

=======
>>>>>>> feat(OTEL): Added span event information that is from another branch
### Logs [#logs]

The **Logs** page displays logs from your application. For more information about how to associate log data to your application in New Relic, see our [OpenTelemetry and logging documentation](/docs/integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-logs).
Expand Down

0 comments on commit 4e86ffc

Please sign in to comment.