Skip to content

Commit

Permalink
fix(More SME edits): Thank you!
Browse files Browse the repository at this point in the history
  • Loading branch information
barbnewrelic committed Mar 15, 2022
1 parent f3570e5 commit 4102583
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 17 additions & 11 deletions src/content/docs/logs/logs-everywhere/ruby-telemetry-context.mdx
Expand Up @@ -29,7 +29,7 @@ You have three options to configure telemetry in context for your application:

This is the simplest approach, and it's a great choice for developers who may not have the access or interest in setting up a log forwarder, or for accounts that want to see the power of logs in context without a lot of overhead.

All you need to do is install a version of a language agent with log forwarding abilities ([Ruby agent x.x.x or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/ruby-release-notes/)), and update your configuration to enable forwarding.
All you need to do is install an agent version with log forwarding capabilities ([Ruby agent 6.8.0 or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/ruby-release-notes/)), and update your configuration to enable forwarding.

newrelic.yml:
```
Expand Down Expand Up @@ -65,7 +65,7 @@ You have three options to configure telemetry in context for your application:
title="Option 2: Let the agent decorate your logs."
>

Already have a log forwarder you like? We've got you covered. Language agents can decorate your logs with the linking metadata needed to provide access to telemetry-in-context features.
Already have a log forwarder you like? We've got you covered! Language agents can decorate your logs with the linking metadata needed to provide access to telemetry-in-context features.

Simply enable log decorating in your configuration, and relaunch the agent to start decorating your logs.

Expand All @@ -79,7 +79,11 @@ You have three options to configure telemetry in context for your application:
NEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED=true
```

Decoration is made possible by the addition of four attributes: `entity.guid`, `hostname`, `span.id`, and `trace.id`.
Our decorator adds four attributes to every log message: `entity.guid`, `hostname`, `trace.id`, and `span.id`. Example:

```
This is my log message. NR-LINKING|{entity.guid}|{hostname}|{trace.id}|{span.id}|
```

We recommend this option over the old decorating formatter, `NewRelic::Agent::Logging::DecoratingFormatter`.

Expand All @@ -90,13 +94,11 @@ You have three options to configure telemetry in context for your application:
title="Option 3: Use the old decorating formatter."
>

Before language agents had the ability to forward and decorate logs, you could be enable logs in context by updating your application to use the `NewRelic::Agent::Logging::DecoratingFormatter` to send linking metadata.

Before language agents had the ability to forward and decorate logs, you could enable logs in context by updating your application to use the `NewRelic::Agent::Logging::DecoratingFormatter` to send linking metadata.
This option is still supported, but is no longer encouraged. For instructions to use this approach, see [Ruby: Configure logs in context](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-ruby/).

![Use infrastructure agent as log forwarder](./images/infra-log-forwarder.png "Use infrastructure agent as log forwarder")

If you don't have any log forwarder enabled, the UI will prompt you to use the infrastructure agent as your log forwarder.
Also, this method requires that you install a log forwarder before enabling logs in context. If you do not have a log forwarder, the New Relic One UI will prompt you to use our [infrastructure agent](https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/).
</Collapser>
</CollapserGroup>

Expand All @@ -113,10 +115,14 @@ To make the most of your logging data:
* On the [APM **Summary** page](https://docs.newrelic.com/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data), click your **Web transaction time** chart to view logs associated with a specific point in time.
* Check your app's [**Errors inbox**](https://docs.newrelic.com/docs/errors-inbox/errors-inbox) to view the logs associated with your errors.
* Use [distributed tracing](https://docs.newrelic.com/docs/distributed-tracing/ui-data/understand-use-distributed-tracing-ui) to see the logs associated with individual traces.
* Explore more logging data across your platform with our [Logs UI](/docs/logs/log-management/ui-data/use-logs-ui/).
* Set up [alerts](/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-alert-conditions/) based on log output and severity.
* [Query your data](/docs/query-your-data/explore-query-data/get-started/introduction-querying-new-relic-data/) and [create dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/).
* Explore more logging data across your platform with our [Logs UI](/docs/logs/log-management/ui-data/use-logs-ui/). For example, with telemetry in context, you can easily see [log patterns](/docs/logs/ui-data/find-unusual-logs-log-patterns), or show [surrounding logs](/docs/logs/troubleshooting/find-issues-cause-or-impact-surrounding-logs) at the time an error occurred in your app.
* [Query your data](/docs/logs/ui-data/query-syntax-logs/) using our specialized UI for logs data, and [create dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/) with the results.

## Troubleshooting tips [#troubleshooting]

Typically your logs will start to appear in less than a minute after you enable telemetry in context. If you don't see any logs for errors or traces, there may not be any for your app. Try refreshing the UI page, or change the [selected time period](https://docs.newrelic.com/docs/new-relic-one/ui-data/basic-ui-features/#data-analysis).
Typically your logs will start to appear less than a minute after you enable telemetry in context. Check your app's **Triage > Logs** section. You will also start seeing [log patterns](/docs/logs/ui-data/find-unusual-logs-log-patterns) related to the error there.

![Logs from APM Triage section](./images/troubleshoot-logs.png "Logs from APM Triage section")

If you don't see any logs for errors or traces, there may not be any for your app. Try refreshing the UI page, or change the [selected time period](https://docs.newrelic.com/docs/new-relic-one/ui-data/basic-ui-features/#data-analysis).

0 comments on commit 4102583

Please sign in to comment.