Skip to content

Commit

Permalink
Review for hero
Browse files Browse the repository at this point in the history
The Tech Docs hero requested me to do a minor copyedits as Reviewer on this PR.
  • Loading branch information
barbnewrelic committed Jun 17, 2021
1 parent 9c77b9b commit c504793
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: OpenTelemetry and Logging
title: OpenTelemetry and logging
tags:
- Integrations
- Open source telemetry integrations
- OpenTelemetry
---

Logs are one of the core data types in OpenTelemetry. They may represent application logs, machine generated events, or system logs. The logging [data model](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) describes them in detail.
Logs are one of the core data types in OpenTelemetry. They may represent application logs, machine generated events, or system logs. Our OpenTelemetry [log data model in GitHub](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) describes them in detail.

Let's look at how to send logs, correlate them with applications, and view them in New Relic.

Expand All @@ -27,13 +27,13 @@ The specifics of how logs get annotated with the `service.name` resource attribu
- Applications may produce structured JSON logs, which you can configure to include `service.name` as another field.
- You can deploy applications alongside a dedicated [Collector Agent](https://opentelemetry.io/docs/collector/getting-started/#agent) instance, which you can configure with a [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/resourceprocessor) to annotate logs with the `service.name` attribute.

Optionally, additional application [trace context](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/overview.md#log-correlation) (sometimes called execution context) can be propogated to log messages. The setup and availability of this depends on the language and logging framework used by the application. The general strategy is to set up the application to write structured JSON logs and to configure it to extract trace context into specified [trace context fields](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#trace-context-fields) on available logs messages.
Optionally, additional application [trace context](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/overview.md#log-correlation) (sometimes called execution context) can be propagated to log messages. The setup and availability of this depends on the language and logging framework used by the application. The general strategy is to set up the application to write structured JSON logs and to configure it to extract trace context into specified [trace context fields](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#trace-context-fields) on available log messages.

The [Logs in Context With Log4j2](https://github.com/newrelic/newrelic-opentelemetry-examples/tree/main/java/logs-in-context-log4j2) example demonstrates an end-to-end working example for a simple Java application using Log4j2.
The [Logs in Context with Log4j2 example in GitHub](https://github.com/newrelic/newrelic-opentelemetry-examples/tree/main/java/logs-in-context-log4j2) demonstrates an end-to-end working example for a simple Java application using Log4j2.

## View OpenTelemetry logs [#view-logs]

Here are two ways you can view logs:

* Look in the [Logs UI](/docs/logs/log-management/ui-data/use-logs-ui/).
* Look in the New Relic [Logs UI](/docs/logs/log-management/ui-data/use-logs-ui/).
* If your logs are correlated with an application, view them in the [context of the application](/docs/integrations/open-source-telemetry-integrations/opentelemetry/view-your-opentelemetry-data-new-relic#logs).
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,48 @@ To get started with the explorer:

![Screen capture showing how to filter for OpenTelemetry services.](./images/explorer_otel_services.png "Filter for OpenTelemetry to see only those entities.")

3. Click the service you want to know more about, and if you need help understanding the data, see the explanations below.
3. Click the service you want to know more about.

If you need help understanding the data, see the explanations which follow.

### Summary page [#summary]

The opening page of the explorer is 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.

### Distributed Tracing [#tracing]
### Distributed tracing [#tracing]

When you access distributed tracing through the explorer, you are looking at traces that include that service. Once you’re in that service, you can filter spans to find the ones you want. For example, to query `service.name` or `trace.id`, you can use the following:

* `service.name = YOUR_SERVICE_NAME`
* `trace.id = YOUR_TRACE_ID`

For more ways to filter and analyze your spans, see our [distributed tracing UI](/docs/understand-dependencies/distributed-tracing/ui-data/understand-use-distributed-tracing-ui) page.
For more ways to filter and analyze your spans, see our [distributed tracing UI page](/docs/understand-dependencies/distributed-tracing/ui-data/understand-use-distributed-tracing-ui).

<Callout variant="tip">
If you prefer to search traces across all New Relic accounts in your organization, you can go outside explorer: **[one.newrelic.com](https://one.newrelic.com) > Apps > Favorites > Distributed tracing.**
</Callout>

### Transactions [#trx]

Use Transactions to identify slow or error transactions that might be causing a spike in the response time of your application. From the transaction summary page, you can get a list of transactions by selecting See transactions table.
Use **Transactions** to identify slow or error transactions that might be causing a spike in your application's response time. To get a list of transactions: From the **Transaction Summary** page, select the transactions table.

### Databases
### Databases [#databases]

The **Databases** page shows an application's database and cache data. The page shows individual database transactions as a sortable table, and shows operations, throughput, and response time as charts.

### Externals
### Externals [#externals]

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

### Errors
### Errors [#errors]

On this page, you can see total errors, as well as charts showing error count and error rate.
On the **Errors** page, you can see total errors as well as charts showing error count and error rate.

### Logs [#logs]

The logs page displays logs from your application. See [sending logs to New Relic](/docs/integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-logs) for information about how to associate log data to your application in New Relic.
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).

### Metrics Explorer [#metric-explorer]
### Metrics explorer [#metric-explorer]

For selected OpenTelemetry languages, you can see information about your metrics in this section. Also, if you are using the Prometheus exporter with OpenTelemetry, you can view your metric data here.

Expand Down

0 comments on commit c504793

Please sign in to comment.