From ccaa1dbe50afec00a09b3d25a8a074651d572f07 Mon Sep 17 00:00:00 2001 From: neilpdx Date: Mon, 6 Jan 2025 11:01:11 -0800 Subject: [PATCH 1/2] Update custom-instrumentation-attributes-net.mdx Added note in regard to avoiding instrumenting Main methods, as noted in our custom instrumentation via XML doc: https://docs.newrelic.com/docs/apm/agents/net-agent/custom-instrumentation/create-transactions-xml-net/#creating-custom-txn --- .../custom-instrumentation-attributes-net.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx b/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx index b909ed84213..9bd07a290a2 100644 --- a/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx +++ b/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx @@ -25,6 +25,7 @@ Requirements include: * You must be willing to modify your source code. If you can't or don't want to modify your source code, use [custom instrumentation via XML](/docs/agents/net-agent/custom-instrumentation/custom-instrumentation-xml-net). * Your project must have a reference to `NewRelic.Api.Agent.dll` (for example, installing the package and placing `using NewRelic.Api.Agent;` in your code). This package is in the [NuGet gallery](https://www.nuget.org/packages/NewRelic.Agent.Api/). * The `Transaction` and `Trace` attributes must be applied to concrete implementations of methods. They cannot be applied on interfaces or super class method definitions. +* Avoid instrumenting things like `Main()` since top-level methods like these won't end until the application ends, and data may not be sent to New Relic. ## Transactions called within transactions [#tx-vs-trace] From 7f37a34e24bffb3e6a1ded27091afc8c11672a67 Mon Sep 17 00:00:00 2001 From: newrelic707195 Date: Tue, 7 Jan 2025 12:13:27 +0530 Subject: [PATCH 2/2] Update custom-instrumentation-attributes-net.mdx --- .../custom-instrumentation-attributes-net.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx b/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx index 9bd07a290a2..055d874f5f3 100644 --- a/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx +++ b/src/content/docs/apm/agents/net-agent/custom-instrumentation/custom-instrumentation-attributes-net.mdx @@ -25,7 +25,7 @@ Requirements include: * You must be willing to modify your source code. If you can't or don't want to modify your source code, use [custom instrumentation via XML](/docs/agents/net-agent/custom-instrumentation/custom-instrumentation-xml-net). * Your project must have a reference to `NewRelic.Api.Agent.dll` (for example, installing the package and placing `using NewRelic.Api.Agent;` in your code). This package is in the [NuGet gallery](https://www.nuget.org/packages/NewRelic.Agent.Api/). * The `Transaction` and `Trace` attributes must be applied to concrete implementations of methods. They cannot be applied on interfaces or super class method definitions. -* Avoid instrumenting things like `Main()` since top-level methods like these won't end until the application ends, and data may not be sent to New Relic. +* Avoid instrumenting top-level methods such as `Main()`, as these methods do not conclude until the application terminates, which may prevent data from being sent to New Relic. ## Transactions called within transactions [#tx-vs-trace]