Skip to content

Commit

Permalink
Merge pull request #4787 from newrelic/DOC7477-agent-lic
Browse files Browse the repository at this point in the history
feat(C and Go agents): Add logs in context info
  • Loading branch information
barbnewrelic committed Nov 9, 2021
2 parents 5a493ad + 14885ab commit 1a3ba33
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ If your app meets the C SDK's [compatibility and requirements in Linux environme
</td>
</tr>

<tr>
<td>
View logs for your APM and infrastructure data
</td>

<td>
You can bring your logs and application's data together to make troubleshooting easier and faster. No need to switch to another UI page in New Relic One.

* With [logs in context](/docs/logs/logs-context/c-sdk-configure-logs-context/), you can see log messages related to your errors and traces directly in your app's UI.
* You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters.
</td>
</tr>

<tr>
<td>
Analyze business data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,7 @@ If you need to change your application's name in your configuration after your a
<Callout variant="caution">
Timing is everything. Switching application names during a single application execution may mean that your instrumented data is sent under the new application name.
</Callout>

## View logs for your APM and infrastructure data [#logs-context]

You can also bring your logs and application's data together to make troubleshooting easier and faster. With [logs in context](/docs/logs/logs-context/c-sdk-configure-logs-context/), you can see log messages related to your errors and traces directly in your app's UI. You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters. No need to switch to another UI page in New Relic One.
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,19 @@ For transactions that occur in multiple services, the distributed trace payload
</tr>
</tbody>
</table>

## Examine logs for trace details [#logs-context]

You can bring your logs and application's data together to make troubleshooting easier and faster. With [logs in context](/docs/logs/logs-context/c-sdk-configure-logs-context/), you can see log messages related to your errors and traces directly in your app's UI.

1. From the **Transactions** page, click on a trace to go to the [**Trace details** page](/docs/apm/transactions/transaction-traces/transaction-traces-trace-details-page).
2. From the trace details page, click **See logs**.
3. To view details related to an individual log message, click directly on the message.

![Logs in context of APM trace details](./images/logs-in-context-traces.png "Logs in context of APM trace details")

<figcaption>
With logs in context, you can examine log data directly within your trace details.
</figcaption>

You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters. No need to switch to another UI page in New Relic One.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
title: Instrument errors with the C SDK
metaDescription: >-
Learn how to instrument errors in your C application so you can monitor them
with New Relic.
metaDescription: 'Learn how to instrument errors in your C application so you can monitor them
with New Relic.'
redirects:
- /docs/agents/c-sdk/instrumentation/instrument-errors-c-sdk
- /docs/instrument-errors-c-agent
Expand All @@ -14,10 +13,6 @@ New Relic defines a [web or non-web transaction](/docs/apm/transactions/intro-tr
To include function calls in error traces, use GNU's `-rdynamic` linker flag to [link your apps when compiling](/docs/install-c-agent-compile-link-your-code#compile). The `-rdynamic` linker flag gives you more meaningful error traces.
</Callout>

## Contents [#in-page-toc]

For an index of documentation available during the private Beta, see the [C SDK table of contents](/docs/c-agent-table-contents).

## Instrument errors in transactions [#errors]

To instrument errors in transactions:
Expand All @@ -32,4 +27,18 @@ Transaction errors and [error traces](#error-trace-examples) appear on the [**Er

You can also view, query, and visualize transaction errors in New Relic Insights as `TransactionError` events.

## Examine logs for error details [#logs-context]

You can bring your logs and application's data together to make troubleshooting easier and faster. With [logs in context](/docs/logs/logs-context/c-sdk-configure-logs-context/), you can see log messages related to your errors and traces directly in your app's UI.

1. From the **Errors** page, click on a trace to go to the [**Error details** page](/docs/apm/apm-ui-pages/error-analytics/errors-page-find-fix-verify-problems/).
2. From the error details page, click **See logs**.
3. To view details related to an individual log message, click directly on the message.

![Logs in context of APM error details](./images/logs-in-context-errors.png "Logs in context of APM error details")

<figcaption>
With logs in context, you can examine log data directly within your error details.
</figcaption>

You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters. No need to switch to another UI page in New Relic One.
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ New Relic offers an [integration for the Logrus logging system](https://github.c
config.Logger = nrlogrus.StandardLogger()
},
)
```
```

## View logs for your APM and infrastructure data [#logs-context]

You can also bring your logs and application's data together to make troubleshooting easier and faster. With [logs in context](/docs/logs/logs-context/configure-logs-context-go/), you can see log messages related to your errors and traces directly in your app's UI. You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters. No need to switch to another UI page in New Relic One.
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,19 @@ In order for distributed tracing to work optimally, your Go application must adh
</CollapserGroup>

For more details on using these, see the [Go agent GitHub repo](https://github.com/newrelic/go-agent/blob/master/GUIDE.md#distributed-tracing).

## Examine logs for trace details [#logs-context]

You can bring your logs and application's data together to make troubleshooting easier and faster. With [logs in context](/docs/logs/logs-context/configure-logs-context-go/), you can see log messages related to your errors and traces directly in your app's UI.

1. From the **Transactions** page, click on a trace to go to the [**Trace details** page](/docs/apm/transactions/transaction-traces/transaction-traces-trace-details-page).
2. From the trace details page, click **See logs**.
3. To view details related to an individual log message, click directly on the message.

![Logs in context of APM trace details](./images/logs-in-context-traces.png "Logs in context of APM trace details")

<figcaption>
With logs in context, you can examine log data directly within your trace details.
</figcaption>

You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters. No need to switch to another UI page in New Relic One.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ With New Relic for Go, you will gain a new level of visibility into your Golang
* Get [alerts](/docs/alerts/alert-policies/understanding-alert-policies/alerting-new-relic) for problems or errors before they affect users.
* Create custom dashboards for important metrics.

**View logs for your APM and infrastructure data:**

You can bring your logs and application's data together to make troubleshooting easier and faster. No need to switch to another UI page in New Relic One.

* With [logs in context](/docs/logs/logs-context/configure-logs-context-go/), you can see log messages related to your errors and traces directly in your app's UI.
* You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters.

**Analyze business data:**

* Query user-related data and improve business processes.
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ writer.WriteHeader(500)
</Collapser>
</CollapserGroup>

## Monitor a transaction with multiple goroutines
## Monitor a transaction with multiple goroutines [#goroutines]

To monitor a transaction across multiple goroutines, use `Transaction.NewGoroutine()`. The `NewGoroutine` method returns a new reference to the Transaction, which is required by each segment-creating goroutine. It does not matter if you call `NewGoroutine` before or after the other goroutine starts.

Expand Down Expand Up @@ -196,6 +196,22 @@ New Relic for Go captures errors in three different ways:
</tbody>
</table>

## View logs for your APM and infrastructure data [#logs-context]

You can also bring your logs and application's data together to make troubleshooting easier and faster. With [logs in context](/docs/logs/logs-context/configure-logs-context-go/), you can see log messages related to your errors and traces directly in your app's UI.

1. From the **Errors** page, click on a trace to go to the [**Error details** page](/docs/apm/apm-ui-pages/error-analytics/errors-page-find-fix-verify-problems).
2. From the error details page, click **See logs**.
3. To view details related to an individual log message, click directly on the message.

![Logs in context of APM error details](./images/logs-in-context-errors.png "Logs in context of APM error details")

<figcaption>
With logs in context, you can examine log data directly within your error and trace details.
</figcaption>

You can also see logs in context of your [infrastructure data](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/), such as Kubernetes clusters. No need to switch to another UI page in New Relic One.

## Additional transaction methods [#go-transactions-methods]

The `Transaction` object has several optional methods that can be used for controlling transaction behavior, such as `NoticeError`, `AddAttribute`, and `Ignore`. For a list of transaction methods, see the [New Relic for Go transaction methods on Godoc](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic#Transaction).

0 comments on commit 1a3ba33

Please sign in to comment.