Skip to content

Commit

Permalink
Merge pull request #6960 from newrelic/APMlicpage
Browse files Browse the repository at this point in the history
feat(APM logs in context): screenshots
  • Loading branch information
barbnewrelic committed Apr 11, 2022
2 parents fff4ff0 + 26bf354 commit 3d66ad3
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,46 @@ title: APM logs in context
metaDescription: Get relevant logs, traces, errors, and other linking metadata within the context of your app or host, without additional configuration or context switching in New Relic.
---

import ApmLic2040622 from 'images/apm-lic2-040622.png'

import ViewLimits from 'images/view-limits.png'

import ApmLic3040622 from 'images/apm-lic3-040622.png'

import ApmRelated040622 from 'images/apm-lic-related040622.png'

import ApmLic2A040622 from 'images/apm-lic2a-040622.png'

import ApmLic4040622 from 'images/apm-lic4-040622.png'

import ApmLic5040622 from 'images/apm-lic5-040622.png'


When you're troubleshooting an issue in your app or host, you need all the New Relic tools at your fingertips. But you don't want to do a lot of context switching across the UI or be overwhelmed by the wealth of information available.

Our APM agents can automatically add that identifier to application log data, which makes using logs in context extremely easy. Applications can also use the agent to forward log data directly to New Relic.
Our APM agents can automatically add relevant attributes to your application log data. This makes using logs in context extremely easy. Applications can also use the agent to forward log data directly to New Relic.

Logs are more valuable in the context of the application, transaction, or error they belong to. Using our logs in context functionality will change the way you troubleshoot by giving you visibility of logs from your applications, distributed traces, and errors directly in APM.

Learn more about the power of automatic logs in context with our [example](#response-time-example) of how an engineering team used it to troubleshoot their app's poor response time and rising error rates.
<img
title="APM logs in context UI options"
alt="APM logs in context UI options"
src={ApmLic2040622}
/>

<figcaption>
Drill down into your logs, traces, and errors, all from the APM **Summary** page in New Relic.
</figcaption>

Learn more about the [power of automatic logs in context](#response-time-example). The example describes how an engineering team used it to troubleshoot their app's poor response time and rising error rates.

## Get started [#get-started]

To set up APM logs in context:

1. If you don't have one already, [create a New Relic account](https://newrelic.com/signup). It's free, forever.
2. Update to the [supported agent version](#agents) for your apps and hosts.
3. [Enable](#agents) logs for your agent, and make a few small updates to the configuration file.
3. [Enable logs for your agent](#agents), and make a few small updates to the configuration file.

That's it! Start troubleshooting your applications with APM logs in context in New Relic:

Expand All @@ -39,7 +64,7 @@ If your APM agent doesn't support our automatic logs in context solution yet, yo
## Ensure data privacy [#data-privacy]

<Callout variant="caution">
You control what log data is sent to New Relic, so be sure to follow your organization's security guidelines to mask, obfuscate, or prevent sending PII, PHI, or any other sensitive data.
You control what log data is sent to New Relic, so be sure to follow your organization's security guidelines to mask, obfuscate, or prevent sending personal identifiable information (PII), protected health information (PHI), or any other sensitive data.
</Callout>

Our log ingest pipeline automatically masks credit cards, Social Security numbers, national IDs, etc. For more information, see our [security documentation](/docs/logs/get-started/new-relics-log-management-security-privacy) for log management.
Expand Down Expand Up @@ -68,6 +93,13 @@ To avoid any surprises, we recommend that you use [NRQL queries](/docs/accounts/
title="View data limits and usage in UI"
>
To [review your data limits in the UI](/docs/data-apis/manage-data/view-system-limits): From the [account dropdown](/docs/glossary/glossary/#account-dropdown) in the New Relic UI, click **Manage your data > Limits**. Or, to view your usage and estimated cost to date, click **View your usage**.

<img
title="View data and usage from UI"
alt="View data and usage from UI"
src={ViewLimits}
/>

</Collapser>

<Collapser
Expand All @@ -93,11 +125,11 @@ To avoid any surprises, we recommend that you use [NRQL queries](/docs/accounts/
</Collapser>
</CollapserGroup>

## The power of logs in context [#response-time-example]
## Example: The power of logs in context [#response-time-example]

Here is a detailed use case of using APM logs in context to get to the root cause of a problem.

**Example scenario:** The on-call engineer receives a New Relic alert notification about poor response time and rising error rates for their "Order Composer" app. They need to discover the root cause behind the increase in errors and latency, so they can decide whether to rotate a problematic host out of load balancing or to roll back the most recent release.
**Example scenario:** The on-call engineer receives a New Relic alert notification about poor response time and rising error rates for their app. They need to discover the root cause behind the increase in errors and latency, so they can decide whether to rotate a problematic host out of load balancing or to roll back the most recent release.

To start troubleshooting, they go to the New Relic UI.

Expand All @@ -108,13 +140,26 @@ To start troubleshooting, they go to the New Relic UI.
>
When the engineer looks at the app's **APM Summary** page, they see many more error logs leading up to the increase in response time. They want to see if the logs can expose the root cause of the problem.

<img
title="APM Summary errors in UI"
alt="APM Summary errors in UI"
src={ApmLic3040622}
/>

**How can they quickly decide what's related to the problem?**

They have not set up log collection. But the Ruby agent for their app has been recently updated to include APM logs in context, so the app now automatically receives logs and linking metadata. The metrics facet the count by log severity set by Ruby's built-in Logger.
They have not set up log collection. But the Java agent for their app has been recently updated to include APM logs in context, so the app now automatically receives logs and linking metadata. The metrics that appear in the UI facet the count by log severity. (This is set by the Java agent's built-in log decorating capabilities.)

<img
title="APM related entity logs in UI"
alt="APM related entity logs errors in UI"
src={ApmRelated040622}
/>

**What entities are related?**

On the same UI page, they click the **Logs** chart, so they can review the **Log Summary** view for entities in the New Relic Explorer. This view shows them when instrumented logs have been collected and when those logs had an `Error` severity level or worse. It also shows them a list of log patterns and what percentage of all logs fit each pattern.

</Collapser>

<Collapser
Expand All @@ -123,6 +168,12 @@ To start troubleshooting, they go to the New Relic UI.
>
In the **Log patterns** UI, rare error messages have begun to occur frequently, and they now appear in the list. This helps the engineer to focus on problematic logs instead of all the noisy status updates.

<img
title="Logs patterns UI"
alt="Log patterns UI"
src={ApmLic4040622}
/>

**What patterns should they focus on?**

The engineer notices an interesting log pattern and wants to view only the logs that fit this pattern. They click on it to add the pattern's value as a filter to the logs being displayed. This narrows the focus.
Expand All @@ -132,23 +183,35 @@ To start troubleshooting, they go to the New Relic UI.
id="log-details"
title="What can more log details reveal?"
>
The engineer wants to see all the values contained in the log record, so they click the **Log detail** view. This helps them validate that the log itself is meaningful. It also lets them drill down further into either the Kubernetes environment where the app runs, or directly to any distributed traces or APM errors related to the log record.
The engineer wants to see all the values contained in the log record, so they click the **Log details** view. This helps them validate that the log itself is meaningful. It also lets them drill down further into either the Kubernetes environment where the app runs, or directly to any distributed traces or APM errors related to the log record.

<img
title="Log details in APM UI"
alt="Log details in APM UI"
src={ApmLic2A040622}
/>

The engineer decides to look at the APM error where they can see a full stack trace. They can also see logs from their **Errors inbox** UI.

<img
title="Logs from Errors inbox UI"
alt="Logs from Errors inbox UI"
src={ApmLic5040622}
/>
</Collapser>

<Collapser
id="log-sampling"
title="What additional test data will help troubleshoot?"
>
The troubleshooting team has been running tests to isolate the cause, but not all logs have been collected for the test transactions. The default log collection in their Ruby agent's config file (approximately 10,000 logs per minute in `application_logging.forwarding.max_samples_stored`) has been useful to validate that the services have an issue. But now they need to turn up the sampling to a higher number for more detailed troubleshooting.
The troubleshooting team has been running tests to isolate the cause, but not all logs have been collected for the test transactions. The default log collection in their Java agent's config file (approximately 10,000 logs per minute in `application_logging:forwarding:max_samples_stored:`) has been useful to validate that the services have an issue. But now they need to turn up the sampling to a higher number for more detailed troubleshooting.
</Collapser>

<Collapser
id="next-steps"
title="Problem solved. Now what?"
>
The troubleshooting team determines the problem stems from a recently introduced change, so they roll back that code. To save resources and ingest expenses, they turn down log collection for `application_logging.forwarding.max_samples_stored` in their config file, but they keep log sampling running in case the issue repeats itself.
The troubleshooting team determines the problem stems from a recently introduced change, so they roll back that code. To save resources and ingest expenses, they turn down log collection for `application_logging:forwarding:max_samples_stored:` in their config file, but they keep log sampling running in case the issue repeats itself.

The troubleshooting team also updates their runbooks to point to the **Log patterns** page filtered to this app, and they [add the runbook to their alert condition](/docs/alerts-applied-intelligence/new-relic-alerts/advanced-alerts/understand-technical-concepts/provide-runbook-instructions-alert-activity/). Next time they get an alert similar to this situation, they can use these lessons learned for faster troubleshooting.
</Collapser>
Expand Down
Binary file added src/images/apm-lic-related040622.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/apm-lic2-040622.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/apm-lic2a-040622.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/apm-lic3-040622.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/apm-lic4-040622.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/apm-lic5-040622.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/view-limits.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d66ad3

Please sign in to comment.