diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx deleted file mode 100644 index 3dd94e867b3..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: DisableBrowserMonitoring (.NET agent API) -type: apiDoc -shortDescription: Disable automatic injection of browser monitoring snippet on specific pages. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to disable browser monitoring on specific pages or views. -redirects: - - /docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api - - /docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent - - /docs/agents/net-agent/net-agent-api/disable-browser-monitoring -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override]) -``` - -Disable automatic injection of browser monitoring snippet on specific pages. - -## Requirements - -Compatible with all agent versions. - -Must be called inside a [transaction](/docs/glossary/glossary/#transaction). - -## Description - -Add this call to disable the **automatic** injection of [](/docs/browser/new-relic-browser/getting-started/new-relic-browser) scripts on specific pages. You can also add an optional override to disable **both** manual and automatic injection. In either case, put this API call as close as possible to the top of the view in which you want browser disabled. - - - Compare [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent), which **adds** the browser script to the page. - - -## Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$override` - - _boolean_ - - Optional. When `true`, disables all injection of browser scripts. This flag affects both manual and automatic injection. This also overrides the [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent) call. -
- -## Examples - -### Disable automatic injection [#automatic-only] - -This example disables only the **automatic** injection of the snippet: - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(); -``` - -### Disable automatic and manual injection [#disable-both] - -This example disables **both** automatic and manual injection of the snippet: - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/getagent.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/getagent.mdx deleted file mode 100644 index 1a014437026..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/getagent.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: GetAgent -type: apiDoc -shortDescription: Get access to the agent via the IAgent interface. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -redirects: - - /docs/agents/net-agent/net-agent-api/getagent - - /docs/agents/net-agent/net-agent-api/getagent-net-agent-api -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.GetAgent() -``` - -Get access to the agent via the `IAgent` interface. - -## Requirements - -Agent version 8.9 or higher. - -Compatible with all app types. - -## Description - -Get access to agent API methods via the [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) interface. - -## Return values - -An implementation of [IAgent](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) providing access to the [IAgent API](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api). - -## Examples - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx deleted file mode 100644 index 41e024d1fcb..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: GetBrowserTimingHeader (.NET agent API) -type: apiDoc -shortDescription: Generate a browser monitoring HTML snippet to instrument end-user browsers. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to instrument a webpage with browser. -redirects: - - /docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api - - /docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent - - /docs/agents/net-agent/net-agent-api/get-browser-timing-header -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(); -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(string nonce); -``` - -Generate a browser monitoring HTML snippet to instrument end-user browsers. - -## Requirements - -Compatible with all agent versions. - -Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - - - -## Description - -Returns an HTML snippet used to enable [](/docs/browser/new-relic-browser/getting-started/new-relic-browser). The snippet instructs the browser to fetch a small JavaScript file and start the page timer. You can then insert the returned snippet into the header of your HTML webpages. For more information, see [Adding apps to Browser monitoring](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser). - - - Compare [`DisableBrowserMonitoring()`](/docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent), which **disables** the browser script on a page. - - -## Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `nonce` - - _string_ - - The per-request, cryptographic nonce used by Content-Security-Policy policies. -
- - - This API call requires updates to security allow lists. For more information about Content Security Policy (CSP) considerations, visit the [browser monitoring compatibility and requirements](/docs/browser/new-relic-browser/getting-started/compatibility-requirements-browser-monitoring) page. - - -## Return values - -An HTML string to be embedded in a page header. - -## Examples - -### With ASPX [#aspx] - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%> - ... - - - ... -``` - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")%> - ... - - - ... -``` - -### With Razor [#razor] - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` - -### With Blazor [#blazor] - - - This API is not supported for Blazor Webassembly, because the agent is unable to instrument Webassembly code. The following examples are for Blazor Server applications only. Use the [copy-paste method](/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste) of adding the browser agent to Blazor Webassembly pages. - - - - This API can not be placed in a `` element of a `.razor` page. Instead, it should be called from `_Layout.cshtml` or an equivalent layout file. - - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx deleted file mode 100644 index da11d0c0f67..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: GetLinkingMetadata (.NET agent API) -type: apiDoc -shortDescription: Returns key/value pairs which can be used to link traces or entities. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -redirects: - - /docs/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.GetLinkingMetadata(); -``` - -Returns key/value pairs which can be used to link traces or entities. - -## Requirements - -Agent version 8.19 or higher. - -Compatible with all app types. - -## Description - -The Dictionary of key/value pairs returned includes items used to link traces and entities in the APM product. It will only contain items with meaningful values. For instance, if distributed tracing is disabled, `trace.id` will not be included. - -## Return values - -`Dictionary ()` returned includes items used to link traces and entities in the APM product. - -## Examples - -```cs -NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -var linkingMetadata = Agent.GetLinkingMetadata(); -foreach (KeyValuePair kvp in linkingMetadata) -{ - Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); -} -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx deleted file mode 100644 index 8d3fb1462d9..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx +++ /dev/null @@ -1,331 +0,0 @@ ---- -title: Guide to using the .NET agent API -tags: - - Agents - - NET agent - - API guides -metaDescription: 'A goal-focused guide to the New Relic .NET agent API, with links to relevant sections of the complete API documentation.' -redirects: - - /docs/agents/net-agent/api-guides/guide-using-net-agent-api - - /docs/agents/net-agent/net-agent-api/net-agent-api-guide - - /docs/agents/net-agent/net-agent-api/guide-using-net-agent-api - - /docs/apm/agents/net-agent/net-agent-api - - /docs/apm/agents/net-agent/api-guides/guide-using-net-agent-api - - /docs/agents/net-agent/net-agent-api - - /docs/agents/net-agent/features/net-agent-api -freshnessValidatedDate: never ---- - -New Relic's .NET agent includes an [API](/docs/agents/net-agent/net-agent-api) that allows you to extend the agent's standard functionality. For example, you can use the .NET agent API for: - -* Customizing your app name -* Creating custom transaction parameters -* Reporting custom errors and metrics - -You can also customize some of the .NET agent's default behavior by adjusting [configuration settings](/docs/agents/net-agent/configuration/net-agent-configuration) or using [custom instrumentation](/docs/agents/net-agent/custom-instrumentation/introduction-net-custom-instrumentation). - -## Requirements - - - As of September 2021, a small subset of APIs, configuration options, and installation options for .NET will be replaced by new methods. For more details, including how you can easily prepare for this transition, see our [Support Forum post](https://discuss.newrelic.com/t/important-upcoming-changes-to-support-and-capabilities-across-browser-node-js-agent-query-builder-net-agent-apm-errors-distributed-tracing/153373). - - -To use the .NET agent API: - -1. Make sure you have the [latest .NET agent release](/docs/release-notes/agent-release-notes/net-release-notes). -2. Add a reference to the agent in your project: - - * Add a reference to `NewRelic.Api.Agent.dll` to your project. - - OR - * View and download the API package from the [NuGet Package Library](https://www.nuget.org/packages/NewRelic.Agent.Api/). - -## Instrument missing sections of your code with transactions [#creating-transactions] - -To instrument your app, New Relic separates each path through your code into its own [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). New Relic times (or "instruments") the parent method in these transactions to measure your app's overall performance, and collects [transaction traces](/docs/apm/transactions/transaction-traces/introduction-transaction-traces) from long-running transactions for additional detail. - -Use these methods when New Relic is not instrumenting a particular part of your code at all: - - - - - - - - - - - - - - - - - - - - - - - -
- If you want to... - - Do this... -
- Prevent a transaction from reporting to New Relic - - Use [`IgnoreTransaction()`](/docs/agents/net-agent/net-agent-api/ignore-transaction) or [an XML file](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation) to ignore the transaction. -
- Create a transaction where none exists - - Use [attributes](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) or [an XML file](/docs/agents/net-agent/instrumentation/net-custom-transactions) to create a new transaction. -
- -## Time specific methods using segments [#segments] - -If a transaction is already visible in the New Relic UI, but you don't have enough data about a particular method that was called during that transaction, you can create segments to time those individual methods in greater detail. For example, you might want to time a particularly critical method with complex logic. - -When you want to instrument a method within an existing transaction, see [Custom instrumentation via attributes](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) or [Add detail to transactions via XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net). - -## Enhance the metadata of a transaction [#metadata] - -Sometimes the code you are targeting is visible in the New Relic UI, but some details of the method are not useful. For example: - -* The default name might not be helpful. (Perhaps it is causing a [metric grouping issue](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues#video).) -* You want to add [custom attributes](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) to your transactions so you can filter them in dashboards. - -Use these methods when you want to change how New Relic instruments a transaction that's already visible in the New Relic UI: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- If you want to... - - Do this... -
- Change the name of a transaction - - Use [`SetTransactionName()`](/docs/agents/net-agent/net-agent-api/set-transaction-name) or [an XML file](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#name-transactions). -
- Prevent a transaction from affecting your [Apdex](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#apdex) score - - Use [`IgnoreApdex()`](/docs/agents/net-agent/net-agent-api/ignore-apdex). -
- Add metadata (such as your customer's account name or subscription level) to your transactions - - Use [custom attributes](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes). See [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction#addcustomattribute). -
- -## See related logs [#logs] - -To see logs directly within the context of your application's errors and traces, use these API calls to annotate your logs: - -* [`TraceMetadata`](/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0/) -* [`GetLinkingMetadata`](/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api/) - -For more information about correlating log data with other telemetry data, see our [logs in context](/docs/logs/logs-context/net-configure-logs-context-all/) documentation. - -## Instrument asynchronous work [#async] - -For supported frameworks, the .NET agent usually detects async work and instruments it correctly. However, if your app uses another framework, or the [default async instrumentation](/docs/agents/net-agent/features/async-support-net) is inaccurate, you can explicitly connect async work. - - - - - - - - - - - - - - - - - - - - - - - -
- If you want to... - - Do this... -
- Trace an async method that New Relic is already instrumenting - - Use [an XML file](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) to instrument async methods in IIS apps. For troubleshooting tips, see [missing async metrics](/docs/agents/net-agent/troubleshooting/missing-async-metrics). -
- Trace an async method that New Relic is not instrumenting - - Use [an XML file](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) to instrument async methods in IIS apps. For troubleshooting tips, see [missing async metrics](/docs/agents/net-agent/troubleshooting/missing-async-metrics). -
- -## View calls to external services [#externals] - -For .NET agent version 8.9 or higher, you can use the following [distributed tracing payload APIs](/docs/apm/agents/net-agent/configuration/distributed-tracing-net-agent/#manual-instrumentation) to manually pass distributed tracing context between New Relic-monitored services that don't automatically connect to one another in a [distributed trace](/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing). - - - - - - - - - - - - - - - - - - - - - - - -
- If you want to... - - Do this... -
- Instrument an outgoing request to an external application or database - - Add a distributed trace payload to an outgoing request using [`InsertDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders). -
- Connect incoming requests with the originator of the request to complete a [span](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#span) of the trace - - Receive a payload on an incoming request using [`AcceptDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders). -
- -For .NET agent versions lower than 8.9, use [cross application tracing](/docs/apm/transactions/cross-application-traces/introduction-cross-application-traces). - -## Collect or ignore errors [#errors] - -Usually the .NET agent detects errors automatically. However, you can manually mark an error with the agent. You can also [ignore errors](/docs/apm/applications-menu/error-analytics/ignoring-errors-new-relic-apm) . - - - - - - - - - - - - - - - - - - - - - - - -
- If you want to... - - Do this... -
- Report an error the .NET agent does not report automatically - - Use [`NoticeError()`](/docs/agents/net-agent/net-agent-api/notice-error). -
- Capture errors or prevent the .NET agent from reporting an error at all - - Use your [.NET agent configuration file](/docs/agents/net-agent/configuration/net-agent-configuration#error_collector). -
- -## Send custom event and metric data from your app [#custom-data] - -APM includes a number of ways to record arbitrary custom data. For an explanation of New Relic data types, see [Data collection](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- If you want to... - - Do this... -
- Send data about an event so you can analyze it in dashboards - - Create a [custom event](/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents#net-att). See [`RecordCustomEvent()`](/docs/agents/net-agent/net-agent-api/record-custom-event). -
- Tag your events with metadata to filter and facet them in dashboards or error analytics - - Add [custom attributes](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes). See .NET agent attributes and [Enable and disable attributes](/docs/agents/net-agent/attributes/enable-disable-attributes-net). -
- Report custom performance data - - Use [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/record-metric) to create a [custom metric](/docs/agents/manage-apm-agents/agent-data/collect-custom-metrics). To view the data, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data). -
- -## Control the browser monitoring agent [#browser] - -Usually the agent is added automatically to your pages or deployed by copy/pasting the JavaScript snippet. For more information about these recommended methods, see [Add apps to browser monitoring](/docs/browser/new-relic-browser/installation-configuration/add-apps-new-relic-browser). - -However, you can also control the browser agent via APM agent API calls. For more information, see [Browser monitoring and the .NET agent](/docs/agents/net-agent/instrumentation-features/new-relic-browser-net-agent). diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/iagent.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/iagent.mdx deleted file mode 100644 index a33cde829f6..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/iagent.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: IAgent -type: apiDoc -shortDescription: 'Provides access to agent artifacts and methods, such as the currently executing transaction.' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -redirects: - - /docs/agents/net-agent/net-agent-api/iagent - - /docs/agents/net-agent/net-agent-api/iagent-net-agent-api -freshnessValidatedDate: never ---- - -## Syntax - -```cs -public interface IAgent -``` - -Provides access to agent artifacts and methods, such as the currently executing transaction. - -## Requirements - -Agent version 8.9 or higher. - -Compatible with all app types. - -## Description - -Provides access to agent artifacts and methods, such as the currently executing transaction. To obtain a reference to `IAgent`, use [`GetAgent`](/docs/agents/net-agent/net-agent-api/getagent). - -### Properties - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- CurrentTransaction - - Property providing access to the currently executing transaction via the [ITransaction](/docs/agents/net-agent/net-agent-api/itransaction) interface. Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). -
- CurrentSpan - - Property providing access to the currently executing span via the [ISpan](/docs/agents/net-agent/net-agent-api/iSpan) interface. -
- -## Examples - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx deleted file mode 100644 index 0fa76829aa6..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: IgnoreApdex (.NET agent API) -type: apiDoc -shortDescription: Ignore the current transaction when calculating Apdex. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction when calculating your app's overall Apdex score. -redirects: - - /docs/agents/net-agent/net-agent-api/ignore-apdex - - /docs/agents/net-agent/net-agent-api/ignoreapdex-net-agent -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex() -``` - -Ignore the current transaction when calculating Apdex. - -## Requirements - -Compatible with all agent versions. - -## Description - -Ignores the current transaction when calculating your [Apdex score](/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction). This is useful when you have either very short or very long transactions (such as file downloads) that can skew your Apdex score. - -## Examples - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex(); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx deleted file mode 100644 index da32e739bb6..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: IgnoreTransaction (.NET agent API) -type: apiDoc -shortDescription: Do not instrument the current transaction. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction entirely. -redirects: - - /docs/agents/net-agent/net-agent-api/ignore-transaction - - /docs/agents/net-agent/net-agent-api/ignoretransaction-net-agent -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction() -``` - -Do not instrument the current transaction. - -## Requirements - -Compatible with all agent versions. - -Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Description - -Ignores the current transaction. - - - You can also ignore transactions [via a custom instrumentation XML file](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation). - - -## Examples - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction(); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx deleted file mode 100644 index 5613fa1ac05..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: IncrementCounter (.NET agent API) -type: apiDoc -shortDescription: Increment the counter for a custom metric by 1. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to increment the value of a custom metric. -redirects: - - /docs/agents/net-agent/net-agent-api/incrementcounter-net-agent-api - - /docs/agents/net-agent/net-agent-api/incrementcounter-net-agent - - /docs/agents/net-agent/net-agent-api/increment-counter -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name) -``` - -Increment the counter for a custom metric by 1. - -## Requirements - -Compatible with all agent versions. - -Compatible with all app types. - -## Description - -Increment the counter for a [custom metric](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) by 1. To view these custom metrics, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) to search metrics and create customizable charts. See also [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent) and [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent). - - - When creating a custom metric, start the name with `Custom/` (for example, `Custom/MyMetric`). For more on naming, see [Collect custom metrics](/docs/apm/agents/manage-apm-agents/agent-data/collect-custom-metrics/). - - -## Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$metric_name` - - _string_ - - Required. The name of the metric to increment. -
- -## Examples - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric"); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/ispan.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/ispan.mdx deleted file mode 100644 index 4af431633f3..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/ispan.mdx +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: ISpan -type: apiDoc -shortDescription: Provides access to span-specific methods in the New Relic API. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -redirects: - - /docs/agents/net-agent/net-agent-api/ispan -freshnessValidatedDate: never ---- - -## Syntax - -```cs -Public interface ISpan -``` - -Provides access to span-specific methods in the New Relic API. - -## Description - -Provides access to span-specific methods in the New Relic .NET agent API. To obtain a reference to `ISpan`, use: - -* The `CurrentSpan` property on [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) (Recommended). -* The `CurrentSpan` property on [`ITransaction`](/docs/agents/net-agent/net-agent-api/itransaction). - -This section contains descriptions and parameters of `ISpan` methods: - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- [`AddCustomAttribute`](#addcustomattribute) - - Add contextual information from your application to the current span in form of attributes. -
- [`SetName`](#setname) - - Changes the name of the current span/segment/metrics that will be reported to New Relic. -
- -## AddCustomAttribute [#addcustomattribute] - -Adds contextual information about your application to the current span in the form of [attributes](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). - -This method requires .NET agent version and .NET agent API [version 8.25](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) or higher. - -### Syntax - -```cs -ISpan AddCustomAttribute(string key, object value) -``` - -### Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `key` - - _string_ - - Identifies the information being reported. Also known as the name. - - * Empty keys are not supported. - * Keys are limited to 255-bytes. Attributes with keys larger than 255-bytes will be ignored. -
- `value` - - _object_ - - The value being reported. - - **Note**: `null` values will not be recorded. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- .NET type - - How the value will be represented -
- `byte`, `Int16`, `Int32`, `Int64` - - `sbyte`, `UInt16`, `UInt32`, `UInt64` - - As an integral value. -
- `float`, `double`, `decimal` - - A decimal-based number. -
- `string` - - A string truncated after 255-bytes. - - Empty strings are supported. -
- `bool` - - True or false. -
- `DateTime` - - A string representation following the ISO-8601 format, including time zone information: - - Example: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - A decimal-based number representing number of seconds. -
- everything else - - The `ToString()` method will be applied. Custom types must have an implementation of `Object.ToString()` or they will throw an exception. -
-
- -### Returns - -A reference to the current span. - -### Usage considerations - -For details about supported data types, see the [Custom Attributes guide](/docs/agents/net-agent/attributes/custom-attributes). - -## Examples - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ISpan currentSpan = agent.CurrentSpan; - -currentSpan - .AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## SetName [#setname] - -Changes the name of the current segment/span that will be reported to New Relic. For segments/spans resulting from custom instrumentation, the metric name reported to New Relic will be altered as well. - -This method requires .NET agent version and .NET agent API version 10.1.0 or higher. - -### Syntax - -```cs -ISpan SetName(string name) -``` - -### Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `name` - - _string_ - - The new name for the span/segment. -
- -### Returns - -A reference to the current span. - -## Examples - -```cs -[Trace] -public void MyTracedMethod() -{ - IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); - ISpan currentSpan = agent.CurrentSpan; - - currentSpan.SetName("MyCustomName"); -} -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx deleted file mode 100644 index 879d777353b..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx +++ /dev/null @@ -1,608 +0,0 @@ ---- -title: ITransaction -type: apiDoc -shortDescription: Provides access to transaction-specific methods in the New Relic API. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -redirects: - - /docs/agents/net-agent/net-agent-api/itransaction - - /docs/agents/net-agent/net-agent-api/itransaction-net-agent-api -freshnessValidatedDate: never ---- - -## Syntax - -```cs -public interface ITransaction -``` - -Provides access to transaction-specific methods in the New Relic API. - -## Description - -Provides access to transaction-specific methods in the New Relic .NET agent API. To obtain a reference to `ITransaction`, use the current transaction method available on [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent). - -The following methods are available on `ITransaction`: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- [`AcceptDistributedTraceHeaders`](#acceptdistributedtraceheaders) - - Accepts incoming trace context headers from another service. -
- [`InsertDistributedTraceHeaders`](#insertdistributedtraceheaders) - - Adds trace context headers to an outgoing request. -
- [`AcceptDistributedTracePayload` (obsolete)](#acceptdistributedtracepayload) - - Accepts an incoming distributed trace payload from another service. -
- [`CreateDistributedTracePayload` (obsolete)](#createdistributedtracepayload) - - Creates a distributed trace payload for inclusion in an outgoing request. -
- [`AddCustomAttribute`](#addcustomattribute) - - Add contextual information from your application to the current transaction in form of attributes. -
- [`CurrentSpan`](#currentspan) - - Provides access to the currently executing [span](/docs/agents/net-agent/net-agent-api/ispan), which provides access to span-specific methods in the New Relic API. -
- [`SetUserId`](#setuserid) - - Associates a User Id to the current transaction. -
- -## AcceptDistributedTraceHeaders - -`ITransaction.AcceptDistributedTraceHeaders` is used to instrument the called service for inclusion in a distributed trace. It links the spans in a trace by accepting a payload generated by [`InsertDistributedTraceHeaders`](/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#transaction-handle-insertDistributedTraceHeaders) or generated by some other W3C Trace Context compliant tracer. This method accepts the headers of an incoming request, looks for W3C Trace Context headers, and if not found, falls back to New Relic distributed trace headers. This method replaces the deprecated [`AcceptDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#acceptdistributedtracepayload) method, which only handles New Relic distributed trace payloads. - -### Syntax - -```cs -void AcceptDistributedTraceHeaders(carrier, getter, transportType) -``` - -### Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- `carrier` - - _<T>_ - - Required. Source of incoming Trace Context headers. -
- `getter` - - _Func<T, string, IEnumerable<string>>_ - - Required. Caller-defined function to extract header data from the carrier. -
- `transportType` - - _TransportType enum_ - - Required. Describes the transport of the incoming payload (for example `TransportType.HTTP`). -
- -### Usage considerations - -* [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `AcceptDistributedTraceHeaders` will be ignored if `InsertDistributedTraceHeaders` or `AcceptDistributedTraceHeaders` has already been called for this transaction. - -### Example - -```cs -HttpContext httpContext = HttpContext.Current; -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -currentTransaction.AcceptDistributedTraceHeaders(httpContext, Getter, TransportType.HTTP); -IEnumerable Getter(HttpContext carrier, string key) -{ - string value = carrier.Request.Headers[key]; - return value == null ? null : new string[] { value }; -} -``` - -## InsertDistributedTraceHeaders - -`ITransaction.InsertDistributedTraceHeaders` is used to implement distributed tracing. It modifies the carrier object that is passed in by adding W3C Trace Context headers and New Relic Distributed Trace headers. The New Relic headers can be disabled with `` in the config. This method replaces the deprecated [`CreateDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#createdistributedtracepayload) method, which only creates New Relic Distributed Trace payloads. - -### Syntax - -```cs -void InsertDistributedTraceHeaders(carrier, setter) -``` - -### Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- `carrier` - - _<T>_ - - Required. Container where Trace Context headers are inserted.. -
- `setter` - - _Action<T, string, string>_ - - Required. Caller-defined Action to insert header data into the carrier. -
- -### Usage considerations - -* [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). - -### Example - -```cs -HttpWebRequest requestMessage = (HttpWebRequest)WebRequest.Create("https://remote-address"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -var setter = new Action((carrier, key, value) => { carrier.Headers?.Set(key, value); }); -currentTransaction.InsertDistributedTraceHeaders(requestMessage, setter); -``` - -## AcceptDistributedTracePayload [#acceptdistributedtracepayload] - - - This API is not available in the .NET agent v9.0 or higher. Please use [`AcceptDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders) instead. - - -Accepts an incoming distributed trace payload from an upstream service. Calling this method links the transaction from the upstream service to this transaction. - -### Syntax - -```cs -void AcceptDistributedPayload(payload, transportType) -``` - -### Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- `payload` - - _string_ - - Required. A string representation of the incoming distributed trace payload. -
- `transportType` - - _TransportType_ - _enum_ - - Recommended. Describes the transport of the incoming payload (for example, `http`). - - Default `TransportType.Unknown`. -
- -### Usage considerations - -* [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* The payload can be a Base64-encoded or plain text string. -* `AcceptDistributedTracePayload` will be ignored if `CreateDistributedTracePayload` has already been called for this transaction. - -### Example - -```cs -//Obtain the information from the request object from the upstream caller. -//The method by which this information is obtain is specific to the transport -//type being used. For example, in an HttpRequest, this information is -//contained in the -header.KeyValuePair metadata = GetMetaDataFromRequest("requestPayload"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AcceptDistributedTracePayload(metadata.Value, TransportType.Queue); -``` - -## CreateDistributedTracePayload (obsolete) [#createdistributedtracepayload] - - - This API is not available in the .NET agent v9.0 or higher. Please use [`InsertDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders) instead. - - -Creates a distributed trace payload for inclusion in an outgoing request to a downstream system. - -### Syntax - -```cs -IDistributedTracePayload CreateDistributedTracePayload() -``` - -### Returns - -An object that implements `IDistributedTracePayload` which provides access to the distributed trace payload that was created. - -### Usage considerations - -* [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `CreateDistributedTracePayload` will be ignored if `AcceptDistributedTracePayload` has already been called for this transaction. - -### Example - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -IDistributedTracePayload payload = transaction.CreateDistributedTracePayload(); -``` - -## AddCustomAttribute - -Adds contextual information about your application to the current transaction in the form of [attributes](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). - -This method requires .NET agent version and .NET agent API [version 8.24.244.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) or higher. It replaced the deprecated [`AddCustomParameter`](/docs/agents/net-agent/net-agent-api/add-custom-parameter). - -### Syntax - -```cs -ITransaction AddCustomAttribute(string key, object value) -``` - -### Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `key` - - _string_ - - Identifies the information being reported. Also known as the name. - - * Empty keys are not supported. - * Keys are limited to 255-bytes. Attributes with keys larger than 255-bytes will be ignored. -
- `value` - - _object_ - - The value being reported. - - **Note**: `null` values will not be recorded. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- .NET type - - How the value will be represented -
- `byte`, `Int16`, `Int32`, `Int64` - - `sbyte`, `UInt16`, `UInt32`, `UInt64` - - As an integral value. -
- `float`, `double`, `decimal` - - A decimal-based number. -
- `string` - - A string truncated after 255-bytes. - - Empty strings are supported. -
- `bool` - - True or false. -
- `DateTime` - - A string representation following the ISO-8601 format, including time zone information: - - Example: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - A decimal-based number representing number of seconds. -
- everything else - - The `ToString()` method will be applied. Custom types must have an implementation of `Object.ToString()` or they will throw an exception. -
- -
- -### Returns - -A reference to the current transaction. - -### Usage considerations - -For details about supported data types, see the [Custom Attributes Guide](/docs/agents/net-agent/attributes/custom-attributes). - -### Example - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## CurrentSpan - -Provides access to the currently executing [span](/docs/apm/agents/net-agent/net-agent-api/ispan/), making [span-specific methods](/docs/apm/agents/net-agent/net-agent-api/ispan) available within the New Relic API. - -### Example - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -ISpan currentSpan = transaction.CurrentSpan; -``` - -## SetUserId - -Associates a User Id with the current transaction. - -This method requires .NET agent and .NET agent API [version 10.9.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-1090) or higher. - -### Syntax - -```cs -ITransaction SetUserId(string userId) -``` - -### Parameters - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `userId` - - _string_ - - The User Id to be associated with this transaction. - - * `null`, empty and whitespace values will be ignored. -
- -### Example - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.SetUserId("BobSmith123"); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/net-agent-api.mdx new file mode 100644 index 00000000000..28688ec2132 --- /dev/null +++ b/src/content/docs/apm/agents/net-agent/net-agent-api/net-agent-api.mdx @@ -0,0 +1,2622 @@ +--- +title: .NET agent API +tags: + - Agents + - NET agent + - API guides +metaDescription: 'A descriptive list of API calls that you can make using the New Relic .NET agent.' +redirects: + - /docs/agents/net-agent/api-guides/guide-using-net-agent-api + - /docs/agents/net-agent/net-agent-api/net-agent-api-guide + - /docs/agents/net-agent/net-agent-api/guide-using-net-agent-api + - /docs/apm/agents/net-agent/net-agent-api + - /docs/apm/agents/net-agent/api-guides/guide-using-net-agent-api + - /docs/agents/net-agent/net-agent-api + - /docs/agents/net-agent/features/net-agent-api + - /docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api + - /docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api + - /docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent + - /docs/agents/net-agent/net-agent-api/disable-browser-monitoring + - /docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api + - /docs/agents/net-agent/net-agent-api/getagent + - /docs/agents/net-agent/net-agent-api/getagent-net-agent-api + - /docs/apm/agents/net-agent/net-agent-api/getagent + - /docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api + - /docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent + - /docs/agents/net-agent/net-agent-api/get-browser-timing-header + - /docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api + - /docs/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api + - /docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api + - /docs/agents/net-agent/net-agent-api/iagent + - /docs/agents/net-agent/net-agent-api/iagent-net-agent-api + - /docs/apm/agents/net-agent/net-agent-api/iagent + - /docs/agents/net-agent/net-agent-api/ignore-apdex + - /docs/agents/net-agent/net-agent-api/ignoreapdex-net-agent + - /docs/apm/agents/net-agent/net-agent-api/ignore-apdex + - /docs/agents/net-agent/net-agent-api/ignore-transaction + - /docs/agents/net-agent/net-agent-api/ignoretransaction-net-agent + - /docs/apm/agents/net-agent/net-agent-api/ignore-transaction + - /docs/agents/net-agent/net-agent-api/incrementcounter-net-agent-api + - /docs/agents/net-agent/net-agent-api/incrementcounter-net-agent + - /docs/agents/net-agent/net-agent-api/increment-counter + - /docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api + - /docs/agents/net-agent/net-agent-api/ispan + - /docs/apm/agents/net-agent/net-agent-api/ispan + - /docs/agents/net-agent/net-agent-api/itransaction + - /docs/agents/net-agent/net-agent-api/itransaction-net-agent-api + - /docs/apm/agents/net-agent/net-agent-api/itransaction + - /docs/agents/net-agent/net-agent-api/noticeerror-net-agent + - /docs/agents/net-agent/net-agent-api/notice-error + - /docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api + - /docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api + - /docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent + - /docs/agents/net-agent/net-agent-api/record-custom-event + - /docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api + - /docs/agents/net-agent/net-agent-api/recordmetric-net-agent-api + - /docs/agents/net-agent/net-agent-api/recordmetric-net-agent + - /docs/agents/net-agent/net-agent-api/record-metric + - /docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api + - /docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api + - /docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent + - /docs/agents/net-agent/net-agent-api/record-response-time-metric + - /docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api + - /docs/agents/net-agent/net-agent-api/set-application-name + - /docs/agents/net-agent/net-agent-api/setapplicationname-net-agent + - /docs/apm/agents/net-agent/net-agent-api/set-application-name + - /docs/agents/net-agent/net-agent-api/set-transaction-uri + - /docs/agents/net-agent/net-agent-api/settransactionuri + - /docs/apm/agents/net-agent/net-agent-api/set-transaction-uri + - /docs/agents/net-agent/net-agent-api/set-user-parameters + - /docs/agents/net-agent/net-agent-api/setuserparameters-net-agent + - /docs/apm/agents/net-agent/net-agent-api/set-user-parameters + - /docs/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api + - /docs/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent + - /docs/agents/net-agent/net-agent-api/set-error-group-callback + - /docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api + - /docs/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api + - /docs/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent + - /docs/agents/net-agent/net-agent-api/set-llm-token-counting-callback + - /docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api + - /docs/agents/net-agent/net-agent-api/settransactionname-net-agent-api + - /docs/agents/net-agent/net-agent-api/settransactionname-net-agent + - /docs/agents/net-agent/net-agent-api/set-transaction-name + - /docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api + - /docs/agents/net-agent/net-agent-api/start-agent + - /docs/agents/net-agent/net-agent-api/startagent-net-agent + - /docs/apm/agents/net-agent/net-agent-api/start-agent + - /docs/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0 + - /docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0 + +freshnessValidatedDate: never +--- + +New Relic's .NET agent includes an API that allows you to extend the agent's standard functionality. For example, you can use the .NET agent API to: + +* Customize your app name +* Create custom transaction parameters +* Report custom errors and metrics + +You can also customize some of the .NET agent's default behavior by adjusting [configuration settings](/docs/agents/net-agent/configuration/net-agent-configuration) or using [custom instrumentation](/docs/agents/net-agent/custom-instrumentation/introduction-net-custom-instrumentation). + +## Requirements + +To use the .NET agent API, make sure you have the [latest .NET agent release](/docs/release-notes/agent-release-notes/net-release-notes). Then, add a reference to the agent in your project using one of the two options below: + + * Add a reference to `NewRelic.Api.Agent.dll` to your project. + + OR + + * View and download the API package from the [NuGet Package Library](https://www.nuget.org/packages/NewRelic.Agent.Api/). + +## List of API calls + + The following list contains the different calls you can make with the API, including syntax, requirements, functionality, and examples: + + + + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override]) + ``` + + Disable automatic injection of browser monitoring snippet on specific pages. + + ### Requirements + + * Compatible with all agent versions. + * Must be called inside a [transaction](/docs/glossary/glossary/#transaction). + + ### Description + + Add this call to disable the **automatic** injection of [](/docs/browser/new-relic-browser/getting-started/new-relic-browser) scripts on specific pages. You can also add an optional override to disable **both** manual and automatic injection. In either case, put this API call as close as possible to the top of the view in which you want browser disabled. + + + Compare [`GetBrowserTimingHeader()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#GetBrowserTimingHeader), which **adds** the browser script to the page. + + + ### Parameters + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$override` + + _boolean_ + + Optional. When `true`, disables all injection of browser scripts. This flag affects both manual and automatic injection. This also overrides the [`GetBrowserTimingHeader()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#GetBrowserTimingHeader) call. +
+ + ### Examples + + #### Disable automatic injection + + This example disables only the **automatic** injection of the snippet: + + ```cs + NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(); + ``` + + #### Disable automatic and manual injection + + This example disables **both** automatic and manual injection of the snippet: + + ```cs + NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true); + ``` +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.GetAgent() + ``` + + Get access to the agent via the `IAgent` interface. + + ### Requirements + + * Agent version 8.9 or higher. + * Compatible with all app types. + + ### Description + + Get access to agent API methods via the [`IAgent`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#IAgent) interface. + + ### Return values + + An implementation of [IAgent](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#IAgent) providing access to the IAgent API. + + ### Examples + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ``` + + + + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(); + NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(string nonce); + ``` + + Generate a browser monitoring HTML snippet to instrument end-user browsers. + + ### Requirements + + * Compatible with all agent versions. + * Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). + + ### Description + + Returns an HTML snippet used to enable . The snippet instructs the browser to fetch a small JavaScript file and start the page timer. You can then insert the returned snippet into the header of your HTML webpages. For more information, see [Adding apps to browser monitoring](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser). + + + Compare [`DisableBrowserMonitoring()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#DisableBrowserMonitoring), which **disables** the browser script on a page. + + + ### Parameters + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `nonce` + + _string_ + + The per-request, cryptographic nonce used by Content Security Policy policies. +
+ + + This API call requires updates to security allow lists. For more information about Content Security Policy (CSP) considerations, visit the [browser monitoring compatibility and requirements](/docs/browser/new-relic-browser/getting-started/compatibility-requirements-browser-monitoring) page. + + + ### Return values + + An HTML string to be embedded in a page header. + + ### Examples + + + ```aspnet + + + <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%> + ... + + + ... + ``` + + ```aspnet + + + <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")%> + ... + + + ... + ``` + + + ```cshtml + + + + @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) + ... + + + ... + ``` + + ```cshtml + + + + @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) + ... + + + ... + ``` + + + + This API is not supported for Blazor Webassembly, because the agent is unable to instrument Webassembly code. The following examples are for Blazor Server applications only. Use the [copy-paste method](/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste) of adding the browser agent to Blazor Webassembly pages. + + + + This API can not be placed in a `` element of a `.razor` page. Instead, it should be called from `_Layout.cshtml` or an equivalent layout file. + + ```cshtml + + + + @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) + ... + + + ... + ``` + + ```cshtml + + + + @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) + ... + + + ... + ``` + + + + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.GetLinkingMetadata(); + ``` + + Returns key/value pairs which can be used to link traces or entities. + + ### Requirements + + * Agent version 8.19 or higher. + * Compatible with all app types. + + ### Description + + The dictionary of key/value pairs returned includes items used to link traces and entities in the APM product. It will only contain items with meaningful values. For instance, if distributed tracing is disabled, `trace.id` will not be included. + + ### Return values + + `Dictionary ()` returned includes items used to link traces and entities in the APM product. + + ### Examples + + ```cs + NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + var linkingMetadata = Agent.GetLinkingMetadata(); + foreach (KeyValuePair kvp in linkingMetadata) + { + Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); + } + ``` + + + + ### Syntax + + ```cs + public interface IAgent + ``` + + Provides access to agent artifacts and methods, such as the currently executing transaction. + + ### Requirements + + * Agent version 8.9 or higher. + * Compatible with all app types. + + ### Description + + Provides access to agent artifacts and methods, such as the currently executing transaction. To obtain a reference to `IAgent`, use [`GetAgent`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#GetAgent). + + ### Properties + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ CurrentTransaction + + Property providing access to the currently executing transaction via the [ITransaction](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#ITransaction) interface. Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). +
+ CurrentSpan + + Property providing access to the currently executing span via the [ISpan](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#ISpan) interface. +
+ + ### Examples + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction transaction = agent.CurrentTransaction; + ``` + +
+ + ### Syntax + + ```cs + public interface ITransaction + ``` + + Provides access to transaction-specific methods in the New Relic API. + + ### Description + + Provides access to transaction-specific methods in the New Relic .NET agent API. To obtain a reference to `ITransaction`, use the current transaction method available on [`IAgent`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#IAgent). + + The following methods are available on `ITransaction`: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ [`AcceptDistributedTraceHeaders`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AcceptDistributedTraceHeaders) + + Accepts incoming trace context headers from another service. +
+ [`InsertDistributedTraceHeaders`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#InsertDistributedTraceHeaders) + + Adds trace context headers to an outgoing request. +
+ [`AcceptDistributedTracePayload` (obsolete)](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AcceptDistributedTraceHeaders) + + Accepts an incoming distributed trace payload from another service. +
+ [`CreateDistributedTracePayload` (obsolete)](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#CreateDistributedTracePayload) + + Creates a distributed trace payload for inclusion in an outgoing request. +
+ [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute) + + Add contextual information from your application to the current transaction in form of attributes. +
+ [`CurrentSpan`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#CurrentSpan) + + Provides access to the currently executing [span](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#ISpan), which provides access to span-specific methods in the New Relic API. +
+ [`SetUserId`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#SetUserId) + + Associates a user ID to the current transaction. +
+ + + ### Syntax + + ```cs + void AcceptDistributedTraceHeaders(carrier, getter, transportType) + ``` + + Instrument the called service for inclusion in a distributed trace. + + ### Description + + `ITransaction.AcceptDistributedTraceHeaders` is used to links the spans in a trace by accepting a payload generated by [`InsertDistributedTraceHeaders`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#InsertDistributedTraceHeaders) or generated by some other W3C Trace Context compliant tracer. This method accepts the headers of an incoming request, looks for W3C Trace Context headers, and if not found, falls back to New Relic distributed trace headers. This method replaces the deprecated [`AcceptDistributedTracePayload`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AcceptDistributedTracePayload) method, which only handles New Relic distributed trace payloads. + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ `carrier` + + _<T>_ + + Required. Source of incoming Trace Context headers. +
+ `getter` + + _Func<T, string, IEnumerable<string>>_ + + Required. Caller-defined function to extract header data from the carrier. +
+ `transportType` + + _TransportType enum_ + + Required. Describes the transport of the incoming payload (for example `TransportType.HTTP`). +
+ + ### Usage considerations + + * [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). + * `AcceptDistributedTraceHeaders` will be ignored if `InsertDistributedTraceHeaders` or `AcceptDistributedTraceHeaders` has already been called for this transaction. + + ### Example + + ```cs + HttpContext httpContext = HttpContext.Current; + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction currentTransaction = agent.CurrentTransaction; + currentTransaction.AcceptDistributedTraceHeaders(httpContext, Getter, TransportType.HTTP); + IEnumerable Getter(HttpContext carrier, string key) + { + string value = carrier.Request.Headers[key]; + return value == null ? null : new string[] { value }; + } + ``` +
+ + + ### Syntax + + ```cs + void InsertDistributedTraceHeaders(carrier, setter) + ``` + + Implement distributed tracing. + + ### Description + + `ITransaction.InsertDistributedTraceHeaders` modifies the carrier object that is passed in by adding W3C Trace Context headers and New Relic Distributed Trace headers. The New Relic headers can be disabled with `` in the config. This method replaces the deprecated [`CreateDistributedTracePayload`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#CreateDistributedTracePayload) method, which only creates New Relic distributed trace payloads. + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ `carrier` + + _<T>_ + + Required. Container where trace context headers are inserted.. +
+ `setter` + + _Action<T, string, string>_ + + Required. Caller-defined action to insert header data into the carrier. +
+ + ### Usage considerations + + * [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). + + ### Example + + ```cs + HttpWebRequest requestMessage = (HttpWebRequest)WebRequest.Create("https://remote-address"); + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction currentTransaction = agent.CurrentTransaction; + var setter = new Action((carrier, key, value) => { carrier.Headers?.Set(key, value); }); + currentTransaction.InsertDistributedTraceHeaders(requestMessage, setter); + ``` +
+ + + + This API is not available in the .NET agent v9.0 or higher. Please use [`AcceptDistributedTraceHeaders`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AcceptDistributedTraceHeaders) instead. + + + ### Syntax + + ```cs + void AcceptDistributedPayload(payload, transportType) + ``` + + Accepts an incoming distributed trace payload from an upstream service. Calling this method links the transaction from the upstream service to this transaction. + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ `payload` + + _string_ + + Required. A string representation of the incoming distributed trace payload. +
+ `transportType` + + _TransportType_ + _enum_ + + Recommended. Describes the transport of the incoming payload (for example, `http`). + + Default `TransportType.Unknown`. +
+ + ### Usage considerations + + * [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). + * The payload can be a Base64-encoded or plain text string. + * `AcceptDistributedTracePayload` will be ignored if `CreateDistributedTracePayload` has already been called for this transaction. + + ### Example + + ```cs + //Obtain the information from the request object from the upstream caller. + //The method by which this information is obtain is specific to the transport + //type being used. For example, in an HttpRequest, this information is + //contained in the + header.KeyValuePair metadata = GetMetaDataFromRequest("requestPayload"); + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction transaction = agent.CurrentTransaction; + transaction.AcceptDistributedTracePayload(metadata.Value, TransportType.Queue); + ``` + +
+ + + This API is not available in the .NET agent v9.0 or higher. Please use [`InsertDistributedTraceHeaders`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#InsertDistributedTraceHeaders) instead. + + + ### Syntax + + ```cs + IDistributedTracePayload CreateDistributedTracePayload() + ``` + + Creates a distributed trace payload for inclusion in an outgoing request to a downstream system. + + ### Returns + + An object that implements `IDistributedTracePayload` which provides access to the distributed trace payload that was created. + + ### Usage considerations + + * [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). + * `CreateDistributedTracePayload` will be ignored if `AcceptDistributedTracePayload` has already been called for this transaction. + + ### Example + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction transaction = agent.CurrentTransaction; + IDistributedTracePayload payload = transaction.CreateDistributedTracePayload(); + ``` + + + + + ### Syntax + + ```cs + ITransaction AddCustomAttribute(string key, object value) + ``` + + Adds contextual information about your application to the current transaction in the form of [attributes](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). + + This method requires .NET agent version and .NET agent API [version 8.24.244.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) or higher. It replaced the deprecated `AddCustomParameter`. + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `key` + + _string_ + + Identifies the information being reported. Also known as the name. + + * Empty keys are not supported. + * Keys are limited to 255-bytes. Attributes with keys larger than 255-bytes will be ignored. +
+ `value` + + _object_ + + The value being reported. + + **Note**: `null` values will not be recorded. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ .NET type + + How the value will be represented +
+ `byte`, `Int16`, `Int32`, `Int64` + + `sbyte`, `UInt16`, `UInt32`, `UInt64` + + As an integral value. +
+ `float`, `double`, `decimal` + + A decimal-based number. +
+ `string` + + A string truncated after 255-bytes. + + Empty strings are supported. +
+ `bool` + + True or false. +
+ `DateTime` + + A string representation following the ISO-8601 format, including time zone information: + + Example: `2020-02-13T11:31:19.5767650-08:00` +
+ `TimeSpan` + + A decimal-based number representing number of seconds. +
+ everything else + + The `ToString()` method will be applied. Custom types must have an implementation of `Object.ToString()` or they will throw an exception. +
+ + ### Returns + + A reference to the current transaction. + + ### Usage considerations + + For details about supported data types, see [Custom attributes](/docs/agents/net-agent/attributes/custom-attributes). + + ### Example + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction transaction = agent.CurrentTransaction; + transaction.AddCustomAttribute("customerName","Bob Smith") + .AddCustomAttribute("currentAge",31) + .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) + .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); + ``` + +
+ + + Provides access to the currently executing [span](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#ISpan), making span-specific methods available within the New Relic API. + + ### Example + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction transaction = agent.CurrentTransaction; + ISpan currentSpan = transaction.CurrentSpan; + ``` + + + + + ### Syntax + + ```cs + ITransaction SetUserId(string userId) + ``` + + Associates a user ID with the current transaction. + + This method requires .NET agent and .NET agent API [version 10.9.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-1090) or higher. + + ### Parameters + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `userId` + + _string_ + + The User Id to be associated with this transaction. + + * `null`, empty and whitespace values will be ignored. +
+ + ### Example + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ITransaction transaction = agent.CurrentTransaction; + transaction.SetUserId("BobSmith123"); + ``` +
+
+
+ + ### Syntax + + ```cs + Public interface ISpan + ``` + + Provides access to span-specific methods in the New Relic API. + + ### Description + + Provides access to span-specific methods in the New Relic .NET agent API. To obtain a reference to `ISpan`, use: + + * The `CurrentSpan` property on [`IAgent`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#IAgent) (Recommended). + * The `CurrentSpan` property on [`ITransaction`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#ITransaction). + + This section contains descriptions and parameters of `ISpan` methods: + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute) + + Add contextual information from your application to the current span in form of attributes. +
+ [`SetName`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#setname) + + Changes the name of the current span/segment/metrics that will be reported to New Relic. +
+ + + + Adds contextual information about your application to the current span in the form of [attributes](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). + + This method requires .NET agent version and .NET agent API [version 8.25](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) or higher. + + ### Syntax + + ```cs + ISpan AddCustomAttribute(string key, object value) + ``` + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `key` + + _string_ + + Identifies the information being reported. Also known as the name. + + * Empty keys are not supported. + * Keys are limited to 255-bytes. Attributes with keys larger than 255-bytes will be ignored. +
+ `value` + + _object_ + + The value being reported. + + **Note**: `null` values will not be recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ .NET type + + How the value will be represented +
+ `byte`, `Int16`, `Int32`, `Int64` + + `sbyte`, `UInt16`, `UInt32`, `UInt64` + + As an integral value. +
+ `float`, `double`, `decimal` + + A decimal-based number. +
+ `string` + + A string truncated after 255-bytes. + + Empty strings are supported. +
+ `bool` + + True or false. +
+ `DateTime` + + A string representation following the ISO-8601 format, including time zone information: + + Example: `2020-02-13T11:31:19.5767650-08:00` +
+ `TimeSpan` + + A decimal-based number representing number of seconds. +
+ everything else + + The `ToString()` method will be applied. Custom types must have an implementation of `Object.ToString()` or they will throw an exception. +
+
+ + ### Returns + + A reference to the current span. + + ### Usage considerations + + For details about supported data types, see the [Custom Attributes guide](/docs/agents/net-agent/attributes/custom-attributes). + + ### Examples + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ISpan currentSpan = agent.CurrentSpan; + + currentSpan + .AddCustomAttribute("customerName","Bob Smith") + .AddCustomAttribute("currentAge",31) + .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) + .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); + ``` +
+ + Changes the name of the current segment/span that will be reported to New Relic. For segments/spans resulting from custom instrumentation, the metric name reported to New Relic will be altered as well. + + This method requires .NET agent version and .NET agent API version 10.1.0 or higher. + + ### Syntax + + ```cs + ISpan SetName(string name) + ``` + + ### Parameters + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `name` + + _string_ + + The new name for the span/segment. +
+ + ### Returns + + A reference to the current span. + + ### Examples + + ```cs + [Trace] + public void MyTracedMethod() + { + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + ISpan currentSpan = agent.CurrentSpan; + + currentSpan.SetName("MyCustomName"); + } + ``` +
+
+ +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.IgnoreApdex() + ``` + + Ignore the current transaction when calculating Apdex. + + ### Requirements + + Compatible with all agent versions. + + ### Description + + Ignores the current transaction when calculating your [Apdex score](/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction). This is useful when you have either very short or very long transactions (such as file downloads) that can skew your Apdex score. + + ### Examples + + ```cs + NewRelic.Api.Agent.NewRelic.IgnoreApdex(); + ``` + + + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.IgnoreTransaction() + ``` + + Do not instrument the current transaction. + + ### Requirements + + * Compatible with all agent versions. + * Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). + + ### Description + + Ignores the current transaction. + + + You can also ignore transactions [via a custom instrumentation XML file](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation). + + + ### Examples + + ```cs + NewRelic.Api.Agent.NewRelic.IgnoreTransaction(); + ``` + + + + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name) + ``` + + Increment the counter for a custom metric by 1. + + ### Requirements + + * Compatible with all agent versions. + * Compatible with all app types. + + ### Description + + Increment the counter for a [custom metric](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) by 1. To view these custom metrics, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) to search metrics and create customizable charts. See also [`RecordMetric()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#RecordMetric) and [`RecordResponseTimeMetric()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#RecordResponseTimeMetric). + + + When creating a custom metric, start the name with `Custom/` (for example, `Custom/MyMetric`). For more on naming, see [Collect custom metrics](/docs/apm/agents/manage-apm-agents/agent-data/collect-custom-metrics/). + + + ### Parameters + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$metric_name` + + _string_ + + Required. The name of the metric to increment. +
+ + ### Examples + + ```cs + NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric"); + ``` +
+ + + ### Overloads [#overloads] + + Notice an error and report to New Relic, along with optional custom attributes. + + ```cs + NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception); + NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes); + NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes); + NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected); + ``` + + ### Requirements + + This API call is compatible with: + + * All agent versions + * All app types + + ### Description + + Notice an error and report it to New Relic along with optional custom attributes. For each transaction, the agent only retains the exception and attributes from the first call to `NoticeError()`. You can pass an actual exception, or pass a string to capture an arbitrary error message. + + If this method is invoked within a [transaction](/docs/glossary/glossary/#transaction), the agent reports the exception within the parent transaction. If it is invoked outside of a transaction, the agent creates an [error trace](/docs/errors-inbox/apm-tab//#trace-details) and categorizes the error in the New Relic UI as a `NewRelic.Api.Agent.NoticeError` API call. If invoked outside of a transaction, the `NoticeError()` call will not contribute to the error rate of an application. + + The agent adds the attributes only to the traced error; it does not send them to New Relic. For more information, see [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute). + + Errors reported with this API are still sent to New Relic when they are reported within a transaction that results in an HTTP status code, such as a `404`, that is configured to be ignored by agent configuration. For more information, see our documentation about [managing errors in APM](/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected). + + Review the sections below to see examples of how to use this call. + + + + ```cs + NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception) + ``` + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$exception` + + _Exception_ + + Required. The `Exception` you want to instrument. Only the first 10,000 characters from the stack trace are retained. +
+
+ + ```cs + NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes) + ``` + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$exception` + + _Exception_ + + Required. The `Exception` you want to instrument. Only the first 10,000 characters from the stack trace are retained. +
+ `$attributes` + + _IDictionary<TKey, TValue>_ + + Specify key/value pairs of attributes to annotate the error message. The `TKey` must be a string, the `TValue` can be a string or object. +
+
+ + ```cs + NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes) + ``` + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$error_message` + + _string_ + + Required. Specify a string to report to New Relic as though it's an exception. This method creates both [error events and error traces](/docs/errors-inbox/apm-tab/#events). Only the first 1023 characters are retained in error events, while error traces retain the full message. +
+ `$attributes` + + _IDictionary<TKey, TValue>_ + + Required (can be null). Specify key/value pairs of attributes to annotate the error message. The `TKey` must be a string, the `TValue` can be a string or object, to send no attributes, pass `null`. +
+
+ + ```cs + NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected) + ``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$error_message` + + _string_ + + Required. Specify a string to report to New Relic as though it's an exception. This method creates both [error events and error traces](/docs/tutorial-error-tracking/respond-outages/). Only the first 1023 characters are retained in error events, while error traces retain the full message. +
+ `$attributes` + + _IDictionary<TKey, TValue>_ + + Required (can be null). Specify key/value pairs of attributes to annotate the error message. The `TKey` must be a string, the `TValue` can be a string or object, to send no attributes, pass `null`. +
+ `$is_expected` + + _bool_ + + Mark error as expected so that it won't affect Apdex score and error rate. +
+
+
+ + ### Examples + + #### Pass an exception without custom attributes + + ```cs + try + { + string ImNotABool = "43"; + bool.Parse(ImNotABool); + } + catch (Exception ex) + { + NewRelic.Api.Agent.NewRelic.NoticeError(ex); + } + ``` + + #### Pass an exception with custom attributes + + ```cs + try + { + string ImNotABool = "43"; + bool.Parse(ImNotABool); + } + catch (Exception ex) + { + var errorAttributes = new Dictionary() {{"foo", "bar"},{"baz", "luhr"}}; + NewRelic.Api.Agent.NewRelic.NoticeError(ex, errorAttributes); + } + ``` + + #### Pass an error message string with custom attributes + + ```cs + try + { + string ImNotABool = "43"; + bool.Parse(ImNotABool); + } + catch (Exception ex) + { + var errorAttributes = new Dictionary{{"foo", "bar"},{"baz", "luhr"}}; + NewRelic.Api.Agent.NewRelic.NoticeError("String error message", errorAttributes); + } + ``` + + #### Pass an error message string without custom attributes + + ```cs + try + { + string ImNotABool = "43"; + bool.Parse(ImNotABool); + } + catch (Exception ex) + { + NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null); + } + ``` + + #### Pass an error message string and mark it as expected + + ```cs + try + { + string ImNotABool = "43"; + bool.Parse(ImNotABool); + } + catch (Exception ex) + { + NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null, true); + } + ``` +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) + ``` + + Records a custom event with the given name and attributes. + + ### Requirements + + * Compatible with all agent versions. + * Compatible with all app types. + + ### Description + + Records a [custom event](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#event-data) with the given name and attributes, which you can query in the [query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder). To verify if an event is being recorded correctly, look for the data in [dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards). + + + + * Sending a lot of events can increase the memory overhead of the agent. + * Additionally, posts greater than 1MB (10^6 bytes) in size will not be recorded regardless of the maximum number of events. + * Custom events are limited to 64 attributes. + * For more information about how custom attribute values are processed, see the [custom attributes](/docs/agents/net-agent/attributes/custom-attributes) guide. + + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `eventType` + + _string_ + + Required. The name of the event type to record. Strings over 255 characters will result in the API call not being sent to New Relic. The name can only contain alphanumeric characters, underscores `_`, and colons `:`. For additional restrictions on event type names, see [Reserved words](/docs/data-apis/custom-data/custom-events/data-requirements-limits-custom-event-data/#reserved-words). +
+ `attributeValues` + + _IEnumerable<string, object>_ + + Required. Specify key/value pairs of attributes to annotate the event. +
+ + ### Examples + + #### Record values [#record-strings] + + ```cs + var eventAttributes = new Dictionary() + { +   {"foo", "bar"}, +   {"alice", "bob"}, +   {"age", 32}, +   {"height", 21.3f} + }; + + NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes); + ``` +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.RecordMetric(string $metric_name, single $metric_value) + ``` + + Records a custom metric with the given name. + + ### Requirements + + * Compatible with all agent versions. + * Compatible with all app types. + + ### Description + + Records a [custom metric](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) with the given name. To view these custom metrics, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) to search metrics and create customizable charts. See also [`IncrementCounter()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#IncrementCounter) and [`RecordResponseTimeMetric()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#RecordResponseTimeMetric). + + + When creating a custom metric, start the name with `Custom/` (for example, `Custom/MyMetric`). + + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$metric_name` + + _string_ + + Required. The name of the metric to record. Only the first 255 characters are retained. +
+ `$metric_value` + + _single_ + + Required. The quantity to record for the metric. +
+ + ### Examples + + #### Record response time of a sleeping process [#record-stopwatch] + + ```cs + Stopwatch stopWatch = Stopwatch.StartNew(); + System.Threading.Thread.Sleep(5000); + stopWatch.Stop(); + NewRelic.Api.Agent.NewRelic.RecordMetric("Custom/DEMO_Record_Metric", stopWatch.ElapsedMilliseconds); + ``` + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value) + ``` + + Records a custom metric with the given name and response time in milliseconds. + + ### Requirements + + * Compatible with all agent versions. + * Compatible with all app types. + + ### Description + + Records the response time in milliseconds for a [custom metric](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics). To view these custom metrics, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) to search metrics and create customizable charts. See also [`IncrementCounter()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#IncrementCounter) and [`RecordMetric()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#RecordMetric). + + + When creating a custom metric, start the name with `Custom/` (for example, `Custom/MyMetric`). + + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$metric_name` + + _string_ + + Required. The name of the response time metric to record. Only the first 255 characters are retained. +
+ `$metric_value` + + _Int64_ + + Required. The response time to record in milliseconds. +
+ + ### Examples + + #### Record response time of a sleeping process [#record-stopwatch] + + ```cs + Stopwatch stopWatch = Stopwatch.StartNew(); + System.Threading.Thread.Sleep(5000); + stopWatch.Stop(); + NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds); + ``` + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.SetApplicationName(string $name[, string $name_2, string $name_3]) + ``` + + Set the app name for data rollup. + + ### Requirements + + * Compatible with all agent versions. + * Compatible with all app types. + + ### Description + + Set the application name(s) reported to New Relic. For more information about application naming, see [Name your .NET application](/docs/agents/net-agent/installation-configuration/name-your-net-application). This method is intended to be called once, during startup of an application. + + + Updating the app name forces the agent to restart. The agent discards any unreported data associated with previous app names. Changing the app name multiple times during the lifecycle of an application is not recommended due to the associated data loss. + + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$name` + + _string_ + + Required. The primary application name. +
+ `$name_2` + + `$name_3` + + _string_ + + Optional. Second and third names for app rollup. For more information, see [Use multiple names for an app](/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app). +
+ + ### Examples + + ```cs + NewRelic.Api.Agent.NewRelic.SetApplicationName("AppName1", "AppName2"); + ``` +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(Func, string> errorGroupCallback); + ``` + Provide a callback method that takes an `IReadOnlyDictionary` of attribute data, and returns an error group name. + + ### Requirements + + This API call is compatible with: + + * Agent version 10.9.0 or higher. + * All app types + + ### Description + + Set a callback method that the agent will use to determine the error group name for error events and traces. This name is used in the Errors Inbox to group errors into logical groups. + + The callback method must accept a single argument of type `IReadOnlyDictionary`, and return a string (the error group name). The `IReadOnlyDictionary` is a collection of [attribute data](/docs/apm/agents/manage-apm-agents/agent-data/agent-attributes/) associated with each error event, including custom attributes. + + The exact list of attributes available for each error will vary depending on: + + * What application code generated the error + * Agent configuration settings + * Whether any custom attributes were added + + However, the following attributes should always exist: + + * `error.class` + * `error.message` + * `stack_trace` + * `transactionName` + * `request.uri` + * `error.expected` + + An empty string may be returned for the error group name when the error can't be assigned to a logical error group. + + ### Parameters + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$callback` + + _{'Func,string>'}_ + + + The callback to determine the error group name based on attribute data. +
+ + ### Examples + + Group errors by error class name: + + ```cs + Func, string> errorGroupCallback = (attributes) => { + string errorGroupName = string.Empty; + if (attributes.TryGetValue("error.class", out var errorClass)) + { + if (errorClass.ToString() == "System.ArgumentOutOfRangeException" || errorClass.ToString() == "System.ArgumentNullException") + { + errorGroupName = "ArgumentErrors"; + } + else + { + errorGroupName = "OtherErrors"; + } + } + return errorGroupName; + }; + + NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); + ``` + + Group errors by transaction name: + + ```cs + Func, string> errorGroupCallback = (attributes) => { + string errorGroupName = string.Empty; + if (attributes.TryGetValue("transactionName", out var transactionName)) + { + if (transactionName.ToString().IndexOf("WebTransaction/MVC/Home") != -1) + { + errorGroupName = "HomeControllerErrors"; + } + else + { + errorGroupName = "OtherControllerErrors"; + } + } + return errorGroupName; + }; + + NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); + ``` + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name) + ``` + + Sets the name of the current transaction. + + ### Requirements + + * Compatible with all agent versions. + * Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). + + ### Description + + Sets the name of the current transaction. Before you use this call, ensure you understand the implications of [metric grouping issues](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues). + + If you use this call multiple times within the same transaction, each call overwrites the previous call and the last call sets the name. + + + Do not use brackets `[suffix]` at the end of your transaction name. New Relic automatically strips brackets from the name. Instead, use parentheses `(suffix)` or other symbols if needed. + + + Unique values like URLs, page titles, hex values, session IDs, and uniquely identifiable values should not be used in naming your transactions. Instead, add that data to the transaction as a custom parameter with the [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute) call. + + + Do not create more than 1000 unique transaction names (for example, avoid naming by URL if possible). This will make your charts less useful, and you may run into limits New Relic sets on the number of unique transaction names per account. It also can slow down the performance of your application. + + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$category` + + _string_ + + Required. The category of this transaction, which you can use to distinguish different types of transactions. Defaults to **`Custom`**. Only the first 255 characters are retained. +
+ `$name` + + _string_ + + Required. The name of the transaction. Only the first 255 characters are retained. +
+ + ### Examples + + ```cs + NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction"); + ``` + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.SetTransactionUri(Uri $uri) + ``` + + Sets the URI of the current transaction. + + ### Requirements + + * Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). + * Agent version 6.16 or higher. + + + This method only works when used within a transaction created using the `Transaction` attribute with the `Web` property set to `true`. (See [Custom instrumentation via attributes](/docs/agents/net-agent/api-guides/net-agent-api-instrument-using-attributes).) It provides support for custom web-based frameworks that the agent does not automatically support. + + + ### Description + + Sets the URI of the current transaction. The URI appears in the `request.uri` attribute of [transaction traces](/docs/apm/transactions/transaction-traces/transaction-traces) and [transaction events](/docs/using-new-relic/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data), and it also can affect transaction naming. + + If you use this call multiple times within the same transaction, each call overwrites the previous call. The last call sets the URI. + + **Note**: as of agent version 8.18, the `request.uri` attribute's value is set to the value of the `Uri.AbsolutePath` property of the `System.Uri` object passed to the API. + + ### Parameters + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$uri` + + _Uri_ + + The URI of this transaction. +
+ + ### Examples + + ```cs + var uri = new System.Uri("https://www.mydomain.com/path"); + NewRelic.Api.Agent.NewRelic.SetTransactionUri(uri); + ``` + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value) + ``` + + Create user-related custom attributes. [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute) is more flexible. + + ### Requirements + + * Compatible with all agent versions. + * Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). + + ### Description + + + This call only allows you to assign values to pre-existing keys. For a more flexible method to create key/value pairs, use [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute). + + + Define user-related [custom attributes](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#AddCustomAttribute)to associate with a browser page view (user name, account name, and product name). The values are automatically associated with pre-existing keys (`user`, `account`, and `product`), then attached to the parent APM transaction. You can also [attach (or "forward") these attributes](/docs/insights/new-relic-insights/decorating-events/insights-custom-attributes#forwarding-attributes) to browser [PageView](/docs/agents/manage-apm-agents/agent-metrics/agent-attributes#destinations) events. + + ### Parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Parameter + + Description +
+ `$user_value` + + _string_ + + Required (can be null). Specify a name or username to associate with this page view. This value is assigned to the `user` key. +
+ `$account_value` + + _string_ + + Required (can be null). Specify the name of a user account to associate with this page view. This value is assigned to the `account` key. +
+ `$product_value` + + _string_ + + Required (can be null). Specify the name of a product to associate with this page view. This value is assigned to the `product` key. +
+ + ### Examples + + #### Record three user attributes + + ```cs + NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName"); + ``` + + #### Record two user attributes and one empty attribute + + ```cs + NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName"); + ``` + +
+ + ### Syntax + + ```cs + NewRelic.Api.Agent.NewRelic.StartAgent() + ``` + + Start the agent if it hasn't already started. Usually unnecessary. + + ### Requirements + + * Compatible with all agent versions. + * Compatible with all app types. + + ### Description + + Starts the agent if it hasn't already been started. This call is usually unnecessary, since the agent starts automatically when it hits an instrumented method unless you disable [`autoStart`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-autoStart). If you use [`SetApplicationName()`](/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#SetApplicationName), ensure you set the app name **before** you start the agent. + + + This method starts the agent asynchronously (meaning it won't block app startup) unless you enable [`syncStartup`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-syncStartup) or [`sendDataOnExit`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-sendDataOnExit). + + + ### Examples + + ```cs + NewRelic.Api.Agent.NewRelic.StartAgent(); + ``` + + + + ### Syntax + + ```cs + NewRelic.Api.Agent.TraceMetadata; + ``` + + Returns properties in the current execution environment used to support tracing. + + ### Requirements + + * Agent version 8.19 or higher. + * Compatible with all app types. + * [Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) to get meaningful values. + + ### Description + + Provides access to the following properties: + + ### Properties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Description +
+ `TraceId` + + Returns a string representing the currently executing trace. If the trace ID is not available, or distributed tracing is disabled, the value will be `string.Empty`. +
+ `SpanId` + + Returns a string representing the currently executing span. If the span ID is not available, or distributed tracing is disabled, the value will be `string.Empty`. +
+ `IsSampled` + + Returns `true` if the current trace is sampled for inclusion, `false` if it is sampled out. +
+ + ### Examples + + ```cs + IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); + TraceMetadata traceMetadata = agent.TraceMetadata; + string traceId = traceMetadata.TraceId; + string spanId = traceMetadata.SpanId; + bool isSampled = traceMetadata.IsSampled; + ``` + +
+
diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx deleted file mode 100644 index b6e4b01a81a..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx +++ /dev/null @@ -1,300 +0,0 @@ ---- -title: NoticeError (.NET agent API) -type: apiDoc -shortDescription: 'Notice an error and report to New Relic, along with optional custom attributes.' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to capture exceptions or error messages and report them. -redirects: - - /docs/agents/net-agent/net-agent-api/noticeerror-net-agent-api - - /docs/agents/net-agent/net-agent-api/noticeerror-net-agent - - /docs/agents/net-agent/net-agent-api/notice-error -freshnessValidatedDate: never ---- - -## Overloads [#overloads] - -Notice an error and report to New Relic, along with optional custom attributes. - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception); -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected); -``` - -## Requirements [#requirements] - -This API call is compatible with: - -* All agent versions -* All app types - -## Description [#description] - -Notice an error and report it to New Relic along with optional custom attributes. For each transaction, the agent only retains the exception and attributes from the first call to `NoticeError()`. You can pass an actual exception, or pass a string to capture an arbitrary error message. - -If this method is invoked within a [transaction](/docs/glossary/glossary/#transaction), the agent reports the exception within the parent transaction. If it is invoked outside of a transaction, the agent creates an [error trace](/docs/errors-inbox/errors-inbox) and categorizes the error in the New Relic UI as a `NewRelic.Api.Agent.NoticeError` API call. If invoked outside of a transaction, the `NoticeError()` call will not contribute to the error rate of an application. - -The agent adds the attributes only to the traced error; it does not send them to New Relic. For more information, see [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute). - -Errors reported with this API are still sent to New Relic when they are reported within a transaction that results in an HTTP status code, such as a `404`, that is configured to be ignored by agent configuration. For more information, see our documentation about [managing errors in APM](/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected). - -Review the sections below to see examples of how to use this call. - -## NoticeError(Exception) [#exception-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception) -``` - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$exception` - - _Exception_ - - Required. The `Exception` you want to instrument. Only the first 10,000 characters from the stack trace are retained. -
- -## NoticeError(Exception, IDictionary) [#exception-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$exception` - - _Exception_ - - Required. The `Exception` you want to instrument. Only the first 10,000 characters from the stack trace are retained. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Specify key/value pairs of attributes to annotate the error message. The `TKey` must be a string, the `TValue` can be a string or object. -
- -## NoticeError(String, IDictionary) [#string-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$error_message` - - _string_ - - Required. Specify a string to report to New Relic as though it's an exception. This method creates both [error events](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) and [error traces](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details). Only the first 1023 characters are retained in error events, while error traces retain the full message. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Required (can be null). Specify key/value pairs of attributes to annotate the error message. The `TKey` must be a string, the `TValue` can be a string or object, to send no attributes, pass `null`. -
- -## NoticeError(String, IDictionary, bool) [#string-idictionary-bool-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$error_message` - - _string_ - - Required. Specify a string to report to New Relic as though it's an exception. This method creates both [error events](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) and [error traces](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details). Only the first 1023 characters are retained in error events, while error traces retain the full message. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Required (can be null). Specify key/value pairs of attributes to annotate the error message. The `TKey` must be a string, the `TValue` can be a string or object, to send no attributes, pass `null`. -
- `$is_expected` - - _bool_ - - Mark error as expected so that it won't affect Apdex score and error rate. -
- -## Pass an exception without custom attributes [#exception-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError(ex); -} -``` - -## Pass an exception with custom attributes [#exception-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary() {{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError(ex, errorAttributes); -} -``` - -## Pass an error message string with custom attributes [#string-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary{{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", errorAttributes); -} -``` - -## Pass an error message string without custom attributes [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null); -} -``` - -## Pass an error message string and mark it as expected [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null, true); -} -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx deleted file mode 100644 index da36b15a6b2..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: RecordCustomEvent (.NET agent API) -type: apiDoc -shortDescription: Records a custom event with the given name and attributes. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to report custom event data to New Relic. -redirects: - - /docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api - - /docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent - - /docs/agents/net-agent/net-agent-api/record-custom-event -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) -``` - -Records a custom event with the given name and attributes. - -## Requirements - -Agent version 4.6.29.0 or higher. - -Compatible with all app types. - -## Description - -Records a [custom event](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#event-data) with the given name and attributes, which you can query in the [query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder). To verify if an event is being recorded correctly, look for the data in [dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards). - -For related API calls, see the [.NET agent API guide](/docs/agents/net-agent/api-guides/guide-using-net-agent-api#custom-data). - - - * Sending a lot of events can increase the memory overhead of the agent. - * Additionally, posts greater than 1MB (10^6 bytes) in size will not be recorded regardless of the maximum number of events. - * Custom Events are limited to 64-attributes. - * For more information about how custom attribute values are processed, see the [custom attributes](/docs/agents/net-agent/attributes/custom-attributes) guide. - - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `eventType` - - _string_ - - Required. The name of the event type to record. Strings over 255 characters will result in the API call not being sent to New Relic. The name can only contain alphanumeric characters, underscores `_`, and colons `:`. For additional restrictions on event type names, see [Reserved words](/docs/data-apis/custom-data/custom-events/data-requirements-limits-custom-event-data/#reserved-words). -
- `attributeValues` - - _IEnumerable<string, object>_ - - Required. Specify key/value pairs of attributes to annotate the event. -
- -## Examples - -### Record values [#record-strings] - -```cs -var eventAttributes = new Dictionary() -{ -  {"foo", "bar"}, -  {"alice", "bob"}, -  {"age", 32}, -  {"height", 21.3f} -}; - -NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx deleted file mode 100644 index d0e8c69b102..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: RecordMetric (.NET agent API) -type: apiDoc -shortDescription: Records a custom metric with the given name. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record custom metric timeslice data. -redirects: - - /docs/agents/net-agent/net-agent-api/recordmetric-net-agent-api - - /docs/agents/net-agent/net-agent-api/recordmetric-net-agent - - /docs/agents/net-agent/net-agent-api/record-metric -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.RecordMetric(string $metric_name, single $metric_value) -``` - -Records a custom metric with the given name. - -## Requirements - -Compatible with all agent versions. - -Compatible with all app types. - -## Description - -Records a [custom metric](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) with the given name. To view these custom metrics, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) to search metrics and create customizable charts. See also [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) and [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent). - - - When creating a custom metric, start the name with `Custom/` (for example, `Custom/MyMetric`). - - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$metric_name` - - _string_ - - Required. The name of the metric to record. Only the first 255 characters are retained. -
- `$metric_value` - - _single_ - - Required. The quantity to record for the metric. -
- -## Examples - -### Record response time of a sleeping process [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordMetric("Custom/DEMO_Record_Metric", stopWatch.ElapsedMilliseconds); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx deleted file mode 100644 index 90acfef2536..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: RecordResponseTimeMetric (.NET agent API) -type: apiDoc -shortDescription: Records a custom metric with the given name and response time in milliseconds. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record response time as custom metric timeslice data. -redirects: - - /docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api - - /docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent - - /docs/agents/net-agent/net-agent-api/record-response-time-metric -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value) -``` - -Records a custom metric with the given name and response time in milliseconds. - -## Requirements - -Compatible with all agent versions. - -Compatible with all app types. - -## Description - -Records the response time in milliseconds for a [custom metric](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics). To view these custom metrics, use the [query builder](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) to search metrics and create customizable charts. See also [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) and [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent). - - - When creating a custom metric, start the name with `Custom/` (for example, `Custom/MyMetric`). - - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$metric_name` - - _string_ - - Required. The name of the response time metric to record. Only the first 255 characters are retained. -
- `$metric_value` - - _Int64_ - - Required. The response time to record in milliseconds. -
- -## Examples - -### Record response time of a sleeping process [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx deleted file mode 100644 index 98305413920..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: SetApplicationName (.NET agent API) -type: apiDoc -shortDescription: Set the app name for data rollup. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to set the New Relic app name, which controls data rollup.' -redirects: - - /docs/agents/net-agent/net-agent-api/set-application-name - - /docs/agents/net-agent/net-agent-api/setapplicationname-net-agent -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName(string $name[, string $name_2, string $name_3]) -``` - -Set the app name for data rollup. - -## Requirements - -Agent version 5.0.136.0 or higher. - -Compatible with all app types. - -## Description - -Set the application name(s) reported to New Relic. For more information about application naming, see [Name your .NET application](/docs/agents/net-agent/installation-configuration/name-your-net-application). This method is intended to be called once, during startup of an application. - - - Updating the app name forces the agent to restart. The agent discards any unreported data associated with previous app names. Changing the app name multiple times during the lifecycle of an application is not recommended due to the associated data loss. - - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$name` - - _string_ - - Required. The primary application name. -
- `$name_2` - - `$name_3` - - _string_ - - Optional. Second and third names for app rollup. For more information, see [Use multiple names for an app](/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app). -
- -## Examples - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName("AppName1", "AppName2"); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx deleted file mode 100644 index e8bed2f30d8..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: SetTransactionUri (.NET agent API) -type: apiDoc -shortDescription: Sets the URI of the current transaction. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the URI of a transaction (use with attribute-based custom instrumentation). -redirects: - - /docs/agents/net-agent/net-agent-api/set-transaction-uri - - /docs/agents/net-agent/net-agent-api/settransactionuri -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionUri(Uri $uri) -``` - -Sets the URI of the current transaction. - -## Requirements - -Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -Agent version 6.16 or higher. - - - This method only works when used within a transaction created using the `Transaction` attribute with the `Web` property set to `true`. (See [Instrument using attributes](/docs/agents/net-agent/api-guides/net-agent-api-instrument-using-attributes).) It provides support for custom web-based frameworks that the agent does not automatically support. - - -## Description - -Sets the URI of the current transaction. The URI appears in the 'request.uri' [attribute](/docs/agents/net-agent/attributes/net-agent-attributes) of [transaction traces](/docs/apm/transactions/transaction-traces/transaction-traces) and [transaction events](/docs/using-new-relic/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data), and also can affect transaction naming. - -If you use this call multiple times within the same transaction, each call overwrites the previous call. The last call sets the URI. - -**Note**: as of agent version 8.18, the `request.uri` attribute's value is set to the value of the `Uri.AbsolutePath` property of the `System.Uri` object passed to the API. - -## Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$uri` - - _Uri_ - - The URI of this transaction. -
- -## Examples - -```cs -var uri = new System.Uri("https://www.mydomain.com/path"); -NewRelic.Api.Agent.NewRelic.SetTransactionUri(uri); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx deleted file mode 100644 index 46d59791c48..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: SetUserParameters (.NET agent) -type: apiDoc -shortDescription: Create user-related custom attributes. AddCustomAttribute() is more flexible. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach user-related custom attributes to APM and browser events. -redirects: - - /docs/agents/net-agent/net-agent-api/set-user-parameters - - /docs/agents/net-agent/net-agent-api/setuserparameters-net-agent -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value) -``` - -Create user-related custom attributes. [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) is more flexible. - -## Requirements - -Compatible with all agent versions. - -Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Description - - - This call only allows you to assign values to pre-existing keys. For a more flexible method to create key/value pairs, use [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction). - - -Define user-related [custom attributes](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)to associate with a browser page view (user name, account name, and product name). The values are automatically associated with pre-existing keys (`user`, `account`, and `product`), then attached to the parent APM transaction. You can also [attach (or "forward") these attributes](/docs/insights/new-relic-insights/decorating-events/insights-custom-attributes#forwarding-attributes) to browser [PageView](/docs/agents/manage-apm-agents/agent-metrics/agent-attributes#destinations) events. - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$user_value` - - _string_ - - Required (can be null). Specify a name or username to associate with this page view. This value is assigned to the `user` key. -
- `$account_value` - - _string_ - - Required (can be null). Specify the name of a user account to associate with this page view. This value is assigned to the `account` key. -
- `$product_value` - - _string_ - - Required (can be null). Specify the name of a product to associate with this page view. This value is assigned to the `product` key. -
- -## Examples - -### Record three user attributes [#report-three] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName"); -``` - -### Record two user attributes and one empty attribute [#report-two] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName"); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx deleted file mode 100644 index b18334a0028..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: SetErrorGroupCallback (.NET agent API) -type: apiDoc -shortDescription: 'Provide a callback method for determining the error group name based on attribute data' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to provide a callback method for determining the error group name for an error, based on attribute data. -redirects: - - /docs/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api - - /docs/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent - - /docs/agents/net-agent/net-agent-api/set-error-group-callback -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(Func, string> errorGroupCallback); -``` -Provide a callback method that takes an `IReadOnlyDictionary` of attribute data, and returns an error group name. - -## Requirements [#requirements] - -This API call is compatible with: - -* Agent versions >= 10.9.0 -* All app types - -## Description [#description] - -Set a callback method that the agent will use to determine the error group name for error events and traces. This name is used in the Errors Inbox to group errors into logical groups. - -The callback method must accept a single argument of type `IReadOnlyDictionary`, and return a string (the error group name). The `IReadOnlyDictionary` is a collection of [attribute data](/docs/apm/agents/manage-apm-agents/agent-data/agent-attributes/) associated with each error event, including custom attributes. - -The exact list of attributes available for each error will vary depending on: - - * What application code generated the error - * Agent configuration settings - * Whether any custom attributes were added - -However, the following attributes should always exist: - - * `error.class` - * `error.message` - * `stack_trace` - * `transactionName` - * `request.uri` - * `error.expected` - -An empty string may be returned for the error group name when the error can't be assigned to a logical error group. - -## Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$callback` - - _{'Func,string>'}_ - - - The callback to determine the error group name based on attribute data. -
- -## Examples - -Group errors by error class name: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("error.class", out var errorClass)) - { - if (errorClass.ToString() == "System.ArgumentOutOfRangeException" || errorClass.ToString() == "System.ArgumentNullException") - { - errorGroupName = "ArgumentErrors"; - } - else - { - errorGroupName = "OtherErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` - -Group errors by transaction name: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("transactionName", out var transactionName)) - { - if (transactionName.ToString().IndexOf("WebTransaction/MVC/Home") != -1) - { - errorGroupName = "HomeControllerErrors"; - } - else - { - errorGroupName = "OtherControllerErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx deleted file mode 100644 index 5ab270b723e..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: SetLlmTokenCountingCallback (.NET agent API) -type: apiDoc -shortDescription: 'Provide a callback method that determines the token count for an LLM completion' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to provide a callback method that determines the token count for an LLM completion. -redirects: - - /docs/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api - - /docs/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent - - /docs/agents/net-agent/net-agent-api/set-llm-token-counting-callback -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(Func callback); -``` -Provide a callback method that calculates the token count. - -## Requirements [#requirements] - -This API call is compatible with: - -* Agent versions >= 10.23.0 -* All app types - -## Description [#description] - -Set a callback method that the agent will use to determine the token count for a LLM event. In High Security Mode or when content recording is disabled, this method will be called to determine the token count for the LLM event. - -The callback method must accept a two arguments of type `string`, and return an integer. The first string argument is the LLM model name, and the second string argument is the input to the LLM. The callback method should return the token count for the LLM event. Values of 0 or less will be ignored. - -## Parameters - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$callback` - - {'_Func_'} - - - The callback to determine the token count. -
- -## Example - -```cs -Func llmTokenCountingCallback = (modelName, modelInput) => { - - int tokenCount = 0; - // split the input string by spaces and count the tokens - if (!string.IsNullOrEmpty(modelInput)) - { - tokenCount = modelInput.Split(' ').Length; - } - - return tokenCount; -}; - -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(llmTokenCountingCallback); -``` \ No newline at end of file diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx deleted file mode 100644 index f756a46656e..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: SetTransactionName (.NET agent API) -type: apiDoc -shortDescription: Sets the name of the current transaction. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the name of a transaction. -redirects: - - /docs/agents/net-agent/net-agent-api/settransactionname-net-agent-api - - /docs/agents/net-agent/net-agent-api/settransactionname-net-agent - - /docs/agents/net-agent/net-agent-api/set-transaction-name -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name) -``` - -Sets the name of the current transaction. - -## Requirements - -Compatible with all agent versions. - -Must be called inside a [transaction](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Description - -Sets the name of the current transaction. Before you use this call, ensure you understand the implications of [metric grouping issues](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues). - -If you use this call multiple times within the same transaction, each call overwrites the previous call and the last call sets the name. - - - Do not use brackets `[suffix]` at the end of your transaction name. New Relic automatically strips brackets from the name. Instead, use parentheses `(suffix)` or other symbols if needed. - - -Unique values like URLs, page titles, hex values, session IDs, and uniquely identifiable values should not be used in naming your transactions. Instead, add that data to the transaction as a custom parameter with the [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) call. - - - Do not create more than 1000 unique transaction names (for example, avoid naming by URL if possible). This will make your charts less useful, and you may run into limits New Relic sets on the number of unique transaction names per account. It also can slow down the performance of your application. - - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Description -
- `$category` - - _string_ - - Required. The category of this transaction, which you can use to distinguish different types of transactions. Defaults to **`Custom`**. Only the first 255 characters are retained. -
- `$name` - - _string_ - - Required. The name of the transaction. Only the first 255 characters are retained. -
- -## Examples - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction"); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx deleted file mode 100644 index 0c9d907521a..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: StartAgent (.NET agent API) -type: apiDoc -shortDescription: Start the agent if it hasn't already started. Usually unnecessary. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to force the .NET agent to start, if it hasn''t been started already. Usually unnecessary, since the agent starts automatically.' -redirects: - - /docs/agents/net-agent/net-agent-api/start-agent - - /docs/agents/net-agent/net-agent-api/startagent-net-agent -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent() -``` - -Start the agent if it hasn't already started. Usually unnecessary. - -## Requirements - -Agent version 5.0.136.0 or higher. - -Compatible with all app types. - -## Description - -Starts the agent if it hasn't already been started. This call is usually unnecessary, since the agent starts automatically when it hits an instrumented method unless you disable [`autoStart`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-autoStart). If you use [`SetApplicationName()`](/docs/agents/net-agent/net-agent-api/setapplicationname-net-agent), ensure you set the app name **before** you start the agent. - - - This method starts the agent asynchronously (that is, it won't block app startup) unless you enable [`syncStartup`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-syncStartup) or [`sendDataOnExit`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-sendDataOnExit). - - -## Examples - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent(); -``` diff --git a/src/content/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx b/src/content/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx deleted file mode 100644 index dde23a7fb9b..00000000000 --- a/src/content/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: TraceMetadata (.NET agent API) -type: apiDoc -shortDescription: Returns properties in the current execution environment used to support tracing. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -redirects: - - /docs/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0 -freshnessValidatedDate: never ---- - -## Syntax - -```cs -NewRelic.Api.Agent.TraceMetadata; -``` - -Returns properties in the current execution environment used to support tracing. - -## Requirements - -Agent version 8.19 or higher. - -Compatible with all app types. - -[Distributed tracing must be enabled](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) to get meaningful values. - -## Description - -Provides access to the following properties: - -### Properties - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Description -
- `TraceId` - - Returns a string representing the currently executing trace. If the trace ID is not available, or distributed tracing is disabled, the value will be `string.Empty`. -
- `SpanId` - - Returns a string representing the currently executing span. If the span ID is not available, or distributed tracing is disabled, the value will be `string.Empty`. -
- `IsSampled` - - Returns `true` if the current trace is sampled for inclusion, `false` if it is sampled out. -
- -## Examples - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -TraceMetadata traceMetadata = agent.TraceMetadata; -string traceId = traceMetadata.TraceId; -string spanId = traceMetadata.SpanId; -bool isSampled = traceMetadata.IsSampled; -``` diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx deleted file mode 100644 index 0ab59e5af66..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: DisableBrowserMonitoring (API del agente .NET) -type: apiDoc -shortDescription: Deshabilite la inyección automática de monitoreo de fragmentos del navegador en páginas específicas. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to disable browser monitoring on specific pages or views. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override]) -``` - -Deshabilite la inyección automática de monitoreo de fragmentos del navegador en páginas específicas. - -## Requisitos - -Compatible con todas las versiones de agente. - -Debe llamarse dentro de una [transacción](/docs/glossary/glossary/#transaction). - -## Descripción - -Agregue esta llamada para deshabilitar la inyección **automatic** del script [](/docs/browser/new-relic-browser/getting-started/new-relic-browser)en páginas específicas. También puede agregar una anulación opcional para desactivar **both** la inyección manual y automática. En cualquier caso, coloque esta llamada API lo más cerca posible de la parte superior de la vista en la que desea desactivar browser . - - - Compare [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent), que **adds** es el script browser con la página. - - -## Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$override` - - _booleano_ - - Opcional. Cuando `true`, desactiva toda inyección de script browser . Este indicador afecta tanto a la inyección manual como a la automática. Esto también anula la llamada [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent) . -
- -## Ejemplos - -### Desactivar la inyección automática [#automatic-only] - -Este ejemplo deshabilita solo la inyección **automatic** del fragmento: - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(); -``` - -### Desactivar la inyección automática y manual. [#disable-both] - -Este ejemplo deshabilita **both** la inyección automática y manual del fragmento: - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getagent.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getagent.mdx deleted file mode 100644 index 0d12772b081..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getagent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: ObtenerAgente -type: apiDoc -shortDescription: Obtenga acceso al agente a través de la interfaz IAgent. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.GetAgent() -``` - -Obtenga acceso al agente a través de la interfaz `IAgent` . - -## Requisitos - -Versión del agente 8.9 o superior. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Obtenga acceso a los métodos API del agente a través de la interfaz [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) . - -## Valores de retorno - -Una implementación de [IAgent](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) que proporciona acceso a la [API de IAgent](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api). - -## Ejemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx deleted file mode 100644 index 4a0b0bb5afc..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: GetBrowserTimingHeader (API del agente .NET) -type: apiDoc -shortDescription: Generar un fragmento HTML de monitoreo del navegador para instrumento usuario final del navegador. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to instrument a webpage with browser. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(); -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(string nonce); -``` - -Generar un fragmento HTML de monitoreo del navegador para instrumento usuario final del navegador. - -## Requisitos - -Compatible con todas las versiones de agente. - -Debe llamarse dentro de una [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descripción - -Devuelve un fragmento de HTML utilizado para habilitar [](/docs/browser/new-relic-browser/getting-started/new-relic-browser). El fragmento indica al browser que busque un pequeño archivo JavaScript e inicie el temporizador de la página. Luego puede insertar el fragmento devuelto en el encabezado de sus páginas web HTML. Para obtener más información, consulte [Agregar aplicaciones al monitoreo del navegador](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser). - - - Compare [`DisableBrowserMonitoring()`](/docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent), que **disables** es el script browser en una página. - - -## Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `nonce` - - _cadena_ - - El nonce criptográfico por solicitud utilizado por las políticas de política de seguridad de contenido. -
- - - Esta llamada API requiere actualizaciones de la lista de seguridad de 'permitidos'. Para obtener más información sobre las consideraciones de la Política de seguridad de contenido (CSP), visite la página [de monitoreo de compatibilidad y requisitos del navegador](/docs/browser/new-relic-browser/getting-started/compatibility-requirements-browser-monitoring) . - - -## Valores de retorno - -Una cadena HTML que se incrustará en el encabezado de una página. - -## Ejemplos - -### Con ASPX [#aspx] - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%> - ... - - - ... -``` - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")%> - ... - - - ... -``` - -### Con navaja [#razor] - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` - -### Con Blazor [#blazor] - - - Esta API no es compatible con Blazor Webassembly porque el agente no puede interpretar el código de Webassembly. Los siguientes ejemplos son solo para la aplicación Blazor Server. Utilice el [método de copiar y pegar](/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste) para agregar el agente del navegador a las páginas de Blazor Webassembly. - - - - Esta API no se puede colocar en un elemento `` de una página `.razor` . En su lugar, debería llamarse desde `_Layout.cshtml` o un archivo de diseño equivalente. - - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx deleted file mode 100644 index 4e629e91c1f..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: GetLinkingMetadata (API del agente .NET) -type: apiDoc -shortDescription: Devuelve pares de valores principales que se pueden utilizar para vincular traza o entidad. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.GetLinkingMetadata(); -``` - -Devuelve pares de valores principales que se pueden utilizar para vincular traza o entidad. - -## Requisitos - -Versión del agente 8.19 o superior. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -El Diccionario de pares principales de valor devueltos incluye elementos utilizados para vincular traza y entidad en el producto APM. Sólo contendrá elementos con valores significativos. Para instancia, si rastreo distribuido está deshabilitado, `trace.id` no se incluirá. - -## Valores de retorno - -`Dictionary ()` La devolución incluye elementos utilizados para vincular traza y entidad en el producto APM. - -## Ejemplos - -```cs -NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -var linkingMetadata = Agent.GetLinkingMetadata(); -foreach (KeyValuePair kvp in linkingMetadata) -{ - Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); -} -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx deleted file mode 100644 index e1501dde1f7..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx +++ /dev/null @@ -1,326 +0,0 @@ ---- -title: Guía para utilizar la API del agente .NET -tags: - - Agents - - NET agent - - API guides -metaDescription: 'A goal-focused guide to the New Relic .NET agent API, with links to relevant sections of the complete API documentation.' -freshnessValidatedDate: never -translationType: machine ---- - -El agente .NET de New Relic incluye una [API](/docs/agents/net-agent/net-agent-api) que le permite ampliar la funcionalidad estándar del agente. Por ejemplo, puede utilizar la API del agente .NET para: - -* Personalizando el nombre de tu aplicación -* Crear parámetro de transacción personalizado -* Reporte de errores personalizados y métricos. - -También puede personalizar parte del comportamiento predeterminado del agente .NET ajustando [la configuración](/docs/agents/net-agent/configuration/net-agent-configuration) o utilizando [instrumentación personalizada](/docs/agents/net-agent/custom-instrumentation/introduction-net-custom-instrumentation). - -## Requisitos - - - A partir de septiembre de 2021, un pequeño subconjunto de API, opciones de configuración y opciones de instalación para .NET será reemplazado por nuevos métodos. Para obtener más detalles, incluido cómo prepararse fácilmente para esta transición, consulte nuestra [publicación en el Foro de soporte](https://discuss.newrelic.com/t/important-upcoming-changes-to-support-and-capabilities-across-browser-node-js-agent-query-builder-net-agent-apm-errors-distributed-tracing/153373). - - -Para utilizar la API del agente .NET: - -1. Asegúrese de tener la [última versión del agente .NET](/docs/release-notes/agent-release-notes/net-release-notes). - -2. Agregue una referencia al agente en su proyecto: - - * Añade una referencia a `NewRelic.Api.Agent.dll` a tu proyecto. - - O - - * Vea y descargue el paquete API desde la [biblioteca de paquetes NuGet](https://www.nuget.org/packages/NewRelic.Agent.Api/). - -## Instrumento faltan secciones de tu código con transacción. [#creating-transactions] - -Para instrumentar su aplicación, New Relic separa cada ruta a través de su código en su propia [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). New Relic mide (o "instrumentado") el método principal en estas transacciones para medir el rendimiento general de su aplicación y recopila [la traza de la transacción](/docs/apm/transactions/transaction-traces/introduction-transaction-traces) de transacciones de larga duración para obtener detalles adicionales. - -Utilice estos métodos cuando New Relic no esté instrumentada en absoluto en una parte particular de su código: - - - - - - - - - - - - - - - - - - - - - - - -
- Si quieres... - - Hacer esto... -
- Evitar que una transacción se informe a New Relic - - Utilice [`IgnoreTransaction()`](/docs/agents/net-agent/net-agent-api/ignore-transaction) o [un archivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation) para ignorar la transacción. -
- Crear una transacción donde no existe ninguna - - Utilice un [atributo](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) o [un archivo XML](/docs/agents/net-agent/instrumentation/net-custom-transactions) para crear una nueva transacción. -
- -## Métodos específicos de tiempo que utilizan segmentos [#segments] - -Si una transacción ya es visible en la UI de New Relic, pero no tiene suficientes datos sobre un método en particular que se llamó durante esa transacción, puede crear segmentos para cronometrar esos métodos individuales con mayor detalle. Por ejemplo, es posible que desee cronometrar un método particularmente crítico con lógica compleja. - -Cuando desee instrumentar un método dentro de una transacción existente, consulte [instrumentación personalizada vía atributo](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) o [Agregar detalle a transacciones vía XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net). - -## Mejorar los metadatos de una transacción [#metadata] - -A veces, el código al que se dirige es visible en la UI de New Relic, pero algunos detalles del método no son útiles. Por ejemplo: - -* Es posible que el nombre predeterminado no resulte útil. (Quizás esté causando un [problema de agrupación métrica](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues#video)). -* Quieres agregar [atributos personalizados](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) a tu transacción para poder filtrarlos en el tablero. - -Utilice estos métodos cuando desee cambiar la forma en que New Relic instrumentó una transacción que ya está visible en la UI de New Relic: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Si quieres... - - Hacer esto... -
- Cambiar el nombre de una transacción - - Utilice [`SetTransactionName()`](/docs/agents/net-agent/net-agent-api/set-transaction-name) o [un archivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#name-transactions). -
- Evite que una transacción afecte su puntuación [Apdex](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#apdex) - - Utilice [`IgnoreApdex()`](/docs/agents/net-agent/net-agent-api/ignore-apdex). -
- Agregue metadatos (como el nombre de la cuenta de sus clientes o el nivel de suscripción) a su transacción - - Utilice [un atributo personalizado](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes). Ver [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction#addcustomattribute). -
- -## Ver registro relacionado [#logs] - -Para ver el registro directamente dentro del contexto de los errores y la traza de su aplicación, use estas llamadas API para anotar su registro: - -* [`TraceMetadata`](/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0/) -* [`GetLinkingMetadata`](/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api/) - -Para obtener más información sobre cómo correlacionar los datos log con otros telemetry data, consulte nuestra documentación [de contexto de registro](/docs/logs/logs-context/net-configure-logs-context-all/) . - -## Trabajo asincrónico del instrumento. [#async] - -Para el marco compatible, el agente .NET generalmente detecta el trabajo asíncrono y lo instrumenta correctamente. Sin embargo, si su aplicación usa otro framework o la [instrumentación asíncrona predeterminada](/docs/agents/net-agent/features/async-support-net) no es precisa, puede conectar explícitamente el trabajo asíncrono. - - - - - - - - - - - - - - - - - - - - - - - -
- Si quieres... - - Hacer esto... -
- Traza un método asíncrono que New Relic ya está instrumentado - - Utilice [un archivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) para implementar métodos asíncronos en aplicaciones IIS. Para obtener consejos sobre resolución de problemas, consulte [falta async métrica](/docs/agents/net-agent/troubleshooting/missing-async-metrics). -
- Traza un método asíncrono que New Relic no está instrumentado - - Utilice [un archivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) para implementar métodos asíncronos en aplicaciones IIS. Para obtener consejos sobre resolución de problemas, consulte [falta async métrica](/docs/agents/net-agent/troubleshooting/missing-async-metrics). -
- -## Ver llamadas a servicios externos [#externals] - -Para la versión 8.9 o superior del agente .NET, puede utilizar las siguientes [API de carga útil de rastreo distribuido](/docs/apm/agents/net-agent/configuration/distributed-tracing-net-agent/#manual-instrumentation) para pasar manualmente el contexto de rastreo distribuido entre los servicios de New Relic-monitor que no se conectan automáticamente entre sí en un [rastreo distribuido](/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing). - - - - - - - - - - - - - - - - - - - - - - - -
- Si quieres... - - Hacer esto... -
- Instrumento una solicitud saliente a una aplicación o base de datos externa. - - Agregue una carga útil de rastreo distribuido a una solicitud saliente usando [`InsertDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders). -
- Conecte las solicitudes entrantes con el originador de la solicitud para completar un [tramo](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#span) de la traza. - - Reciba una carga útil en una solicitud entrante usando [`AcceptDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders). -
- -Para versiones del agente .NET inferiores a 8.9, utilice [el seguimiento de aplicaciones múltiples](/docs/apm/transactions/cross-application-traces/introduction-cross-application-traces). - -## Cobro o error omitido [#errors] - -Normalmente el agente .NET detecta errores automáticamente. Sin embargo, puede marcar manualmente un error con el agente. También puedes cometer [un error omitido](/docs/apm/applications-menu/error-analytics/ignoring-errors-new-relic-apm) . - - - - - - - - - - - - - - - - - - - - - - - -
- Si quieres... - - Hacer esto... -
- Informar un error que el agente .NET no informa automáticamente - - Utilice [`NoticeError()`](/docs/agents/net-agent/net-agent-api/notice-error). -
- Capture errores o evite que el agente .NET informe un error - - Utilice su [archivo de configuración del agente .NET](/docs/agents/net-agent/configuration/net-agent-configuration#error_collector). -
- -## Envía datos de eventos personalizados y métricos desde tu app [#custom-data] - -APM incluye varias formas de registrar datos personalizados arbitrarios. Para obtener una explicación de los tipos de datos de New Relic, consulte [Recopilación de datos](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Si quieres... - - Hacer esto... -
- Envía datos sobre un evento para que puedas analizarlo en el panel - - Crea un [evento personalizado](/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents#net-att). Ver [`RecordCustomEvent()`](/docs/agents/net-agent/net-agent-api/record-custom-event). -
- etiquete su evento con metadatos para filtrarlos y facetarlos en el panel o análisis de errores - - Agregue [un atributo personalizado](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes). Consulte Atributo del agente .NET y [Habilitar y deshabilitar atributo](/docs/agents/net-agent/attributes/enable-disable-attributes-net). -
- Informar datos de rendimiento personalizados - - Utilice [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/record-metric) para crear una [métrica personalizada](/docs/agents/manage-apm-agents/agent-data/collect-custom-metrics). Para ver los datos, utilice el [generador de consultas](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data). -
- -## Controlar el monitoreo del agente navegador [#browser] - -Por lo general, el agente se agrega automáticamente a sus páginas o se implementa copiando y pegando el fragmento de JavaScript. Para obtener más información sobre estos métodos recomendados, consulte [Agregar aplicaciones al monitoreo del navegador](/docs/browser/new-relic-browser/installation-configuration/add-apps-new-relic-browser). - -Sin embargo, también puede controlar el agente del navegador a través de la API de llamada del agente APM. Para obtener más información, consulte [monitoreo del navegador y el agente .NET](/docs/agents/net-agent/instrumentation-features/new-relic-browser-net-agent). \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/iagent.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/iagent.mdx deleted file mode 100644 index bbce8be050b..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/iagent.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Agente -type: apiDoc -shortDescription: 'Proporciona acceso a los artefactos y métodos del agente, como la transacción que se está ejecutando actualmente.' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -public interface IAgent -``` - -Proporciona acceso a los artefactos y métodos del agente, como la transacción que se está ejecutando actualmente. - -## Requisitos - -Versión del agente 8.9 o superior. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Proporciona acceso a los artefactos y métodos del agente, como la transacción que se está ejecutando actualmente. Para obtener una referencia a `IAgent`, utilice [`GetAgent`](/docs/agents/net-agent/net-agent-api/getagent). - -### Propiedades - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- Transacción actual - - Propiedad que proporciona acceso a la transacción que se está ejecutando actualmente a través de la interfaz [ITransaction](/docs/agents/net-agent/net-agent-api/itransaction) . Debe llamarse dentro de una [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). -
- Intervalo actual - - Propiedad que proporciona acceso al tramo que se está ejecutando actualmente a través de la interfaz [ISpan](/docs/agents/net-agent/net-agent-api/iSpan) . -
- -## Ejemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx deleted file mode 100644 index f0dad69a331..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: IgnoreApdex (API del agente .NET) -type: apiDoc -shortDescription: Ignore la transacción actual al calcular Apdex. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction when calculating your app's overall Apdex score. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex() -``` - -Ignore la transacción actual al calcular Apdex. - -## Requisitos - -Compatible con todas las versiones de agente. - -## Descripción - -Ignora la transacción actual al calcular su [puntuación Apdex](/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction). Esto es útil cuando tiene transacciones muy cortas o muy largas (como descargas de archivos) que pueden sesgar su puntuación Apdex. - -## Ejemplos - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex(); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx deleted file mode 100644 index 23033842e7f..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: IgnoreTransaction (API del agente .NET) -type: apiDoc -shortDescription: No instrumente la transacción actual. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction entirely. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction() -``` - -No instrumente la transacción actual. - -## Requisitos - -Compatible con todas las versiones de agente. - -Debe llamarse dentro de una [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descripción - -Ignora la transacción actual. - - - También puede ignorar la transacción [a través de un archivo XML de instrumentación personalizada](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation). - - -## Ejemplos - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction(); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx deleted file mode 100644 index 3f4ad83a894..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: IncrementCounter (API del agente .NET) -type: apiDoc -shortDescription: Incrementa el contador de una métrica personalizada en 1. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to increment the value of a custom metric. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name) -``` - -Incrementa el contador de una métrica personalizada en 1. - -## Requisitos - -Compatible con todas las versiones de agente. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Incrementa el contador de una [métrica personalizada](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) en 1. Para ver estas métricas personalizadas, utilice el [generador de consultas](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) para buscar métricas y crear gráficos personalizables. Consulte también [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent) y [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent). - - - Al crear una métrica personalizada, comience el nombre con `Custom/` (por ejemplo, `Custom/MyMetric`). Para obtener más información sobre la denominación, consulte [Recopilar métrica personalizada](/docs/apm/agents/manage-apm-agents/agent-data/collect-custom-metrics/). - - -## Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$metric_name` - - _cadena_ - - Requerido. El nombre de la métrica que se va a incrementar. -
- -## Ejemplos - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric"); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ispan.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ispan.mdx deleted file mode 100644 index fd70747ce84..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/ispan.mdx +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: España -type: apiDoc -shortDescription: Proporciona acceso a métodos específicos de tramo en la API New Relic. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -Public interface ISpan -``` - -Proporciona acceso a métodos específicos de tramo en la API New Relic. - -## Descripción - -Proporciona acceso a métodos específicos de tramo en la API del agente New Relic .NET. Para obtener una referencia a `ISpan`, utilice: - -* La propiedad `CurrentSpan` en [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) (recomendado). -* La propiedad `CurrentSpan` en [`ITransaction`](/docs/agents/net-agent/net-agent-api/itransaction). - -Esta sección contiene descripciones y parámetros de `ISpan` métodos: - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- [`AddCustomAttribute`](#addcustomattribute) - - Agregue información contextual de su aplicación al intervalo actual en forma de atributo. -
- [`SetName`](#setname) - - Cambia el nombre del tramo/segmento/métrica actual que se informará a New Relic. -
- -## Agregar atributo personalizado [#addcustomattribute] - -Agrega información contextual sobre su aplicación al intervalo actual en forma de [atributo](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). - -Este método requiere la versión del agente .NET y [la versión API del agente .NET 8.25](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) o superior. - -### Sintaxis - -```cs -ISpan AddCustomAttribute(string key, object value) -``` - -### Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `key` - - _cadena_ - - Identifica la información que se reporta. También conocido como el nombre. - - * No se admiten claves vacías. - * Las claves están limitadas a 255 bytes. Se ignorarán los atributos con claves mayores a 255 bytes. -
- `value` - - _objeto_ - - El valor que se informa. - - **Note**: `null` valores no se registrarán. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Tipo .NET - - Cómo se representará el valor -
- `byte`, `Int16`, `Int32`, `Int64` - - `sbyte`, `UInt16`, `UInt32`, `UInt64` - - Como valor integral. -
- `float`, `double`, `decimal` - - Un número basado en decimales. -
- `string` - - Una cadena truncada después de 255 bytes. - - Se admiten cadenas vacías. -
- `bool` - - Verdadero o falso. -
- `DateTime` - - Una representación de cadena que sigue el formato ISO-8601, incluida información de zona horaria: - - Ejemplo: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - Un número decimal que representa el número de segundos. -
- todo lo demas - - Se aplicará el método `ToString()` . Los tipos personalizados deben tener una implementación de `Object.ToString()` o generarán una excepción. -
-
- -### Devoluciones - -Una referencia al lapso actual. - -### Consideraciones de uso - -Para obtener detalles sobre los tipos de datos admitidos, consulte la [guía de atributos personalizados](/docs/agents/net-agent/attributes/custom-attributes). - -## Ejemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ISpan currentSpan = agent.CurrentSpan; - -currentSpan - .AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## Escoger un nombre [#setname] - -Cambia el nombre del segmento/tramo actual que se informará a New Relic. Para segmentos/tramos resultantes de instrumentación personalizada, el nombre de la métrica reportada a New Relic también se modificará. - -Este método requiere la versión del agente .NET y la versión 10.1.0 de la API del agente .NET o mas alto. - -### Sintaxis - -```cs -ISpan SetName(string name) -``` - -### Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `name` - - _cadena_ - - El nuevo nombre del tramo/segmento. -
- -### Devoluciones - -Una referencia al lapso actual. - -## Ejemplos - -```cs -[Trace] -public void MyTracedMethod() -{ - IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); - ISpan currentSpan = agent.CurrentSpan; - - currentSpan.SetName("MyCustomName"); -} -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx deleted file mode 100644 index 2a6542d025f..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx +++ /dev/null @@ -1,604 +0,0 @@ ---- -title: ITransacción -type: apiDoc -shortDescription: Proporciona acceso a métodos específicos de transacciones en la API New Relic. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -public interface ITransaction -``` - -Proporciona acceso a métodos específicos de transacciones en la API New Relic. - -## Descripción - -Proporciona acceso a métodos específicos de transacciones en la API del agente New Relic .NET. Para obtener una referencia a `ITransaction`, utilice el método de transacción actual disponible en [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent). - -Los siguientes métodos están disponibles en `ITransaction`: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- [`AcceptDistributedTraceHeaders`](#acceptdistributedtraceheaders) - - Acepta encabezados de contexto de traza entrantes de otro servicio. -
- [`InsertDistributedTraceHeaders`](#insertdistributedtraceheaders) - - Agrega encabezados de contexto de traza a una solicitud saliente. -
- [`AcceptDistributedTracePayload` (obsoleto)](#acceptdistributedtracepayload) - - Acepta una carga útil entrante de rastreo distribuido de otro servicio. -
- [`CreateDistributedTracePayload` (obsoleto)](#createdistributedtracepayload) - - Crea una carga útil de rastreo distribuido para incluirla en una solicitud saliente. -
- [`AddCustomAttribute`](#addcustomattribute) - - Agregue información contextual de su aplicación a la transacción actual en forma de atributo. -
- [`CurrentSpan`](#currentspan) - - Proporciona acceso al [intervalo](/docs/agents/net-agent/net-agent-api/ispan) que se está ejecutando actualmente, que proporciona acceso a métodos específicos del intervalo en la API New Relic. -
- [`SetUserId`](#setuserid) - - Asocia una identificación de usuario a la transacción actual. -
- -## AceptarDistributedTraceHeaders - -`ITransaction.AcceptDistributedTraceHeaders` se utiliza para instrumentar el servicio llamado para su inclusión en un rastreo distribuido. Vincula los tramos en una traza aceptando una carga útil generada por [`InsertDistributedTraceHeaders`](/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#transaction-handle-insertDistributedTraceHeaders) o generada por algún otro rastreador compatible con W3C Trace Context . Este método acepta los encabezados de una solicitud entrante, busca los encabezados W3C Trace Context y, si no los encuentra, recurre a los encabezados distribuidos del rastreo de New Relic. Este método reemplaza el método obsoleto [`AcceptDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#acceptdistributedtracepayload) , que solo maneja la carga distribuida de rastreo de New Relic. - -### Sintaxis - -```cs -void AcceptDistributedTraceHeaders(carrier, getter, transportType) -``` - -### Parámetros - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- `carrier` - - _<T>_ - - Requerido. Fuente de encabezados entrantes de contexto de traza. -
- `getter` - - _Func<T, string, IEnumerable<string>>_ - - Requerido. Función definida por la persona que llama para extraer datos del encabezado del operador. -
- `transportType` - - _Enumeración tipo de transporte_ - - Requerido. Describe el transporte de la carga útil entrante (por ejemplo `TransportType.HTTP`). -
- -### Consideraciones de uso - -* [Rastreo distribuido debe estar habilitado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `AcceptDistributedTraceHeaders` se ignorará si ya se ha llamado `InsertDistributedTraceHeaders` o `AcceptDistributedTraceHeaders` para esta transacción. - -### Ejemplo - -```cs -HttpContext httpContext = HttpContext.Current; -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -currentTransaction.AcceptDistributedTraceHeaders(httpContext, Getter, TransportType.HTTP); -IEnumerable Getter(HttpContext carrier, string key) -{ - string value = carrier.Request.Headers[key]; - return value == null ? null : new string[] { value }; -} -``` - -## Insertar encabezados de seguimiento distribuido - -`ITransaction.InsertDistributedTraceHeaders` Se utiliza para implementar rastreo distribuido. Modifica el objeto portador que se pasa agregando encabezados W3C Trace Context y encabezados distribuidos de rastreo New Relic. Los encabezados de New Relic se pueden desactivar con `` en la configuración. Este método reemplaza el método obsoleto [`CreateDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#createdistributedtracepayload) , que solo crea carga distribuida de rastreo New Relic. - -### Sintaxis - -```cs -void InsertDistributedTraceHeaders(carrier, setter) -``` - -### Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- `carrier` - - _<T>_ - - Requerido. contenedor donde se insertan los encabezados de contexto de traza. -
- `setter` - - _Action<T, string, string>_ - - Requerido. Acción definida por la persona que llama para insertar datos de encabezado en el operador. -
- -### Consideraciones de uso - -* [Rastreo distribuido debe estar habilitado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). - -### Ejemplo - -```cs -HttpWebRequest requestMessage = (HttpWebRequest)WebRequest.Create("https://remote-address"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -var setter = new Action((carrier, key, value) => { carrier.Headers?.Set(key, value); }); -currentTransaction.InsertDistributedTraceHeaders(requestMessage, setter); -``` - -## AceptarDistributedTracePayload [#acceptdistributedtracepayload] - - - Esta API no está disponible en el agente .NET v9.0 o superior. Utilice [`AcceptDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders) en su lugar. - - -Acepta una carga útil entrante de rastreo distribuido desde un servicio ascendente. Llamar a este método vincula la transacción del servicio ascendente a esta transacción. - -### Sintaxis - -```cs -void AcceptDistributedPayload(payload, transportType) -``` - -### Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- `payload` - - _cadena_ - - Requerido. Una representación de cadena de la carga útil distribuida del rastreo entrante. -
- `transportType` - - _Tipo de transporte_ - _enumeración_ - - Recomendado. Describe el transporte de la carga útil entrante (por ejemplo, `http`). - - Predeterminado `TransportType.Unknown`. -
- -### Consideraciones de uso - -* [Rastreo distribuido debe estar habilitado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* La carga útil puede ser una cadena de texto sin formato o codificada en Base64. -* `AcceptDistributedTracePayload` se ignorará si ya se ha llamado `CreateDistributedTracePayload` para esta transacción. - -### Ejemplo - -```cs -//Obtain the information from the request object from the upstream caller. -//The method by which this information is obtain is specific to the transport -//type being used. For example, in an HttpRequest, this information is -//contained in the -header.KeyValuePair metadata = GetMetaDataFromRequest("requestPayload"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AcceptDistributedTracePayload(metadata.Value, TransportType.Queue); -``` - -## CreateDistributedTracePayload (obsoleto) [#createdistributedtracepayload] - - - Esta API no está disponible en el agente .NET v9.0 o superior. Utilice [`InsertDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders) en su lugar. - - -Crea una carga útil de rastreo distribuido para incluirla en una solicitud saliente a un sistema descendente. - -### Sintaxis - -```cs -IDistributedTracePayload CreateDistributedTracePayload() -``` - -### Devoluciones - -Un objeto que implementa `IDistributedTracePayload` que proporciona acceso a la carga útil de rastreo distribuido que se creó. - -### Consideraciones de uso - -* [Rastreo distribuido debe estar habilitado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `CreateDistributedTracePayload` se ignorará si ya se ha llamado `AcceptDistributedTracePayload` para esta transacción. - -### Ejemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -IDistributedTracePayload payload = transaction.CreateDistributedTracePayload(); -``` - -## Agregar atributo personalizado - -Agrega información contextual sobre su aplicación a la transacción actual en forma de [atributo](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). - -Este método requiere la versión del agente .NET y [la versión de API del agente .NET 8.24.244.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) o superior. Reemplazó al [`AddCustomParameter`](/docs/agents/net-agent/net-agent-api/add-custom-parameter) obsoleto. - -### Sintaxis - -```cs -ITransaction AddCustomAttribute(string key, object value) -``` - -### Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `key` - - _cadena_ - - Identifica la información que se reporta. También conocido como el nombre. - - * No se admiten claves vacías. - * Las claves están limitadas a 255 bytes. Se ignorarán los atributos con claves mayores a 255 bytes. -
- `value` - - _objeto_ - - El valor que se informa. - - **Note**: `null` valores no se registrarán. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Tipo .NET - - Cómo se representará el valor -
- `byte`, `Int16`, `Int32`, `Int64` - - `sbyte`, `UInt16`, `UInt32`, `UInt64` - - Como valor integral. -
- `float`, `double`, `decimal` - - Un número basado en decimales. -
- `string` - - Una cadena truncada después de 255 bytes. - - Se admiten cadenas vacías. -
- `bool` - - Verdadero o falso. -
- `DateTime` - - Una representación de cadena que sigue el formato ISO-8601, incluida información de zona horaria: - - Ejemplo: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - Un número decimal que representa el número de segundos. -
- todo lo demas - - Se aplicará el método `ToString()` . Los tipos personalizados deben tener una implementación de `Object.ToString()` o generarán una excepción. -
-
- -### Devoluciones - -Una referencia a la transacción actual. - -### Consideraciones de uso - -Para obtener detalles sobre los tipos de datos admitidos, consulte la [Guía de atributos personalizados](/docs/agents/net-agent/attributes/custom-attributes). - -### Ejemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## Intervalo actual - -Proporciona acceso al [span](/docs/apm/agents/net-agent/net-agent-api/ispan/) que se está ejecutando actualmente, lo que hace que [los métodos específicos del span](/docs/apm/agents/net-agent/net-agent-api/ispan) estén disponibles dentro de la API de New Relic. - -### Ejemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -ISpan currentSpan = transaction.CurrentSpan; -``` - -## Establecer ID de usuario - -Asocia una identificación de usuario con la transacción actual. - -Este método requiere el agente .NET y la API del agente .NET [versión 10.9.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-1090) o superior. - -### Sintaxis - -```cs -ITransaction SetUserId(string userId) -``` - -### Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `userId` - - _cadena_ - - El ID de usuario que se asociará con esta transacción. - - * `null`, los valores vacíos y de espacios en blanco se ignorarán. -
- -### Ejemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.SetUserId("BobSmith123"); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx deleted file mode 100644 index 6de3ee5a8e5..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: NoticeError (API del agente .NET) -type: apiDoc -shortDescription: 'Observe un error e informe a New Relic, junto con el atributo personalizado opcional.' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to capture exceptions or error messages and report them. -freshnessValidatedDate: never -translationType: machine ---- - -## Sobrecargas [#overloads] - -Observe un error e informe a New Relic, junto con el atributo personalizado opcional. - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception); -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected); -``` - -## Requisitos [#requirements] - -Esta llamada API es compatible con: - -* Todas las versiones del agente -* Todos los tipos de aplicaciones - -## Descripción [#description] - -Observe un error e infórmelo a New Relic junto con el atributo personalizado opcional. Para cada transacción, el agente solo conserva la excepción y el atributo de la primera llamada a `NoticeError()`. Puede pasar una excepción real o pasar una cadena para capturar un mensaje de error arbitrario. - -Si este método se invoca dentro de una [transacción](/docs/glossary/glossary/#transaction), el agente informa la excepción dentro de la transacción principal. Si se invoca fuera de una transacción, el agente crea una [traza de error](/docs/errors-inbox/errors-inbox) y clasifica el error en la UI de New Relic como una llamada API `NewRelic.Api.Agent.NoticeError`. Si se invoca fuera de una transacción, la llamada `NoticeError()` no contribuirá a la tasa de errores de una aplicación. - -El agente añade el atributo únicamente al error de traza; no los envía a New Relic. Para obtener más información, consulte [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute). - -Los errores informados con esta API aún se envían a New Relic cuando se informan dentro de una transacción que genera un código de estado HTTP, como `404`, que está configurado para ser ignorado por la configuración del agente. Para obtener más información, consulte nuestra documentación sobre [la gestión de errores en APM](/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected). - -Revise las secciones siguientes para ver ejemplos de cómo utilizar esta llamada. - -## AvisoError(Excepción) [#exception-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception) -``` - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$exception` - - _Excepción_ - - Requerido. El `Exception` que quieres instrumento. Sólo se conservan los primeros 10.000 caracteres del rastreo del stack. -
- -## NoticeError(Exception, IDictionary) [#exception-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$exception` - - _Excepción_ - - Requerido. El `Exception` que quieres instrumento. Sólo se conservan los primeros 10.000 caracteres del rastreo del stack. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Especifique los pares principales de valor del atributo para anotar el mensaje de error. El `TKey` debe ser una cadena, el `TValue` puede ser una cadena u un objeto. -
- -## NoticeError(String, IDictionary) [#string-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$error_message` - - _cadena_ - - Requerido. Especifique una cadena para informar a New Relic como si fuera una excepción. Este método crea tanto [error evento](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) como [error traza](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details). En error evento solo se retienen los primeros 1023 caracteres, mientras que error traza retiene el mensaje completo. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Requerido (puede ser nulo). Especifique los pares principales de valor del atributo para anotar el mensaje de error. El `TKey` debe ser una cadena, el `TValue` puede ser una cadena u objeto, para enviar ningún atributo pasa `null`. - -
- -## NoticeError(String, IDictionary, bool) [#string-idictionary-bool-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$error_message` - - _cadena_ - - Requerido. Especifique una cadena para informar a New Relic como si fuera una excepción. Este método crea tanto [error evento](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) como [error traza](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details). En error evento solo se retienen los primeros 1023 caracteres, mientras que error traza retiene el mensaje completo. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Requerido (puede ser nulo). Especifique los pares principales de valor del atributo para anotar el mensaje de error. El `TKey` debe ser una cadena, el `TValue` puede ser una cadena u objeto, para enviar ningún atributo pasa `null`. -
- `$is_expected` - - _bool_ - - Marque el error como se esperaba para que no afecte la puntuación Apdex ni la tasa de errores. -
- -## Pasar una excepción sin atributo personalizado [#exception-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError(ex); -} -``` - -## Pasar una excepción con atributo personalizado [#exception-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary() {{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError(ex, errorAttributes); -} -``` - -## Pasar una cadena de mensaje de error con atributo personalizado [#string-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary{{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", errorAttributes); -} -``` - -## Pasar una cadena de mensaje de error sin atributo personalizado [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null); -} -``` - -## Pase una cadena de mensaje de error y márquela como se esperaba [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null, true); -} -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx deleted file mode 100644 index 6dc8d8fe9fb..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: RecordCustomEvent (API del agente .NET) -type: apiDoc -shortDescription: Graba un evento personalizado con el nombre de pila y atributo. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to report custom event data to New Relic. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) -``` - -Graba un evento personalizado con el nombre de pila y atributo. - -## Requisitos - -Versión del agente 4.6.29.0 o superior. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Registra un [evento personalizado](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#event-data) con el nombre de pila y atributo, que puedes consultar en el [generador de consultas](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder). Para verificar si un evento se está registrando correctamente, busque los datos en [el tablero](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards). - -Para conocer la API de llamadas relacionada, consulte la [guía de API del agente .NET](/docs/agents/net-agent/api-guides/guide-using-net-agent-api#custom-data). - - - * Enviar muchos eventos puede aumentar la sobrecarga de memoria del agente. - * Además, las publicaciones con un tamaño superior a 1 MB (10^6 bytes) no se registrarán independientemente del número máximo de eventos. - * evento personalizado están limitados a 64 atributos. - * Para obtener más información sobre cómo se procesan los valores de atributo personalizado, consulte la guía [de atributo personalizado](/docs/agents/net-agent/attributes/custom-attributes) . - - -## Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `eventType` - - _cadena_ - - Requerido. El nombre del tipo de evento a registrar. Las cadenas de más de 255 caracteres darán como resultado que la llamada API no se envíe a New Relic. El nombre solo puede contener caracteres alfanuméricos, guiones bajos `_` y dos puntos `:`. Para conocer restricciones adicionales sobre nombres de tipos de eventos, consulte [Palabras reservadas](/docs/insights/nrql-new-relic-query-language/nrql-resources/reserved-words). -
- `attributeValues` - - _IEnumerable<string, object>_ - - Requerido. Especifique el valor principal de los pares de atributos para anotar el evento. -
- -## Ejemplos - -### Valores de registro [#record-strings] - -```cs -var eventAttributes = new Dictionary() -{ -  {"foo", "bar"}, -  {"alice", "bob"}, -  {"age", 32}, -  {"height", 21.3f} -}; - -NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx deleted file mode 100644 index c79d10db279..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordMetric (API del agente .NET) -type: apiDoc -shortDescription: Registra una métrica personalizada con el nombre de pila. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.RecordMetric(string $metric_name, single $metric_value) -``` - -Registra una métrica personalizada con el nombre de pila. - -## Requisitos - -Compatible con todas las versiones de agente. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Registra una [métrica personalizada](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) con el nombre de pila. Para ver estas métricas personalizadas, utilice el [generador de consultas](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) para buscar métricas y crear gráficos personalizables. Consulte también [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) y [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent). - - - Al crear una métrica personalizada, comience el nombre con `Custom/` (por ejemplo, `Custom/MyMetric`). - - -## Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$metric_name` - - _cadena_ - - Requerido. El nombre de la métrica a registrar. Sólo se conservan los primeros 255 caracteres. -
- `$metric_value` - - _soltero_ - - Requerido. La cantidad que se registrará para la métrica. -
- -## Ejemplos - -### Registrar el tiempo de respuesta de un proceso de sueño. [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordMetric("Custom/DEMO_Record_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx deleted file mode 100644 index 31422730975..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordResponseTimeMetric (API del agente .NET) -type: apiDoc -shortDescription: Registra una métrica personalizada con el nombre de pila y el tiempo de respuesta en milisegundos. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record response time as custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value) -``` - -Registra una métrica personalizada con el nombre de pila y el tiempo de respuesta en milisegundos. - -## Requisitos - -Compatible con todas las versiones de agente. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Registra el tiempo de respuesta en milisegundos para una [métrica personalizada](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics). Para ver estas métricas personalizadas, utilice el [generador de consultas](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) para buscar métricas y crear gráficos personalizables. Consulte también [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) y [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent). - - - Al crear una métrica personalizada, comience el nombre con `Custom/` (por ejemplo, `Custom/MyMetric`). - - -## Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$metric_name` - - _cadena_ - - Requerido. El nombre de la métrica de tiempo de respuesta que se va a registrar. Sólo se conservan los primeros 255 caracteres. -
- `$metric_value` - - _Int64_ - - Requerido. El tiempo de respuesta para grabar en milisegundos. -
- -## Ejemplos - -### Registrar el tiempo de respuesta de un proceso de sueño. [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx deleted file mode 100644 index 34d78fcc09e..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: SetApplicationName (API del agente .NET) -type: apiDoc -shortDescription: Establezca el nombre de la aplicación para la acumulación de datos. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to set the New Relic app name, which controls data rollup.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName(string $name[, string $name_2, string $name_3]) -``` - -Establezca el nombre de la aplicación para la acumulación de datos. - -## Requisitos - -Versión del agente 5.0.136.0 o superior. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Establezca los nombres de las aplicaciones reportadas a New Relic. Para obtener más información sobre la denominación de aplicaciones, consulte [Asigne un nombre a su aplicación .NET](/docs/agents/net-agent/installation-configuration/name-your-net-application). Este método está pensado para llamarse una vez, durante el inicio de una aplicación. - - - La actualización del nombre de la aplicación obliga al agente a reiniciarse. El agente descarta cualquier dato no informado asociado con nombres de aplicaciones anteriores. No se recomienda cambiar el nombre de la aplicación varias veces durante el ciclo de vida de una aplicación debido a la pérdida de datos asociada. - - -## Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$name` - - _cadena_ - - Requerido. El nombre de la aplicación principal. -
- `$name_2` - - `$name_3` - - _cadena_ - - Opcional. Segundo y tercer nombre para la acumulación de aplicaciones. Para obtener más información, consulte [Usar varios nombres para una aplicación](/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app). -
- -## Ejemplos - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName("AppName1", "AppName2"); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx deleted file mode 100644 index edbf92106d5..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: SetTransactionUri (API del agente .NET) -type: apiDoc -shortDescription: Establece el URI de la transacción actual. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the URI of a transaction (use with attribute-based custom instrumentation). -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionUri(Uri $uri) -``` - -Establece el URI de la transacción actual. - -## Requisitos - -Debe llamarse dentro de una [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -Versión del agente 6.16 o superior. - - - Este método solo funciona cuando se usa dentro de una transacción creada usando el atributo `Transaction` con la propiedad `Web` establecida en `true`. (Ver [instrumento usando atributo](/docs/agents/net-agent/api-guides/net-agent-api-instrument-using-attributes)). Proporciona soporte para marcos personalizados basados en web que el agente no admite automáticamente. - - -## Descripción - -Establece el URI de la transacción actual. El URI aparece en 'request.uri' [atributo](/docs/agents/net-agent/attributes/net-agent-attributes) de [traza de la transacción](/docs/apm/transactions/transaction-traces/transaction-traces) y [transacción evento](/docs/using-new-relic/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data), y también puede afectar el nombre de la transacción. - -Si utiliza esta llamada varias veces dentro de la misma transacción, cada llamada sobrescribe la llamada anterior. La última llamada establece el URI. - -**Note**: a partir de la versión 8.18 del agente, el valor del atributo `request.uri` se establece en el valor de la propiedad `Uri.AbsolutePath` del objeto `System.Uri` pasado a la API. - -## Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$uri` - - _Uri_ - - El URI de esta transacción. -
- -## Ejemplos - -```cs -var uri = new System.Uri("https://www.mydomain.com/path"); -NewRelic.Api.Agent.NewRelic.SetTransactionUri(uri); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx deleted file mode 100644 index 6e5f51c5702..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: SetUserParameters (agente .NET) -type: apiDoc -shortDescription: Cree un atributo personalizado relacionado con el usuario. AddCustomAttribute() es más flexible. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach user-related custom attributes to APM and browser events. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value) -``` - -Cree un atributo personalizado relacionado con el usuario. [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) es más flexible. - -## Requisitos - -Compatible con todas las versiones de agente. - -Debe llamarse dentro de una [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descripción - - - Esta llamada solo le permite asignar valores a claves preexistentes. Para obtener un método más flexible para crear pares de valores principales, utilice [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction). - - -Defina [un atributo personalizado](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)relacionado con el usuario para asociarlo con una vista de página browser (nombre de usuario, nombre de cuenta y nombre de producto). Los valores se asocian automáticamente con claves preexistentes (`user`, `account` y `product`) y luego se adjuntan a la transacción APM principal. También puede [adjuntar (o "reenviar") estos atributos](/docs/insights/new-relic-insights/decorating-events/insights-custom-attributes#forwarding-attributes) al browser evento [PageView .](/docs/agents/manage-apm-agents/agent-metrics/agent-attributes#destinations) - -## Parámetros - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$user_value` - - _cadena_ - - Requerido (puede ser nulo). Especifique un nombre o nombre de usuario para asociarlo con esta vista de página. Este valor se asigna a la clave `user` . -
- `$account_value` - - _cadena_ - - Requerido (puede ser nulo). Especifique el nombre de una cuenta de usuario para asociarla con esta vista de página. Este valor se asigna a la clave `account` . -
- `$product_value` - - _cadena_ - - Requerido (puede ser nulo). Especifique el nombre de un producto para asociarlo con esta vista de página. Este valor se asigna a la clave `product` . -
- -## Ejemplos - -### Grabar tres atributos de usuario. [#report-three] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName"); -``` - -### Registre dos atributos de usuario y un atributo vacío [#report-two] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName"); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx deleted file mode 100644 index 466574b14e6..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: SetErrorGroupCallback (API del agente .NET) -type: apiDoc -shortDescription: Proporcionar un método de devolución de llamada para determinar el nombre del grupo de errores en función de los datos del atributo. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to provide a callback method for determining the error group name for an error, based on attribute data.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(Func, string> errorGroupCallback); -``` - -Proporcione un método de devolución de llamada que tome un `IReadOnlyDictionary` de datos de atributo y devuelva un nombre de grupo de error. - -## Requisitos [#requirements] - -Esta llamada API es compatible con: - -* Versiones del agente >= 10.9.0 -* Todos los tipos de aplicaciones - -## Descripción [#description] - -Establezca un método de devolución de llamada que el agente utilizará para determinar el nombre del grupo de errores para el evento de error y la traza. Este nombre se utiliza en la Errors Inbox para agrupar errores en grupos lógicos. - -El método de devolución de llamada debe aceptar un único argumento de tipo `IReadOnlyDictionary` y devolver una cadena (el nombre del grupo de errores). El `IReadOnlyDictionary` es una colección de [datos de atributos](/docs/apm/agents/manage-apm-agents/agent-data/agent-attributes/) asociados con cada evento de error, incluido el atributo personalizado. - -La lista exacta de atributos disponibles para cada error variará dependiendo de: - -* ¿Qué código de aplicación generó el error? -* Ajustes de configuración del agente -* Si se agregó algún atributo personalizado - -Sin embargo, siempre debe existir el siguiente atributo: - -* `error.class` -* `error.message` -* `stack_trace` -* `transactionName` -* `request.uri` -* `error.expected` - -Se puede devolver una cadena vacía para el nombre del grupo de errores cuando el error no se puede asignar a un grupo de errores lógicos. - -## Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$callback` - - _'Func<IReadOnlyDictionary<string,object>,string>'_ - - La devolución de llamada para determinar el nombre del grupo de errores en función de los datos del atributo. -
- -## Ejemplos - -Errores de grupo por nombre de clase de error: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("error.class", out var errorClass)) - { - if (errorClass.ToString() == "System.ArgumentOutOfRangeException" || errorClass.ToString() == "System.ArgumentNullException") - { - errorGroupName = "ArgumentErrors"; - } - else - { - errorGroupName = "OtherErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` - -Errores de grupo por nombre de transacción: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("transactionName", out var transactionName)) - { - if (transactionName.ToString().IndexOf("WebTransaction/MVC/Home") != -1) - { - errorGroupName = "HomeControllerErrors"; - } - else - { - errorGroupName = "OtherControllerErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx deleted file mode 100644 index 456b65b3971..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: SetLlmTokenCountingCallback (API del agente .NET) -type: apiDoc -shortDescription: Proporcionar un método de devolución de llamada que determine el recuento token para completar un LLM -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to provide a callback method that determines the token count for an LLM completion. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(Func callback); -``` - -Proporcione un método de devolución de llamada que calcule el recuento token . - -## Requisitos [#requirements] - -Esta llamada API es compatible con: - -* Versiones del agente >= 10.23.0 -* Todos los tipos de aplicaciones - -## Descripción [#description] - -Establezca un método de devolución de llamada que el agente utilizará para determinar el recuento token para un evento LLM. En el modo de alta seguridad o cuando la grabación de contenido está deshabilitada, se llamará a este método para determinar el recuento token para el evento LLM. - -El método de devolución de llamada debe aceptar dos argumentos de tipo `string` y devolver un número entero. El primer argumento de cadena es el nombre del modelo LLM y el segundo argumento de cadena es la entrada al LLM. El método de devolución de llamada debe devolver el recuento token para el evento LLM. Se ignorarán los valores de 0 o menos. - -## Parámetros - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$callback` - - '\_Func<string, string, int>\_' - - La devolución de llamada para determinar el recuento token . -
- -## Ejemplo - -```cs -Func llmTokenCountingCallback = (modelName, modelInput) => { - - int tokenCount = 0; - // split the input string by spaces and count the tokens - if (!string.IsNullOrEmpty(modelInput)) - { - tokenCount = modelInput.Split(' ').Length; - } - - return tokenCount; -}; - -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(llmTokenCountingCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx deleted file mode 100644 index 7a0eeb1568a..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: SetTransactionName (API del agente .NET) -type: apiDoc -shortDescription: Establece el nombre de la transacción actual. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the name of a transaction. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name) -``` - -Establece el nombre de la transacción actual. - -## Requisitos - -Compatible con todas las versiones de agente. - -Debe llamarse dentro de una [transacción](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descripción - -Establece el nombre de la transacción actual. Antes de utilizar esta llamada, asegúrese de comprender las implicaciones de los [problemas de agrupación métrica](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues). - -Si utiliza esta llamada varias veces dentro de la misma transacción, cada llamada sobrescribe la llamada anterior y la última llamada establece el nombre. - - - No utilice corchetes `[suffix]` al final del nombre de su transacción. New Relic elimina automáticamente los corchetes del nombre. En su lugar, utilice paréntesis `(suffix)` u otros símbolos si es necesario. - - -Valor único como URL, títulos de páginas, valores hexadecimales, ID de sesión y valores identificables de forma única no deben usarse para nombrar su transacción. En su lugar, agregue esos datos a la transacción como un parámetro personalizado con la llamada [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) . - - - No cree más de 1000 nombres de transacciones únicos (por ejemplo, evite nombrar por URL si es posible). Esto hará que sus gráficos sean menos útiles y es posible que se encuentre con los límites que New Relic establece en la cantidad de nombres de transacciones únicos por cuenta. También puede ralentizar el rendimiento de su aplicación. - - -## Parámetros - - - - - - - - - - - - - - - - - - - - - - - -
- Parámetro - - Descripción -
- `$category` - - _cadena_ - - Requerido. La categoría de esta transacción, que puede utilizar para distinguir diferentes tipos de transacciones. El valor predeterminado es **`Custom`**. Sólo se conservan los primeros 255 caracteres. -
- `$name` - - _cadena_ - - Requerido. El nombre de la transacción. Sólo se conservan los primeros 255 caracteres. -
- -## Ejemplos - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction"); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx deleted file mode 100644 index a5cf839f760..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: StartAgent (API del agente .NET) -type: apiDoc -shortDescription: Inicie el agente si aún no lo ha hecho. Generalmente innecesario. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to force the .NET agent to start, if it hasn''t been started already. Usually unnecessary, since the agent starts automatically.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent() -``` - -Inicie el agente si aún no lo ha hecho. Generalmente innecesario. - -## Requisitos - -Versión del agente 5.0.136.0 o superior. - -Compatible con todo tipo de aplicaciones. - -## Descripción - -Inicia el agente si aún no se ha iniciado. Esta llamada suele ser innecesaria, ya que el agente se inicia automáticamente cuando llega a un método instrumentado a menos que deshabilite [`autoStart`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-autoStart). Si usa [`SetApplicationName()`](/docs/agents/net-agent/net-agent-api/setapplicationname-net-agent), asegúrese de configurar el nombre de la aplicación **before** al iniciar el agente. - - - Este método inicia el agente de forma asincrónica (es decir, no bloqueará el inicio de la aplicación) a menos que habilite [`syncStartup`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-syncStartup) o [`sendDataOnExit`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-sendDataOnExit). - - -## Ejemplos - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx b/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx deleted file mode 100644 index 6b8ef2b6d73..00000000000 --- a/src/i18n/content/es/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: TraceMetadata (API del agente .NET) -type: apiDoc -shortDescription: Devuelve propiedades en el entorno de ejecución actual utilizado para admitir el seguimiento. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxis - -```cs -NewRelic.Api.Agent.TraceMetadata; -``` - -Devuelve propiedades en el entorno de ejecución actual utilizado para admitir el seguimiento. - -## Requisitos - -Versión del agente 8.19 o superior. - -Compatible con todo tipo de aplicaciones. - -[Rastreo distribuido debe estar habilitado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) para obtener valores significativos. - -## Descripción - -Proporciona acceso a las siguientes propiedades: - -### Propiedades - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Nombre - - Descripción -
- `TraceId` - - Devuelve una cadena que representa la traza que se está ejecutando actualmente. Si la traza ID no está disponible, o el rastreo distribuido está deshabilitado, el valor será `string.Empty`. -
- `SpanId` - - Devuelve una cadena que representa el intervalo de ejecución actual. Si el span ID no está disponible o el rastreo distribuido está deshabilitado, el valor será `string.Empty`. -
- `IsSampled` - - Devuelve `true` si se toma una muestra de la traza actual para su inclusión, `false` si se toma una muestra. -
- -## Ejemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -TraceMetadata traceMetadata = agent.TraceMetadata; -string traceId = traceMetadata.TraceId; -string spanId = traceMetadata.SpanId; -bool isSampled = traceMetadata.IsSampled; -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx deleted file mode 100644 index 450c7da6ee2..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: DisableBrowserMonitoring (.NETエージェントAPI) -type: apiDoc -shortDescription: 特定のページでのブラウザモニタリングスニペットの自動注入を無効にする。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to disable browser monitoring on specific pages or views. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override]) -``` - -特定のページでのブラウザモニタリングスニペットの自動注入を無効にする。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -[トランザクションの中で呼び出す必要があります](/docs/glossary/glossary/#transaction) 。 - -## 説明 - -この**呼び出し**を追加して、 [](/docs/browser/new-relic-browser/getting-started/new-relic-browser)特定のページのスクリプト。オプションのオーバーライドを追加して、手動と自動の**両方の**注入を無効にすることもできます。いずれの場合も、この API 呼び出しをブラウザを無効にするビューの上部にできるだけ近い位置に配置します。 - - - ブラウザ スクリプトをページに[`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent) **追加する** を比較してください。 - - -## パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$override` - - _ブール値_ - - オプション。`true`の場合、ブラウザ スクリプトのすべての挿入が無効になります。このフラグは、手動注入と自動注入の両方に影響します。これにより、 [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent)呼び出しもオーバーライドされます。 -
- -## 例 - -### オートインジェクションの無効化 [#automatic-only] - -この例では、 **スニペットの自動** インジェクションのみを無効にしています。 - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(); -``` - -### オートマチック/マニュアルインジェクションの無効化 [#disable-both] - -この例では、 **スニペットの自動注入と手動注入の両方を無効にしています。** - -**```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true); -```** \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getagent.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getagent.mdx deleted file mode 100644 index e02ecc1f352..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getagent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: GetAgent -type: apiDoc -shortDescription: IAgent インターフェイスを介してエージェントにアクセスします。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.GetAgent() -``` - -`IAgent`インターフェースを介してエージェントにアクセスします。 - -## 要件 - -Agentバージョン8.9以上。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -[`IAgent`](/docs/agents/net-agent/net-agent-api/iagent)インターフェースを介してエージェント API メソッドにアクセスします。 - -## 戻り値 - -[IAgent の実装](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) [IAgent API へのアクセスを提供する](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) 。 - -## 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx deleted file mode 100644 index f2620cb0440..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: GetBrowserTimingHeader (.NETエージェントAPI) -type: apiDoc -shortDescription: エンドユーザーのブラウザを計測するために、ブラウザモニタリング用のHTMLスニペットを生成します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to instrument a webpage with browser. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(); -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(string nonce); -``` - -エンドユーザーのブラウザを計測するために、ブラウザモニタリング用のHTMLスニペットを生成します。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -[トランザクションの中で呼び出す必要があります](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 。 - -## 説明 - -有効にするために使用される HTML スニペットを返します。 [](/docs/browser/new-relic-browser/getting-started/new-relic-browser)。このスニペットは、ブラウザに小さな JavaScript ファイルをフェッチし、ページ タイマーを開始するように指示します。返されたスニペットを HTML Web ページのヘッダーに挿入できます。詳細については、 [「ブラウザ監視へのアプリの追加」](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser)を参照してください。 - - - ページのブラウザスクリプトを**無効にする**[`DisableBrowserMonitoring()`](/docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent)を比較してください。 - - -## パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `nonce` - - _ストリング_ - - Content-Security-Policyポリシーで使用される、リクエストごとの暗号化されたノンスです。 -
- - - このAPIコールでは、セキュリティ許可リストの更新が必要です。コンテンツセキュリティポリシー(CSP)の考慮事項については、 [ブラウザモニタリングの互換性と要件](/docs/browser/new-relic-browser/getting-started/compatibility-requirements-browser-monitoring) ページをご覧ください。 - - -## 戻り値 - -ページのヘッダーに埋め込むHTML文字列です。 - -## 例 - -### ASPXで [#aspx] - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%> - ... - - - ... -``` - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")%> - ... - - - ... -``` - -### レイザー付き [#razor] - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` - -### ブレザー付き [#blazor] - - - エージェントは Webassembly コードをインストルメントできないため、この API は Blazor Webassembly ではサポートされていません。次の例は、Blazor サーバー アプリケーションのみを対象としています。[コピーアンドペーストの方法](/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste)を使用して、ブラウザー エージェントを Blazor Webassembly ページに追加します。 - - - - この API は、 `.razor`ページの``要素には配置できません。代わりに、 `_Layout.cshtml`または同等のレイアウト ファイルから呼び出す必要があります。 - - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx deleted file mode 100644 index 0aeb6793bab..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: GetLinkingMetadata (.NETエージェントAPI) -type: apiDoc -shortDescription: トレースやエンティティのリンクに使用できるキー/バリューペアを返します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.GetLinkingMetadata(); -``` - -トレースやエンティティのリンクに使用できるキー/バリューペアを返します。 - -## 要件 - -Agentバージョン8.19以上。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -返されるキー/値ペアのディクショナリには、APM製品のトレースとエンティティをリンクするために使用されるアイテムが含まれています。意味のある値を持つアイテムのみが含まれます。たとえば、分散トレースが無効になっている場合、 `trace.id`は含まれません。 - -## 戻り値 - -`Dictionary ()` 返されるアイテムには、APM製品のトレースとエンティティをリンクするために使用されるアイテムが含まれます。 - -## 例 - -```cs -NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -var linkingMetadata = Agent.GetLinkingMetadata(); -foreach (KeyValuePair kvp in linkingMetadata) -{ - Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); -} -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx deleted file mode 100644 index a50f9c862dc..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx +++ /dev/null @@ -1,326 +0,0 @@ ---- -title: .NETエージェントAPIの使用ガイド -tags: - - Agents - - NET agent - - API guides -metaDescription: 'A goal-focused guide to the New Relic .NET agent API, with links to relevant sections of the complete API documentation.' -freshnessValidatedDate: never -translationType: machine ---- - -New Relicの.NETエージェントには、エージェントの標準機能を拡張できる[API](/docs/agents/net-agent/net-agent-api)が含まれます。.NETエージェントAPIの使用例は、次のとおりです。 - -* アプリケーション名のカスタマイズ -* カスタムトランザクションのパラメーターの作成 -* カスタムエラーとカスタムメトリクスのレポート - -[設定](/docs/agents/net-agent/configuration/net-agent-configuration)を調整するか、[カスタムインストゥルメンテーション](/docs/agents/net-agent/custom-instrumentation/introduction-net-custom-instrumentation)を使用して、.NETエージェントの一部のデフォルト動作をカスタマイズすることもできます。 - -## 要件 - - - 2021年9月現在で、.NET用のAPI、設定オプション、インストレーションオプションの小さなサブセットが新しいメソッドで置き換えられます。この移行の簡単な準備方法などの詳細については、[サポートフォーラムの投稿](https://discuss.newrelic.com/t/important-upcoming-changes-to-support-and-capabilities-across-browser-node-js-agent-query-builder-net-agent-apm-errors-distributed-tracing/153373)を参照してください。 - - -.NETエージェントAPIを使用するには: - -1. [.NETエージェントの最新リリース](/docs/release-notes/agent-release-notes/net-release-notes)を使用していることを確認します。 - -2. プロジェクトにエージェントへの参照を追加します。 - - * プロジェクトに`NewRelic.Api.Agent.dll`への参照を追加します。 - - また - - * [NuGetパッケージライブラリ](https://www.nuget.org/packages/NewRelic.Agent.Api/)を参照してAPIパッケージをダウンロードします。 - -## コードの欠落しているセクションをトランザクションで計測する [#creating-transactions] - -アプリをインストゥルメントするために、New Relicはコードで各パスをその[トランザクション](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction)に分離します。New Relicは、これらのトランザクションの親メソッドの時間をインストゥルメントして総合的なパフォーマンスを測定し、追加詳細として長期間実行されているトランザクションから[トランザクショントレース](/docs/apm/transactions/transaction-traces/introduction-transaction-traces)を収集します。 - -New Relicがコードの特定の部分をまったくインストルメントしていない場合は、次のメソッドを使用します。 - - - - - - - - - - - - - - - - - - - - - - - -
- あなたがしたい場合は... - - これを行う... -
- トランザクションがNewRelicに報告されないようにする - - [`IgnoreTransaction()`](/docs/agents/net-agent/net-agent-api/ignore-transaction) または [XMLファイル](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation)を使用して、トランザクションを無視します。 -
- トランザクションが存在しない場所にトランザクションを作成する - - [属性](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net)または [XMLファイル](/docs/agents/net-agent/instrumentation/net-custom-transactions)を使用して新しいトランザクションを作成します。 -
- -## セグメントを使用した時間固有の方法 [#segments] - -New Relic UIにトランザクションがすでに表示されているが、そのトランザクション中に呼び出された特定のメソッドに関する十分なデータがない場合は、セグメントを作成して、それらの個々のメソッドの時間をより詳細に計測できます。たとえば、複雑なロジックを使用して特に重要なメソッドの時間を計測したい場合があります。 - -既存のトランザクション内でメソッドをインストゥルメントする場合は、[属性によるカスタムインストゥルメンテーション](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net)または[XMLによるトランザクションへの詳細の追加](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net)をご覧ください。 - -## トランザクションのメタデータを強化する [#metadata] - -計測対象のコードがNew Relic UIに表示される場合もありますが、メソッドの詳細の一部が有用ではないことがあります。例: - -* デフォルト名が有用でない。([メトリクスのグループ化問題](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues#video)の原因になっている場合など)。 -* ダッシュボードでフィルターできるように、トランザクションに[カスタムアトリビュート](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)を追加します。 - -New Relic UIにすでに表示されているトランザクションをNew Relicでインストゥルメントする方法を変更する場合は、以下の方法を使用します。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- あなたがしたい場合は... - - これを行う... -
- トランザクションの名前を変更する - - [`SetTransactionName()`](/docs/agents/net-agent/net-agent-api/set-transaction-name)または[XMLファイル](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#name-transactions)を使用します。 -
- トランザクションが[Apdex](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#apdex)スコアに影響しないようにする - - [`IgnoreApdex()`](/docs/agents/net-agent/net-agent-api/ignore-apdex)を使用します。 -
- トランザクションにメタデータ(顧客のアカウント名またはサブスクリプションレベルなど)を追加する - - [カスタムアトリビュート](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes)を使用します。[`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction#addcustomattribute)をご覧ください。 -
- -## 関連ログを見る [#logs] - -アプリケーションのエラーとトレースのコンテキスト内でログを直接表示するには、次のAPI呼び出しを使用してログに注釈を付けます。 - -* [`TraceMetadata`](/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0/) -* [`GetLinkingMetadata`](/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api/) - -ログデータと他のテレメトリーデータの相関に関する詳細は、[コンテキストのログ](/docs/logs/logs-context/net-configure-logs-context-all/)に関するドキュメントを参照してください。 - -## 機器の非同期作業 [#async] - -サポートされているフレームワークの場合、.NETエージェントは通常、非同期動作を検出して正しくインストゥルメントします。ただし、アプリケーションが別のフレームワークを使用する場合、または[デフォルトの非同期インストゥルメンテーション](/docs/agents/net-agent/features/async-support-net)が正確ではない場合は、非同期動作に明示的に接続できます。 - - - - - - - - - - - - - - - - - - - - - - - -
- あなたがしたい場合は... - - これを行う... -
- New Relicがすでにインストゥルメントしている非同期メソッドをトレースする - - [XMLファイル](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async)を使用して、IISアプリの非同期メソッドをインストゥルメントします。トラブルシューティングのヒントについては、[欠落している非同期メトリクス](/docs/agents/net-agent/troubleshooting/missing-async-metrics)を参照してください。 -
- New Relicがインストゥルメントしていない非同期メソッドをトレースする - - [XMLファイル](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async)を使用して、IISアプリの非同期メソッドをインストゥルメントします。トラブルシューティングのヒントについては、[欠落している非同期メトリクス](/docs/agents/net-agent/troubleshooting/missing-async-metrics)を参照してください。 -
- -## 外部サービスの呼び出しの表示 [#externals] - -.NETエージェントバージョン8.9以上では、以下の[ディストリビューティッド(分散)トレーシングペイロードAPI](/docs/apm/agents/net-agent/configuration/distributed-tracing-net-agent/#manual-instrumentation)を使用して、[分散トレース](/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing)で自動的に相互接続しないNew Relicが監視するサービス間でディストリビューティッド(分散)トレーシングコンテキストを手動で渡すことができます。 - - - - - - - - - - - - - - - - - - - - - - - -
- あなたがしたい場合は... - - これを行う... -
- 外部アプリケーションまたはデータベースに対する発信リクエストを計測する - - [`InsertDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders)を使用して、発信リクエストにディストリビューティッド(分散)トレースペイロードを追加します。 -
- 着信リクエストをリクエストの発信者に結び付けてトレースの[スパン](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#span)を完了する - - [`AcceptDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders)を使用して受信リクエストでペイロードを受信します。 -
- -8.9以前のバージョンの.NETエージェントには、[クロスアプリケーショントレーシング](/docs/apm/transactions/cross-application-traces/introduction-cross-application-traces)を使用してください。 - -## エラーを収集または無視する [#errors] - -通常、.NETエージェントはエラーを自動的に検出します。ただし、エージェントを使用してエラーに手動でマーク付けできます。[エラーを無視](/docs/apm/applications-menu/error-analytics/ignoring-errors-new-relic-apm)することもできます。 - - - - - - - - - - - - - - - - - - - - - - - -
- あなたがしたい場合は... - - これを行う... -
- .NETエージェントが自動的に報告しないエラーを報告する - - [`NoticeError()`](/docs/agents/net-agent/net-agent-api/notice-error)を使用します。 -
- エラーをキャプチャするか、.NETエージェントがエラーをレポートしないようにする - - [.NETエージェントの設定ファイル](/docs/agents/net-agent/configuration/net-agent-configuration#error_collector)を使用します。 -
- -## アプリからカスタムイベントと指標データを送信する [#custom-data] - -APMには、任意のカスタムデータを記録する多くの方法が含まれます。New Relicデータ型の説明については、[データ収集](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data)をご覧ください。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- あなたがしたい場合は... - - これを行う... -
- ダッシュボードで分析できるように、イベントに関するデータを送信する - - [カスタムイベント](/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents#net-att)を作成します。[`RecordCustomEvent()`](/docs/agents/net-agent/net-agent-api/record-custom-event)をご覧ください。 -
- メタデータを使用してイベントにタグ付けし、ダッシュボードまたはエラー分析でフィルターしてファセットする - - [カスタムアトリビュート](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes)を追加します。.NETエージェントの属性と[属性の有効化/無効化](/docs/agents/net-agent/attributes/enable-disable-attributes-net)を参照してください。 -
- カスタムパフォーマンスデータを報告する - - [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/record-metric)を使用して、[カスタムメトリック](/docs/agents/manage-apm-agents/agent-data/collect-custom-metrics)を作成します。データを表示するには、[クエリビルダー](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data)を使用します。 -
- -## ブラウザモニタリングエージェントを制御する [#browser] - -通常、エージェントはページに自動的に追加、またはJavaScriptスニペットをコピー/ペーストしてデプロイされます。これらの推奨メソッドの詳細については、[ブラウザモニタリングへのアプリの追加](/docs/browser/new-relic-browser/installation-configuration/add-apps-new-relic-browser)を参照してください。 - -ただし、ブラウザエージェントは、APMエージェントAPIコールを介して制御することもできます。詳細については、[Browserモニタリングと.NETエージェント](/docs/agents/net-agent/instrumentation-features/new-relic-browser-net-agent)をご覧ください。 \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/iagent.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/iagent.mdx deleted file mode 100644 index 6276e285463..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/iagent.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: IAgent -type: apiDoc -shortDescription: 現在実行中のトランザクションなど、エージェントのアーティファクトとメソッドへのアクセスを提供します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -public interface IAgent -``` - -現在実行中のトランザクションなど、エージェントのアーティファクトとメソッドへのアクセスを提供します。 - -## 要件 - -Agentバージョン8.9以上。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -現在実行中のトランザクションなど、エージェントのアーティファクトとメソッドへのアクセスを提供します。`IAgent`への参照を取得するには、 [`GetAgent`](/docs/agents/net-agent/net-agent-api/getagent)を使用します。 - -### プロパティ - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- CurrentTransaction - - [ITransaction](/docs/agents/net-agent/net-agent-api/itransaction) インターフェースを介して、現在実行中のトランザクションへのアクセスを提供するプロパティです。 [トランザクションの中で呼び出されなければなりません](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 。 -
- カレントスパン - - [ISpan](/docs/agents/net-agent/net-agent-api/iSpan) インターフェースを介して、現在実行中のスパンへのアクセスを提供するプロパティ。 -
- -## 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx deleted file mode 100644 index a6dd46f1c7f..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: IgnoreApdex (.NETエージェントAPI) -type: apiDoc -shortDescription: Apdexを計算する際に、現在の取引を無視する。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction when calculating your app's overall Apdex score. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex() -``` - -Apdexを計算する際に、現在の取引を無視する。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -## 説明 - -[Apdexスコア](/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction) を計算する際に、現在のトランザクションを無視します。これは、Apdexスコアを歪める可能性のある、非常に短いまたは非常に長いトランザクション(ファイルのダウンロードなど)がある場合に便利です。 - -## 例 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex(); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx deleted file mode 100644 index a5e41ff563c..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: IgnoreTransaction (.NETエージェントAPI) -type: apiDoc -shortDescription: 現在のトランザクションを計測しない。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction entirely. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction() -``` - -現在のトランザクションを計測しない。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -[トランザクションの中で呼び出す必要があります](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 。 - -## 説明 - -現在のトランザクションを無視します。 - - - トランザクションを無視することもできます [カスタムインストルメンテーションXMLファイル](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation) を介して。 - - -## 例 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction(); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx deleted file mode 100644 index 96bbb6a5963..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: インクリメントカウンタ(.NETエージェントAPI) -type: apiDoc -shortDescription: カスタムメトリックのカウンタを1増加させます。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to increment the value of a custom metric. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name) -``` - -カスタムメトリックのカウンタを1増加させます。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -[カスタム指標](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics)のカウンターを 1 増やします。これらのカスタム メトリックを表示するには、 [クエリ ビルダー](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data)を使用してメトリックを検索し、カスタマイズ可能なグラフを作成します。[`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent)と[`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent)も参照してください。 - - - カスタム指標を作成するときは、名前を`Custom/`で始めます (例: `Custom/MyMetric` )。命名の詳細については、[カスタム メトリックの収集](/docs/apm/agents/manage-apm-agents/agent-data/collect-custom-metrics/)を参照してください。 - - -## パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$metric_name` - - _ストリング_ - - 必要です。インクリメントするメトリックの名前です。 -
- -## 例 - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric"); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ispan.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ispan.mdx deleted file mode 100644 index 3041114d1b7..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/ispan.mdx +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: アイスパン -type: apiDoc -shortDescription: New Relic API のスパン固有のメソッドへのアクセスを提供します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -Public interface ISpan -``` - -New Relic API のスパン固有のメソッドへのアクセスを提供します。 - -## 説明 - -NewRelic.NETエージェントAPIのスパン固有のメソッドへのアクセスを提供します。 `ISpan`への参照を取得するには、次を使用します。 - -* [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) }の`CurrentSpan`プロパティ(推奨)。 -* [`ITransaction`](/docs/agents/net-agent/net-agent-api/itransaction)の`CurrentSpan`プロパティ。 - -このセクションには、 `ISpan`メソッドの説明とパラメーターが含まれています。 - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- [`AddCustomAttribute`](#addcustomattribute) - - アプリケーションからのコンテキスト情報を、属性の形で現在のスパンに追加します。 -
- [`SetName`](#setname) - - New Relic に報告される現在のスパン/セグメント/メトリクスの名前を変更します。 -
- -## カスタムアトリビュートの追加 [#addcustomattribute] - -現在のスパンに、アプリケーションのコンテキスト情報を [属性](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute) の形で追加します。 - -この方法には、.NETエージェントのバージョンと.NETエージェントAPI [バージョン8.25](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) 以上が必要です。 - -### 構文 - -```cs -ISpan AddCustomAttribute(string key, object value) -``` - -### パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `key` - - _ストリング_ - - 報告される情報を特定するもの。名称としても知られている。 - - * 空のキーには対応していません。 - * キーは255バイトに制限されています。255バイト以上のキーを持つアトリビュートは無視されます。 -
- `value` - - _物体_ - - 報告される値です。 - - **注**: `null` 値は記録されません。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- .NETタイプ - - 価値がどのように表現されるか -
- `byte`、`Int16`、`Int32`、 `Int64` - - `sbyte`、`UInt16`、`UInt32`、 `UInt64` - - 整数値として。 -
- `float`、 `double` 、 `decimal` - - 10 進数ベースの数値。 -
- `string` - - 255バイトで切り捨てられた文字列。 - - 空の文字列にも対応しています。 -
- `bool` - - 正しいか間違っているか。 -
- `DateTime` - - ISO-8601フォーマットに従った文字列表現(タイムゾーン情報を含む)。 - - 例: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - 秒数を表す10進法の数値です。 -
- その他 - - `ToString()`メソッドが適用されます。カスタムタイプには`Object.ToString()`の実装が必要です。そうでない場合、例外がスローされます。 -
-
- -### リターンズ - -現在のスパンへの参照です。 - -### 使用上の注意 - -サポートされているデータタイプの詳細については、「 [Custom Attributes」のガイド](/docs/agents/net-agent/attributes/custom-attributes) を参照してください。 - -## 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ISpan currentSpan = agent.CurrentSpan; - -currentSpan - .AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## セット名 [#setname] - -New Relic に報告される現在のセグメント/スパンの名前を変更します。カスタム インストルメンテーションから生じるセグメント/スパンの場合、New Relic に報告されるメトリック名も変更されます。 - -このメソッドには、.NET エージェント バージョンと .NET エージェント API バージョン 10.1.0 が必要です。以上。 - -### 構文 - -```cs -ISpan SetName(string name) -``` - -### パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `name` - - _ストリング_ - - スパン/セグメントの新しい名前。 -
- -### リターンズ - -現在のスパンへの参照です。 - -## 例 - -```cs -[Trace] -public void MyTracedMethod() -{ - IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); - ISpan currentSpan = agent.CurrentSpan; - - currentSpan.SetName("MyCustomName"); -} -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx deleted file mode 100644 index c19df593ee1..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx +++ /dev/null @@ -1,604 +0,0 @@ ---- -title: ITransction -type: apiDoc -shortDescription: New Relic API のトランザクション固有のメソッドへのアクセスを提供します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -public interface ITransaction -``` - -New Relic API のトランザクション固有のメソッドへのアクセスを提供します。 - -## 説明 - -New Relic .NET エージェント API のトランザクション固有のメソッドへのアクセスを提供します。`ITransaction`への参照を取得するには、 [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent)で使用可能な現在のトランザクション メソッドを使用します。 - -`ITransaction`では次のメソッドを使用できます: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- [`AcceptDistributedTraceHeaders`](#acceptdistributedtraceheaders) - - 他のサービスから送られてくるトレースコンテキストヘッダを受信します。 -
- [`InsertDistributedTraceHeaders`](#insertdistributedtraceheaders) - - 発信するリクエストにトレースコンテキストヘッダを追加します。 -
- [`AcceptDistributedTracePayload` (廃止)](#acceptdistributedtracepayload) - - 他のサービスからの分散型トレースペイロードを受信します。 -
- [`CreateDistributedTracePayload` (廃止)](#createdistributedtracepayload) - - 発信するリクエストに含める分散型トレースペイロードを作成します。 -
- [`AddCustomAttribute`](#addcustomattribute) - - アプリケーションのコンテキスト情報を属性の形で現在のトランザクションに追加します。 -
- [`CurrentSpan`](#currentspan) - - 現在実行中の [span](/docs/agents/net-agent/net-agent-api/ispan) へのアクセスを提供し、New Relic API の span 固有のメソッドへのアクセスを提供します。 -
- [`SetUserId`](#setuserid) - - ユーザー ID を現在のトランザクションに関連付けます。 -
- -## AcceptDistributedTraceHeaders - -`ITransaction.AcceptDistributedTraceHeaders` 分散トレースに含めるために呼び出されたサービスを計測するために使用されます。[ `InsertDistributedTraceHeaders`](/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#transaction-handle-insertDistributedTraceHeaders) によって生成されたペイロード、または他の W3C トレース コンテキスト準拠のトレーサによって生成されたペイロードを受け入れることで、トレース内のスパンをリンクします。 このメソッドは、着信リクエストのヘッダーを受け入れ、W3C トレース コンテキスト ヘッダーを探し、見つからない場合は、New Relic 分散トレース ヘッダーにフォールバックします。このメソッドは、New Relic の分散トレース ペイロードのみを処理する非推奨の [`AcceptDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#acceptdistributedtracepayload) メソッドを置き換えます。 - -### 構文 - -```cs -void AcceptDistributedTraceHeaders(carrier, getter, transportType) -``` - -### パラメーター - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- `carrier` - - _<T>_ - - 必要です。受信するTrace Contextヘッダーのソース。 -
- `getter` - - _Func<T, string, IEnumerable<string>>_ - - 必要です。キャリアからヘッダーデータを抽出するための呼び出し側定義の関数。 -
- `transportType` - - _トランスポートタイプ enum_ - - 必要。着信ペイロードのトランスポートを記述します (例: `TransportType.HTTP` )。 -
- -### 使用上の注意 - -* [Distributed tracingが有効であること](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `AcceptDistributedTraceHeaders` `InsertDistributedTraceHeaders`または`AcceptDistributedTraceHeaders`がこのトランザクションに対して既に呼び出されている場合は無視されます。 - -### 例 - -```cs -HttpContext httpContext = HttpContext.Current; -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -currentTransaction.AcceptDistributedTraceHeaders(httpContext, Getter, TransportType.HTTP); -IEnumerable Getter(HttpContext carrier, string key) -{ - string value = carrier.Request.Headers[key]; - return value == null ? null : new string[] { value }; -} -``` - -## InsertDistributedTraceHeaders - -`ITransaction.InsertDistributedTraceHeaders` 分散トレースの実装に使用されます。W3C Trace Context ヘッダーと New Relic Distributed Trace ヘッダーを追加することで、渡されたキャリア オブジェクトを変更します。New Relic ヘッダーは、構成で``を使用して無効にすることができます。このメソッドは、New Relic Distributed Trace ペイロードのみを作成する非推奨の [`CreateDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#createdistributedtracepayload) メソッドを置き換えます。 - -### 構文 - -```cs -void InsertDistributedTraceHeaders(carrier, setter) -``` - -### パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- `carrier` - - _<T>_ - - 必要です。Trace Context ヘッダが挿入されるコンテナです。 -
- `setter` - - _アクション<T, string, string>_ - - 必要です。呼び出し側が定義した、キャリアにヘッダーデータを挿入するためのアクション。 -
- -### 使用上の注意 - -* [Distributed tracingが有効であること](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). - -### 例 - -```cs -HttpWebRequest requestMessage = (HttpWebRequest)WebRequest.Create("https://remote-address"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -var setter = new Action((carrier, key, value) => { carrier.Headers?.Set(key, value); }); -currentTransaction.InsertDistributedTraceHeaders(requestMessage, setter); -``` - -## AcceptDistributedTracePayload [#acceptdistributedtracepayload] - - - この API は、.NET エージェント v9.0 以降では使用できません。代わりに [`AcceptDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders) を使用してください。 - - -上流のサービスから受信する分散トレースペイロードを受け入れる。このメソッドを呼び出すと、上流のサービスからのトランザクションがこのトランザクションにリンクされます。 - -### 構文 - -```cs -void AcceptDistributedPayload(payload, transportType) -``` - -### パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- `payload` - - _ストリング_ - - 必要です。受信した分散型トレースのペイロードの文字列表現。 -
- `transportType` - - _TransportType_ - _enum_ - - おすすめされた。着信ペイロードのトランスポートを記述します (例: `http` )。 - - デフォルト`TransportType.Unknown` 。 -
- -### 使用上の注意 - -* [Distributed tracingが有効であること](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* ペイロードは、Base64エンコードされた文字列またはプレーンテキストの文字列です。 -* `AcceptDistributedTracePayload` `CreateDistributedTracePayload`がこのトランザクションに対して既に呼び出されている場合は無視されます。 - -### 例 - -```cs -//Obtain the information from the request object from the upstream caller. -//The method by which this information is obtain is specific to the transport -//type being used. For example, in an HttpRequest, this information is -//contained in the -header.KeyValuePair metadata = GetMetaDataFromRequest("requestPayload"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AcceptDistributedTracePayload(metadata.Value, TransportType.Queue); -``` - -## CreateDistributedTracePayload (廃止予定) [#createdistributedtracepayload] - - - この API は、.NET エージェント v9.0 以降では使用できません。代わりに [`InsertDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders) を使用してください。 - - -下流のシステムへの送信リクエストに含めるための分散型トレースペイロードを作成します。 - -### 構文 - -```cs -IDistributedTracePayload CreateDistributedTracePayload() -``` - -### リターンズ - -作成された分散トレース ペイロードへのアクセスを提供する`IDistributedTracePayload`を実装するオブジェクト。 - -### 使用上の注意 - -* [Distributed tracingが有効であること](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `CreateDistributedTracePayload` `AcceptDistributedTracePayload`がこのトランザクションに対して既に呼び出されている場合は無視されます。 - -### 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -IDistributedTracePayload payload = transaction.CreateDistributedTracePayload(); -``` - -## カスタムアトリビュートの追加 - -[属性](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute) の形で、現在のトランザクションにアプリケーションのコンテキスト情報を追加します。 - -このメソッドには、.NET エージェント バージョンと .NET エージェント API [バージョン 8.24.244.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) 以降が必要です。 非推奨の [`AddCustomParameter`](/docs/agents/net-agent/net-agent-api/add-custom-parameter)を置き換えました。 - -### 構文 - -```cs -ITransaction AddCustomAttribute(string key, object value) -``` - -### パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `key` - - _ストリング_ - - 報告される情報を特定するもの。名称としても知られている。 - - * 空のキーには対応していません。 - * キーは255バイトに制限されています。255バイト以上のキーを持つアトリビュートは無視されます。 -
- `value` - - _物体_ - - 報告される値です。 - - **注**: `null` 値は記録されません。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- .NETタイプ - - 価値がどのように表現されるか -
- `byte`、`Int16`、`Int32`、 `Int64` - - `sbyte`、`UInt16`、`UInt32`、 `UInt64` - - 整数値として。 -
- `float`、 `double` 、 `decimal` - - 10 進数ベースの数値。 -
- `string` - - 255バイトで切り捨てられた文字列。 - - 空の文字列にも対応しています。 -
- `bool` - - 正しいか間違っているか。 -
- `DateTime` - - ISO-8601フォーマットに従った文字列表現(タイムゾーン情報を含む)。 - - 例: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - 秒数を表す10進法の数値です。 -
- その他 - - `ToString()`メソッドが適用されます。カスタムタイプには`Object.ToString()`の実装が必要です。そうでない場合、例外がスローされます。 -
-
- -### リターンズ - -現在のトランザクションへの参照です。 - -### 使用上の注意 - -サポートされているデータタイプの詳細については、『 [Custom Attributes Guide』](/docs/agents/net-agent/attributes/custom-attributes) を参照してください。 - -### 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## カレントスパン - -現在実行中の[span](/docs/apm/agents/net-agent/net-agent-api/ispan/)へのアクセスを提供し、New Relic API内で[span固有のメソッド](/docs/apm/agents/net-agent/net-agent-api/ispan)を使用できるようにします。 - -### 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -ISpan currentSpan = transaction.CurrentSpan; -``` - -## SetUserId - -ユーザー ID を現在のトランザクションに関連付けます。 - -このメソッドには、.NET エージェントと .NET エージェント API [バージョン 10.9.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-1090) 以降が必要です。 - -### 構文 - -```cs -ITransaction SetUserId(string userId) -``` - -### パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `userId` - - _ストリング_ - - このトランザクションに関連付けられるユーザー ID。 - - * `null`、空および空白の値は無視されます。 -
- -### 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.SetUserId("BobSmith123"); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx deleted file mode 100644 index 91ebb70198b..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: NoticeError (.NETエージェントAPI) -type: apiDoc -shortDescription: エラーを通知し、オプションのカスタム属性とともに、New Relicに報告します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to capture exceptions or error messages and report them. -freshnessValidatedDate: never -translationType: machine ---- - -## 過負荷 [#overloads] - -エラーを通知し、オプションのカスタム属性とともに、New Relicに報告します。 - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception); -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected); -``` - -## 要件 [#requirements] - -このAPI呼び出しは、次のものと互換性があります。 - -* すべてのエージェントバージョン -* すべてのアプリタイプ - -## 説明 [#description] - -エラーに気づき、オプションのカスタム属性とともにNewRelicに報告してください。トランザクションごとに、エージェントは`NoticeError()`への最初の呼び出しからの例外と属性のみを保持します。実際の例外を渡すか、文字列を渡して任意のエラーメッセージをキャプチャできます。 - -このメソッドが[トランザクション](/docs/glossary/glossary/#transaction)内で呼び出された場合、エージェントは親トランザクション内で例外を報告します。トランザクションの外部で呼び出された場合、エージェントは[エラートレース](/docs/errors-inbox/errors-inbox)を作成し、NewRelicUIでエラーを`NewRelic.Api.Agent.NoticeError` API呼び出しとして分類します。トランザクションの外部で呼び出された場合、 `NoticeError()`呼び出しはアプリケーションのエラー率に影響しません。 - -エージェントは、トレースされたエラーにのみ属性を追加します。 NewRelicには送信されません。詳細については、 [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)を参照してください。 - -このAPIで報告されたエラーは、エージェント構成によって無視されるように構成された`404`などのHTTPステータスコードをもたらすトランザクション内で報告された場合でも、NewRelicに送信されます。詳細について[は、APMでのエラーの管理](/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected)に関するドキュメントを参照してください。 - -この呼び出しの使用方法の例については、以下のセクションを確認してください。 - -## NoticeError(例外) [#exception-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception) -``` - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$exception` - - _例外_ - - 必須。インストルメントする`Exception` 。スタックトレースの最初の10,000文字のみが保持されます。 -
- -## NoticeError(例外、IDictionary) [#exception-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$exception` - - _例外_ - - 必須。インストルメントする`Exception` 。スタックトレースの最初の10,000文字のみが保持されます。 -
- `$attributes` - - _IDictionary <TKey、TValue>_ - - エラーメッセージに注釈を付けるには、属性のキーと値のペアを指定します。`TKey`は文字列である必要があり、 `TValue`は文字列またはオブジェクトである可能性があります。 -
- -## NoticeError(String、IDictionary) [#string-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$error_message` - - _ストリング_ - - 必須。例外であるかのようにNewRelicに報告する文字列を指定します。このメソッドは、[エラーイベント](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events)と[エラートレース](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details)の両方を作成します。エラーイベントでは最初の1023文字のみが保持され、エラートレースではメッセージ全体が保持されます。 -
- `$attributes` - - _IDictionary <TKey、TValue>_ - - 必須(nullの場合もあります)。エラーメッセージに注釈を付けるには、属性のキーと値のペアを指定します。`TKey`は文字列である必要があり、 `TValue`は文字列またはオブジェクトである可能性があります。属性を送信しない場合は、 `null`を渡します。 - -
- -## NoticeError(String、IDictionary、bool) [#string-idictionary-bool-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$error_message` - - _ストリング_ - - 必須。例外であるかのようにNewRelicに報告する文字列を指定します。このメソッドは、[エラーイベント](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events)と[エラートレース](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details)の両方を作成します。エラーイベントでは最初の1023文字のみが保持され、エラートレースではメッセージ全体が保持されます。 -
- `$attributes` - - _IDictionary <TKey、TValue>_ - - 必須(nullの場合もあります)。エラーメッセージに注釈を付けるには、属性のキーと値のペアを指定します。`TKey`は文字列である必要があり、 `TValue`は文字列またはオブジェクトである可能性があります。属性を送信しない場合は、 `null`を渡します。 -
- `$is_expected` - - _bool_ - - Apdexのスコアやエラーレートに影響を与えないように、エラーを予想通りにマークします。 -
- -## カスタム属性を持たない例外を渡す [#exception-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError(ex); -} -``` - -## カスタム属性を持つ例外を渡す [#exception-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary() {{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError(ex, errorAttributes); -} -``` - -## カスタム属性を持つエラーメッセージ文字列を渡す [#string-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary{{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", errorAttributes); -} -``` - -## カスタム属性のないエラーメッセージ文字列を渡す [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null); -} -``` - -## エラーメッセージ文字列を渡し、期待通りのマークを付ける [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null, true); -} -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx deleted file mode 100644 index 34cd4c1aea6..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: RecordCustomEvent (.NETエージェントAPI) -type: apiDoc -shortDescription: 指定された名前と属性を持つカスタムイベントを記録します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to report custom event data to New Relic. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) -``` - -指定された名前と属性を持つカスタムイベントを記録します。 - -## 要件 - -エージェントのバージョンが4.6.29.0以上であること。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -指定された名前と属性で [カスタムイベント](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#event-data) を記録します。このイベントは [クエリビルダー](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) で照会できます。イベントが正しく記録されているかどうかを確認するには、 [ダッシュボード](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards) でデータを確認します。 - -関連するAPIコールについては、 [.NETエージェントAPIガイド](/docs/agents/net-agent/api-guides/guide-using-net-agent-api#custom-data) を参照してください。 - - - * たくさんのイベントを送信すると、エージェントのメモリオーバーヘッドが大きくなります。 - * また、最大イベント数に関わらず、1MB(10^6バイト)を超える投稿は記録されません。 - * カスタムイベントの属性数は64個に制限されています。 - * カスタム属性値の処理方法については、 [カスタム属性](/docs/agents/net-agent/attributes/custom-attributes) ガイドを参照してください。 - - -## パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `eventType` - - _ストリング_ - - 必須。 記録するイベント タイプの名前。 文字列が 255 文字を超えると、API 呼び出しがNew Relicに送信されません。 名前には英数字、アンダースコア`_` 、コロン`:`のみを含めることができます。 イベント タイプ名に関する追加の制限については、 [「予約語」](/docs/data-apis/custom-data/custom-events/data-requirements-limits-custom-event-data/#reserved-words)を参照してください。 -
- `attributeValues` - - _IEnumerable<string, object>_ - - 必須項目です。イベントをアノテーションするための属性のキー/バリューペアを指定します。 -
- -## 例 - -### レコード値 [#record-strings] - -```cs -var eventAttributes = new Dictionary() -{ -  {"foo", "bar"}, -  {"alice", "bob"}, -  {"age", 32}, -  {"height", 21.3f} -}; - -NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx deleted file mode 100644 index 87d644bc446..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordMetric(.NETエージェントAPI) -type: apiDoc -shortDescription: 指定された名前のカスタム メトリックを記録します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.RecordMetric(string $metric_name, single $metric_value) -``` - -指定された名前のカスタム メトリックを記録します。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -指定された名前で[カスタム メトリック](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics)を記録します。これらのカスタム メトリックを表示するには、 [クエリ ビルダー](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data)を使用してメトリックを検索し、カスタマイズ可能なグラフを作成します。[`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent)と[`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent)も参照してください。 - - - カスタム指標を作成するときは、名前を`Custom/`で始めます (例: `Custom/MyMetric` )。 - - -## パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$metric_name` - - _ストリング_ - - 必須項目です。記録するメトリックの名前です。最初の255文字のみが保持されます。 -
- `$metric_value` - - _シングル_ - - 必須です。メトリクスに記録する数量です。 -
- -## 例 - -### スリープ中のプロセスの応答時間を記録 [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordMetric("Custom/DEMO_Record_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx deleted file mode 100644 index 89bdb352f3d..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordResponseTimeMetric(.NETエージェントAPI) -type: apiDoc -shortDescription: 指定された名前と応答時間(ミリ秒)でカスタムメトリックを記録します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record response time as custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value) -``` - -指定された名前と応答時間(ミリ秒)でカスタムメトリックを記録します。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -[カスタム指標](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics)の応答時間をミリ秒単位で記録します。これらのカスタム メトリックを表示するには、 [クエリ ビルダー](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data)を使用してメトリックを検索し、カスタマイズ可能なグラフを作成します。[`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent)と[`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent)も参照してください。 - - - カスタム指標を作成するときは、名前を`Custom/`で始めます (例: `Custom/MyMetric` )。 - - -## パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$metric_name` - - _ストリング_ - - 必須です。記録する応答時間メトリックの名前です。最初の255文字のみが保持されます。 -
- `$metric_value` - - _Int64_ - - 必須です。記録する応答時間をミリ秒単位で指定します。 -
- -## 例 - -### スリープ中のプロセスの応答時間を記録 [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx deleted file mode 100644 index 6dd7fd8be65..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: SetApplicationName (.NETエージェントAPI) -type: apiDoc -shortDescription: データロールアップのアプリ名を設定します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to set the New Relic app name, which controls data rollup.' -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName(string $name[, string $name_2, string $name_3]) -``` - -データロールアップのアプリ名を設定します。 - -## 要件 - -エージェントのバージョン5.0.136.0以降。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -New Relic に報告するアプリケーション名を設定します。アプリケーションの命名に関する詳細は、 [Name your .NET application](/docs/agents/net-agent/installation-configuration/name-your-net-application) を参照してください。このメソッドは、アプリケーションの起動時に一度だけ呼び出されることを想定しています。 - - - アプリ名を更新すると、エージェントが再起動します。エージェントは、以前のアプリ名に関連する未報告のデータを破棄します。アプリケーションのライフサイクル中にアプリ名を何度も変更することは、データ損失の観点から推奨されません。 - - -## パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$name` - - _ストリング_ - - 必須項目です。プライマリアプリケーション名です。 -
- `$name_2` - - `$name_3` - - _ストリング_ - - 任意です。アプリのロールアップの2つ目と3つ目の名前。詳しくは、 [Use multiple names for an app](/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app) をご覧ください。 -
- -## 例 - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName("AppName1", "AppName2"); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx deleted file mode 100644 index 21bb943223a..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: SetTransactionUri (.NETエージェントAPI) -type: apiDoc -shortDescription: 現在のトランザクションのURIを設定します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the URI of a transaction (use with attribute-based custom instrumentation). -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionUri(Uri $uri) -``` - -現在のトランザクションのURIを設定します。 - -## 要件 - -[トランザクションの中で呼び出す必要があります](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 。 - -エージェントのバージョン6.16以上 - - - このメソッドは、 `Web`プロパティが`true`に設定された`Transaction`属性を使用して作成されたトランザクション内で使用された場合にのみ機能します。([アトリビュートを使用して計測する を](/docs/agents/net-agent/api-guides/net-agent-api-instrument-using-attributes)参照してください。)エージェントが自動的にサポートしないカスタムの Web ベースのフレームワークをサポートします。 - - -## 説明 - -現在のトランザクションのURIを設定します。 [このURIは、 ](/docs/agents/net-agent/attributes/net-agent-attributes)[トランザクショントレース](/docs/apm/transactions/transaction-traces/transaction-traces) と [トランザクションイベント](/docs/using-new-relic/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data) の 'request.uri' 属性に表示され、また、トランザクションの命名にも影響します。 - -同一トランザクション内でこのコールを複数回使用した場合、各コールが前のコールを上書きします。最後の呼び出しでURIが設定されます。 - -**注**: エージェント バージョン 8.18 以降、 `request.uri`属性の値は、API に渡される`System.Uri`オブジェクトの`Uri.AbsolutePath`プロパティの値に設定されます。 - -## パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$uri` - - _Uri_ - - このトランザクションのURIです。 -
- -## 例 - -```cs -var uri = new System.Uri("https://www.mydomain.com/path"); -NewRelic.Api.Agent.NewRelic.SetTransactionUri(uri); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx deleted file mode 100644 index 5655243cb65..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: SetUserParameters (.NETエージェント) -type: apiDoc -shortDescription: ユーザ関連のカスタム属性を作成します。AddCustomAttribute()はより柔軟性があります。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach user-related custom attributes to APM and browser events. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value) -``` - -ユーザー関連のカスタム属性を作成します。[`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)はより柔軟です。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -[トランザクションの中で呼び出す必要があります](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 。 - -## 説明 - - - この呼び出しでは、既存のキーに値を割り当てることしかできません。キーと値のペアをより柔軟に作成するには、 [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction)を使用します。 - - -ブラウザのページ ビュー (ユーザー名、アカウント名、製品名) に関連付けるユーザー関連の[カスタム属性](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)を定義します。値は既存のキー ( `user` 、 `account` 、および`product` ) に自動的に関連付けられ、親 APM トランザクションにアタッチされます。これらの属性をブラウザの[ PageView](/docs/agents/manage-apm-agents/agent-metrics/agent-attributes#destinations) イベントに[ 添付 (または「転送」) する こともできます。](/docs/insights/new-relic-insights/decorating-events/insights-custom-attributes#forwarding-attributes) - -## パラメーター - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$user_value` - - _ストリング_ - - 必須 (null の場合もあります)。このページ ビューに関連付ける名前またはユーザー名を指定します。この値は`user`キーに割り当てられます。 -
- `$account_value` - - _ストリング_ - - 必須 (null の場合もあります)。このページ ビューに関連付けるユーザー アカウントの名前を指定します。この値は`account`キーに割り当てられます。 -
- `$product_value` - - _ストリング_ - - 必須 (null の場合もあります)。このページ ビューに関連付ける製品の名前を指定します。この値は`product`キーに割り当てられます。 -
- -## 例 - -### 3つのユーザー属性を記録 [#report-three] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName"); -``` - -### 2つのユーザー属性と1つの空の属性を記録 [#report-two] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName"); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx deleted file mode 100644 index eb42eabc273..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: SetErrorGroupCallback (.NET エージェント API) -type: apiDoc -shortDescription: 属性データに基づいてエラー グループ名を決定するためのコールバック メソッドを提供する -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to provide a callback method for determining the error group name for an error, based on attribute data.' -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(Func, string> errorGroupCallback); -``` - -属性データの `IReadOnlyDictionary` を受け取り、エラー グループ名を返すコールバック メソッドを提供します。 - -## 要件 [#requirements] - -このAPI呼び出しは、次のものと互換性があります。 - -* エージェント バージョン >= 10.9.0 -* すべてのアプリタイプ - -## 説明 [#description] - -エージェントがエラー イベントとトレースのエラー グループ名を決定するために使用するコールバック メソッドを設定します。この名前は、エラー受信ボックスでエラーを論理グループにグループ化するために使用されます。 - -コールバック メソッドは、型 `IReadOnlyDictionary`の 1 つの引数を受け入れ、文字列 (エラー グループ名) を返す必要があります。 `IReadOnlyDictionary` は、カスタム属性を含む、各エラー イベントに関連付けられた [属性データ](/docs/apm/agents/manage-apm-agents/agent-data/agent-attributes/) のコレクションです。 - -各エラーで使用できる属性の正確なリストは、次の条件によって異なります。 - -* エラーを生成したアプリケーション コード -* エージェント構成設定 -* カスタム属性が追加されたかどうか - -ただし、次の属性は常に存在する必要があります。 - -* `error.class` -* `error.message` -* `stack_trace` -* `transactionName` -* `request.uri` -* `error.expected` - -エラーを論理エラー グループに割り当てることができない場合、エラー グループ名に空の文字列が返されることがあります。 - -## パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$callback` - - _'Func<IReadOnlyDictionary<string,object>,string>'_ - - 属性データに基づいてエラー グループ名を決定するためのコールバック。 -
- -## 例 - -エラー クラス名でエラーをグループ化します。 - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("error.class", out var errorClass)) - { - if (errorClass.ToString() == "System.ArgumentOutOfRangeException" || errorClass.ToString() == "System.ArgumentNullException") - { - errorGroupName = "ArgumentErrors"; - } - else - { - errorGroupName = "OtherErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` - -エラーをトランザクション名でグループ化します。 - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("transactionName", out var transactionName)) - { - if (transactionName.ToString().IndexOf("WebTransaction/MVC/Home") != -1) - { - errorGroupName = "HomeControllerErrors"; - } - else - { - errorGroupName = "OtherControllerErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx deleted file mode 100644 index 32fcd1287dc..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: SetLlmTokenCountingCallback (.NET エージェント API) -type: apiDoc -shortDescription: LLM完了のトークン数を決定するコールバックメソッドを提供する -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to provide a callback method that determines the token count for an LLM completion. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(Func callback); -``` - -トークン数を計算するコールバック メソッドを提供します。 - -## 要件 [#requirements] - -このAPI呼び出しは、次のものと互換性があります。 - -* エージェント バージョン >= 10.23.0 -* すべてのアプリタイプ - -## 説明 [#description] - -エージェントが LLM イベントのトークン数を決定するために使用するコールバック メソッドを設定します。 高セキュリティ モードの場合、またはコンテンツの記録が無効になっている場合は、このメソッドが呼び出され、LLM イベントのトークン数が決定されます。 - -コールバック メソッドは、 `string`型の 2 つの引数を受け入れ、整数を返す必要があります。 最初の文字列引数は LLM モデル名であり、2 番目の文字列引数は LLM への入力です。 コールバック メソッドは、LLM イベントのトークン数を返す必要があります。 0 以下の値は無視されます。 - -## パラメーター - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$callback` - - '\_Func\_' - - トークン数を決定するコールバック。 -
- -## 例 - -```cs -Func llmTokenCountingCallback = (modelName, modelInput) => { - - int tokenCount = 0; - // split the input string by spaces and count the tokens - if (!string.IsNullOrEmpty(modelInput)) - { - tokenCount = modelInput.Split(' ').Length; - } - - return tokenCount; -}; - -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(llmTokenCountingCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx deleted file mode 100644 index 20283b278fd..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: SetTransactionName (.NETエージェントAPI) -type: apiDoc -shortDescription: 現在のトランザクションの名前を設定します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the name of a transaction. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name) -``` - -現在のトランザクションの名前を設定します。 - -## 要件 - -すべてのAgentバージョンに対応しています。 - -[トランザクションの中で呼び出す必要があります](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 。 - -## 説明 - -現在のトランザクションの名前を設定します。このコールを使用する前に、 [メトリックのグループ化の問題の意味を理解していることを確認してください](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues) 。 - -同一トランザクション内でこのコールを複数回使用した場合、各コールが前のコールを上書きし、最後のコールが名前を設定します。 - - - トランザクション名の末尾に角かっこ`[suffix]`を使用しないでください。 New Relicは、名前から角かっこを自動的に削除します。代わりに、必要に応じて括弧`(suffix)`またはその他の記号を使用してください。 - - -URL、ページ タイトル、16 進値、セッション ID、および一意に識別可能な値などの一意の値は、トランザクションの名前付けに使用しないでください。代わりに、そのデータを[`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)呼び出しでカスタム パラメータとしてトランザクションに追加してください。 - - - 1000以上のユニークなトランザクション名を作成しないでください(例えば、可能な限りURLでの命名は避けてください)。これはチャートの使い勝手を悪くしますし、New Relic が設定しているアカウントごとのユニークなトランザクション名の数の制限に抵触する可能性があります。また、アプリケーションのパフォーマンスが低下する可能性があります。 - - -## パラメーター - - - - - - - - - - - - - - - - - - - - - - - -
- パラメータ - - 説明 -
- `$category` - - _ストリング_ - - 必須。さまざまなタイプのトランザクションを区別するために使用できる、このトランザクションのカテゴリ。デフォルトは**`Custom`**です。最初の 255 文字のみが保持されます。 -
- `$name` - - _ストリング_ - - 必須項目です。トランザクションの名前です。最初の255文字のみが保持されます。 -
- -## 例 - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction"); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx deleted file mode 100644 index 63c557ffc0c..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: StartAgent(.NETエージェントAPI) -type: apiDoc -shortDescription: エージェントがまだ開始されていない場合は、エージェントを開始します。通常は不要です。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to force the .NET agent to start, if it hasn''t been started already. Usually unnecessary, since the agent starts automatically.' -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent() -``` - -エージェントがまだ開始されていない場合は、エージェントを開始します。通常は不要です。 - -## 要件 - -エージェントのバージョン5.0.136.0以降。 - -すべてのアプリタイプに対応しています。 - -## 説明 - -エージェントがまだ開始されていない場合は、エージェントを開始します。[`autoStart`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-autoStart)を無効にしない限り、インストルメント化されたメソッドにヒットするとエージェントが自動的に開始されるため、通常、この呼び出しは不要です。[`SetApplicationName()`](/docs/agents/net-agent/net-agent-api/setapplicationname-net-agent)を使用する場合は、エージェントを開始する**前**にアプリ名を設定してください。 - - - [`syncStartup`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-syncStartup)または[`sendDataOnExit`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-sendDataOnExit)を有効にしない限り、このメソッドはエージェントを非同期的に開始します (つまり、アプリの起動をブロックしません)。 - - -## 例 - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx b/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx deleted file mode 100644 index d8e54547ccc..00000000000 --- a/src/i18n/content/jp/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: TraceMetadata(.NETエージェントAPI) -type: apiDoc -shortDescription: トレースをサポートするために使用されている現在の実行環境のプロパティを返します。 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 構文 - -```cs -NewRelic.Api.Agent.TraceMetadata; -``` - -トレースをサポートするために使用されている現在の実行環境のプロパティを返します。 - -## 要件 - -Agentバージョン8.19以上。 - -すべてのアプリタイプに対応しています。 - -[意味のある値を得るためには、Distributed tracingを有効にする必要があります](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) 。 - -## 説明 - -以下のプロパティへのアクセスを提供します。 - -### プロパティ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 名前 - - 説明 -
- `TraceId` - - 現在実行中のトレースを表す文字列を返します。トレース ID が利用できない場合、または分散トレースが無効になっている場合、値は`string.Empty`になります。 -
- `SpanId` - - 現在実行中のスパンを表す文字列を返します。スパン ID を使用できない場合、または分散トレースが無効になっている場合、値は`string.Empty`になります。 -
- `IsSampled` - - 現在のトレースが含めるためにサンプリングされている場合は`true`を返し、サンプリングされている場合は`false`を返します。 -
- -## 例 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -TraceMetadata traceMetadata = agent.TraceMetadata; -string traceId = traceMetadata.TraceId; -string spanId = traceMetadata.SpanId; -bool isSampled = traceMetadata.IsSampled; -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx deleted file mode 100644 index 9d6ea368d49..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: DisableBrowserMonitoring(.NET 에이전트 API) -type: apiDoc -shortDescription: 특정 페이지에서 브라우저 모니터링 스니펫의 자동 삽입을 비활성화합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to disable browser monitoring on specific pages or views. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override]) -``` - -특정 페이지에서 브라우저 모니터링 스니펫의 자동 삽입을 비활성화합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -[트랜잭션](/docs/glossary/glossary/#transaction) 내에서 호출되어야 합니다. - -## 설명 - -**자동** 주입을 비활성화하려면 이 호출을 추가하세요. [](/docs/browser/new-relic-browser/getting-started/new-relic-browser)특정 페이지의 스크립트. 선택적 재정의를 추가하여 수동 및 자동 주입을 **모두** 비활성화할 수도 있습니다. 두 경우 모두 이 API 호출을 브라우저를 비활성화하려는 보기의 상단에 최대한 가깝게 배치하세요. - - - 페이지에 브라우저 스크립트를 **추가** 하는 [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent) 를 비교하십시오. - - -## 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$override` - - _부울_ - - 선택 과목. `true` 인 경우 브라우저 스크립트의 모든 삽입을 비활성화합니다. 이 플래그는 수동 및 자동 주입 모두에 영향을 줍니다. 이것은 또한 [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent) 호출을 재정의합니다. -
- -## 예 - -### 자동 주입 비활성화 [#automatic-only] - -이 예에서는 스니펫의 **자동** 삽입만 비활성화합니다. - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(); -``` - -### 자동 및 수동 주입 비활성화 [#disable-both] - -이 예에서는 스니펫의 자동 및 수동 삽입을 **모두** 비활성화합니다. - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getagent.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getagent.mdx deleted file mode 100644 index 07f285982ad..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getagent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: 에이전트 가져오기 -type: apiDoc -shortDescription: IAgent 인터페이스를 통해 에이전트에 액세스합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.GetAgent() -``` - -`IAgent` 인터페이스를 통해 에이전트에 액세스합니다. - -## 요구 사항 - -에이전트 버전 8.9 이상. - -모든 앱 유형과 호환됩니다. - -## 설명 - -[`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) 인터페이스를 통해 에이전트 API 메서드에 액세스합니다. - -## 반환 값 - -[IAgent API](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) 에 대한 액세스를 제공하는 [IAgent](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) 의 구현입니다. - -## 예 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx deleted file mode 100644 index 5db6ec7939b..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: GetBrowserTimingHeader(.NET 에이전트 API) -type: apiDoc -shortDescription: 최종 사용자 브라우저를 계측하기 위해 브라우저 모니터링 HTML 스니펫을 생성합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to instrument a webpage with browser. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(); -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(string nonce); -``` - -최종 사용자 브라우저를 계측하기 위해 브라우저 모니터링 HTML 스니펫을 생성합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -[트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 내에서 호출되어야 합니다. - -## 설명 - -활성화하는 데 사용되는 HTML 조각을 반환합니다. [](/docs/browser/new-relic-browser/getting-started/new-relic-browser). 이 코드 조각은 브라우저에 작은 JavaScript 파일을 가져오고 페이지 타이머를 시작하도록 지시합니다. 그런 다음 반환된 코드 조각을 HTML 웹페이지의 헤더에 삽입할 수 있습니다. 자세한 내용은 [브라우저 모니터링에 앱 추가를](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser) 참조하세요. - - - 페이지에서 브라우저 스크립트를 **비활성화** 하는 [`DisableBrowserMonitoring()`](/docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent) 를 비교하십시오. - - -## 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `nonce` - - _끈_ - - Content-Security-Policy 정책에서 사용하는 요청별 암호화 논스입니다. -
- - - 이 API 호출에는 보안 허용 목록에 대한 업데이트가 필요합니다. CSP(콘텐츠 보안 정책) 고려 사항에 대한 자세한 내용은 [브라우저 모니터링 호환성 및 요구 사항](/docs/browser/new-relic-browser/getting-started/compatibility-requirements-browser-monitoring) 페이지를 참조하세요. - - -## 반환 값 - -페이지 헤더에 포함할 HTML 문자열입니다. - -## 예 - -### ASPX와 함께 [#aspx] - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%> - ... - - - ... -``` - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")%> - ... - - - ... -``` - -### 면도기로 [#razor] - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` - -### 블레이저와 함께 [#blazor] - - - 에이전트가 웹 어셈블리 코드를 계측할 수 없기 때문에 Blazor 웹 어셈블리에는 이 API가 지원되지 않습니다. 다음 예제는 Blazor Server 애플리케이션에만 해당됩니다. Blazor 웹 어셈블리 페이지에 브라우저 에이전트를 추가하려면 [복사-붙여넣기 방법을](/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste) 사용하세요. - - - - 이 API는 `.razor` 페이지의 `` 요소에 배치할 수 없습니다. 대신 `_Layout.cshtml` 또는 이에 상응하는 레이아웃 파일에서 호출해야 합니다. - - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx deleted file mode 100644 index 7181135d5e4..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: GetLinkingMetadata(.NET 에이전트 API) -type: apiDoc -shortDescription: 추적 또는 엔터티를 연결하는 데 사용할 수 있는 키/값 쌍을 반환합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.GetLinkingMetadata(); -``` - -추적 또는 엔터티를 연결하는 데 사용할 수 있는 키/값 쌍을 반환합니다. - -## 요구 사항 - -에이전트 버전 8.19 이상. - -모든 앱 유형과 호환됩니다. - -## 설명 - -반환된 키/값 쌍의 사전에는 APM 제품의 추적 및 엔터티를 연결하는 데 사용되는 항목이 포함됩니다. 의미 있는 값을 가진 항목만 포함합니다. 예를 들어 분산 추적이 비활성화된 경우 `trace.id` 은 포함되지 않습니다. - -## 반환 값 - -`Dictionary ()` 반환된 항목에는 APM 제품의 추적 및 엔터티를 연결하는 데 사용되는 항목이 포함됩니다. - -## 예 - -```cs -NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -var linkingMetadata = Agent.GetLinkingMetadata(); -foreach (KeyValuePair kvp in linkingMetadata) -{ - Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); -} -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx deleted file mode 100644 index a85cf2137df..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx +++ /dev/null @@ -1,326 +0,0 @@ ---- -title: .NET 에이전트 API 사용 가이드 -tags: - - Agents - - NET agent - - API guides -metaDescription: 'A goal-focused guide to the New Relic .NET agent API, with links to relevant sections of the complete API documentation.' -freshnessValidatedDate: never -translationType: machine ---- - -New Relic의 .NET 에이전트에는 에이전트의 표준 기능을 확장할 수 있는 [API](/docs/agents/net-agent/net-agent-api) 가 포함되어 있습니다. 예를 들어 다음을 위해 .NET 에이전트 API를 사용할 수 있습니다. - -* 앱 이름 사용자 지정 -* 사용자 정의 트랜잭션 매개변수 생성 -* 맞춤 오류 및 측정항목 보고 - -[구성 설정](/docs/agents/net-agent/configuration/net-agent-configuration) 을 조정하거나 [사용자 지정 계측](/docs/agents/net-agent/custom-instrumentation/introduction-net-custom-instrumentation) 을 사용하여 .NET 에이전트의 일부 기본 동작을 사용자 지정할 수도 있습니다. - -## 요구 사항 - - - 2021년 9월부터 .NET용 API, 구성 옵션 및 설치 옵션의 일부가 새로운 방법으로 대체됩니다. 이 전환을 쉽게 준비하는 방법을 포함한 자세한 내용은 [지원 포럼 게시물](https://discuss.newrelic.com/t/important-upcoming-changes-to-support-and-capabilities-across-browser-node-js-agent-query-builder-net-agent-apm-errors-distributed-tracing/153373) 을 참조하십시오. - - -.NET 에이전트 API를 사용하려면: - -1. [최신 .NET 에이전트 릴리스](/docs/release-notes/agent-release-notes/net-release-notes) 가 있는지 확인하십시오. - -2. 프로젝트의 에이전트에 대한 참조를 추가합니다. - - * 프로젝트에 `NewRelic.Api.Agent.dll` 에 대한 참조를 추가합니다. - - 또는 - - * [NuGet 패키지 라이브러리](https://www.nuget.org/packages/NewRelic.Agent.Api/) 에서 API 패키지를 보고 다운로드합니다. - -## 트랜잭션으로 코드의 누락된 섹션 계측 [#creating-transactions] - -앱을 계측하기 위해 New Relic은 코드를 통한 각 경로를 자체 [트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 으로 분리합니다. 새 유물 시간(또는 "계측기")은 이러한 트랜잭션의 상위 메서드로 앱의 전체 성능을 측정하고 추가 세부 정보를 위해 장기 실행 트랜잭션에서 [트랜잭션 추적](/docs/apm/transactions/transaction-traces/introduction-transaction-traces) 을 수집합니다. - -New Relic이 코드의 특정 부분을 전혀 계측하지 않을 때 다음 방법을 사용하십시오. - - - - - - - - - - - - - - - - - - - - - - - -
- 원하는 경우... - - 이게 ... -
- 트랜잭션이 New Relic에 보고되는 것을 방지 - - 트랜잭션을 무시하려면 [`IgnoreTransaction()`](/docs/agents/net-agent/net-agent-api/ignore-transaction) 또는 [XML 파일](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation) 을 사용하세요. -
- 존재하지 않는 트랜잭션 생성 - - [속성](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) 또는 [XML 파일](/docs/agents/net-agent/instrumentation/net-custom-transactions) 을 사용하여 새 트랜잭션을 만듭니다. -
- -## 세그먼트를 사용한 시간별 방법 [#segments] - -New Relic UI에 트랜잭션이 이미 표시되어 있지만 해당 트랜잭션 중에 호출된 특정 메서드에 대한 데이터가 충분하지 않은 경우 세그먼트를 생성하여 개별 메서드의 시간을 더 자세히 확인할 수 있습니다. 예를 들어 복잡한 논리로 특히 중요한 방법의 시간을 정하고 싶을 수 있습니다. - -기존 트랜잭션 내에서 메서드를 계측하려면 [속성을 통한 사용자 지정 계측](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) 또는 [XML을 통해 트랜잭션에 세부 정보 추가](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net) 를 참조하세요. - -## 트랜잭션의 메타데이터 향상 [#metadata] - -때때로 대상으로 하는 코드가 New Relic UI에 표시되지만 메서드의 일부 세부 정보는 유용하지 않습니다. 예를 들어: - -* 기본 이름은 도움이 되지 않을 수 있습니다. ( [측정항목 그룹화 문제](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues#video) 를 일으킬 수 있습니다.) -* 대시보드에서 필터링할 수 있도록 거래에 [사용자 정의 속성을](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) 추가하려고 합니다. - -New Relic이 New Relic UI에 이미 표시된 트랜잭션을 계측하는 방법을 변경하려면 다음 방법을 사용하십시오. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 원하는 경우... - - 이게 ... -
- 트랜잭션 이름 변경 - - [`SetTransactionName()`](/docs/agents/net-agent/net-agent-api/set-transaction-name) 또는 [XML 파일을](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#name-transactions) 사용합니다. -
- 거래가 [Apdex](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#apdex) 점수에 영향을 미치지 않도록 방지 - - [`IgnoreApdex()`](/docs/agents/net-agent/net-agent-api/ignore-apdex) 을(를) 사용합니다. -
- 거래에 메타데이터(예: 고객의 계정 이름 또는 구독 수준)를 추가합니다. - - [사용자 정의 속성](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes) 을 사용하십시오.[`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction#addcustomattribute) 을(를) 참조하세요. -
- -## 관련 로그 보기 [#logs] - -애플리케이션의 오류 및 추적 컨텍스트 내에서 직접 로그를 보려면 다음 API 호출을 사용하여 로그에 주석을 추가하십시오. - -* [`TraceMetadata`](/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0/) -* [`GetLinkingMetadata`](/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api/) - -로그 데이터와 다른 원격 측정 데이터의 상관 관계에 대한 자세한 내용은 [컨텍스트 문서의 로그를](/docs/logs/logs-context/net-configure-logs-context-all/) 참조하세요. - -## 계기 비동기 작업 [#async] - -지원되는 프레임워크의 경우 .NET 에이전트는 일반적으로 비동기 작업을 감지하고 올바르게 계측합니다. 그러나 앱이 다른 프레임워크를 사용하거나 [기본 비동기 계측](/docs/agents/net-agent/features/async-support-net) 이 정확하지 않은 경우 비동기 작업을 명시적으로 연결할 수 있습니다. - - - - - - - - - - - - - - - - - - - - - - - -
- 원하는 경우... - - 이게 ... -
- New Relic이 이미 계측하고 있는 비동기 메서드 추적 - - [XML 파일을 사용하여](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) IIS 앱에서 비동기 메서드를 계측합니다. 문제 해결 팁은 [비동기 측정항목 누락](/docs/agents/net-agent/troubleshooting/missing-async-metrics) 을 참조하세요. -
- New Relic이 계측하지 않는 비동기 메서드 추적 - - [XML 파일을 사용하여](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) IIS 앱에서 비동기 메서드를 계측합니다. 문제 해결 팁은 [비동기 측정항목 누락](/docs/agents/net-agent/troubleshooting/missing-async-metrics) 을 참조하세요. -
- -## 외부 서비스에 대한 호출 보기 [#externals] - -.NET 에이전트 버전 8.9 이상의 경우 다음 [분산 추적 페이로드 API를](/docs/apm/agents/net-agent/configuration/distributed-tracing-net-agent/#manual-instrumentation) 사용하여 분산 [추적](/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing) 에서 서로 자동으로 연결되지 않는 New Relic 모니터링 서비스 간에 분산 추적 컨텍스트를 수동으로 전달할 수 있습니다. - - - - - - - - - - - - - - - - - - - - - - - -
- 원하는 경우... - - 이게 ... -
- 외부 애플리케이션 또는 데이터베이스에 대한 발신 요청 계측 - - [`InsertDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders) 사용하여 발신 요청에 분산 추적 페이로드를 추가합니다. -
- 들어오는 요청을 요청의 발신자와 연결하여 추적 [범위](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#span) 를 완료합니다. - - [`AcceptDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders) 사용하여 들어오는 요청에서 페이로드를 받습니다. -
- -.NET 에이전트 버전 8.9 미만의 경우 [애플리케이션 간 추적](/docs/apm/transactions/cross-application-traces/introduction-cross-application-traces) 을 사용하십시오. - -## 오류 수집 또는 무시 [#errors] - -일반적으로 .NET 에이전트는 오류를 자동으로 감지합니다. 그러나 에이전트를 사용하여 수동으로 오류를 표시할 수 있습니다. [오류를 무시할](/docs/apm/applications-menu/error-analytics/ignoring-errors-new-relic-apm) 수도 있습니다. - - - - - - - - - - - - - - - - - - - - - - - -
- 원하는 경우... - - 이게 ... -
- .NET 에이전트가 자동으로 보고하지 않는 오류 보고 - - [`NoticeError()`](/docs/agents/net-agent/net-agent-api/notice-error) 을(를) 사용합니다. -
- 오류를 캡처하거나 .NET 에이전트가 오류를 보고하지 못하도록 방지 - - [.NET 에이전트 구성 파일](/docs/agents/net-agent/configuration/net-agent-configuration#error_collector) 을 사용합니다. -
- -## 앱에서 맞춤 이벤트 및 측정항목 데이터 보내기 [#custom-data] - -APM에는 임의의 사용자 지정 데이터를 기록하는 여러 방법이 포함되어 있습니다. New Relic 데이터 유형에 대한 설명은 [데이터 수집](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data) 을 참조하십시오. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 원하는 경우... - - 이게 ... -
- 대시보드에서 분석할 수 있도록 이벤트에 대한 데이터 보내기 - - [맞춤 이벤트](/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents#net-att) 를 만듭니다. [`RecordCustomEvent()`](/docs/agents/net-agent/net-agent-api/record-custom-event) 을(를) 참조하세요. -
- 대시보드 또는 오류 분석에서 이벤트를 필터링하고 패싯하기 위해 메타데이터로 이벤트에 태그 지정 - - [사용자 정의 속성](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes) 을 추가합니다. .NET 에이전트 속성 및 속성 [활성화 및 비활성화](/docs/agents/net-agent/attributes/enable-disable-attributes-net) 를 참조하십시오. -
- 맞춤 실적 데이터 보고 - - [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/record-metric) 을 사용하여 [맞춤 측정항목](/docs/agents/manage-apm-agents/agent-data/collect-custom-metrics) 을 만듭니다. 데이터를 보려면 [쿼리 작성기](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) 를 사용하세요. -
- -## 브라우저 모니터링 에이전트 제어 [#browser] - -일반적으로 에이전트는 페이지에 자동으로 추가되거나 JavaScript 스니펫을 복사하여 붙여넣어 배포됩니다. 이러한 권장 방법에 대한 자세한 내용은 [브라우저 모니터링에 앱 추가를](/docs/browser/new-relic-browser/installation-configuration/add-apps-new-relic-browser) 참조하세요. - -그러나 APM 에이전트 API 호출을 통해 브라우저 에이전트를 제어할 수도 있습니다. 자세한 내용은 [브라우저 모니터링 및 .NET 에이전트](/docs/agents/net-agent/instrumentation-features/new-relic-browser-net-agent) 를 참조하십시오. \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/iagent.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/iagent.mdx deleted file mode 100644 index 3954acb537d..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/iagent.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: IA에이전트 -type: apiDoc -shortDescription: 현재 실행 중인 트랜잭션과 같은 에이전트 아티팩트 및 메서드에 대한 액세스를 제공합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -public interface IAgent -``` - -현재 실행 중인 트랜잭션과 같은 에이전트 아티팩트 및 메서드에 대한 액세스를 제공합니다. - -## 요구 사항 - -에이전트 버전 8.9 이상. - -모든 앱 유형과 호환됩니다. - -## 설명 - -현재 실행 중인 트랜잭션과 같은 에이전트 아티팩트 및 메서드에 대한 액세스를 제공합니다. `IAgent` 에 대한 참조를 얻으려면 [`GetAgent`](/docs/agents/net-agent/net-agent-api/getagent) 을 사용합니다. - -### 속성 - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- 현재 트랜잭션 - - [ITransaction](/docs/agents/net-agent/net-agent-api/itransaction) 인터페이스를 통해 현재 실행 중인 트랜잭션에 대한 액세스를 제공하는 속성입니다. [트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 내에서 호출되어야 합니다. -
- 현재 범위 - - [ISpan](/docs/agents/net-agent/net-agent-api/iSpan) 인터페이스를 통해 현재 실행 중인 범위에 대한 액세스를 제공하는 속성입니다. -
- -## 예 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx deleted file mode 100644 index f7da13b957c..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: IgnoreApdex(.NET 에이전트 API) -type: apiDoc -shortDescription: Apdex를 계산할 때 현재 트랜잭션을 무시합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction when calculating your app's overall Apdex score. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex() -``` - -Apdex를 계산할 때 현재 트랜잭션을 무시합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -## 설명 - -[Apdex 점수](/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction) 를 계산할 때 현재 트랜잭션을 무시합니다. 이는 Apdex 점수를 왜곡할 수 있는 매우 짧거나 매우 긴 트랜잭션(예: 파일 다운로드)이 있는 경우에 유용합니다. - -## 예 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex(); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx deleted file mode 100644 index 5cc2bda6d29..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: IgnoreTransaction(.NET 에이전트 API) -type: apiDoc -shortDescription: 현재 트랜잭션을 계측하지 마십시오. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction entirely. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction() -``` - -현재 트랜잭션을 계측하지 마십시오. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -[트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 내에서 호출되어야 합니다. - -## 설명 - -현재 트랜잭션을 무시합니다. - - - [사용자 정의 계측 XML 파일을 통해](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation) 트랜잭션을 무시할 수도 있습니다. - - -## 예 - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction(); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx deleted file mode 100644 index ac034e3c227..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: IncrementCounter(.NET 에이전트 API) -type: apiDoc -shortDescription: 맞춤 측정항목에 대한 카운터를 1씩 증가시킵니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to increment the value of a custom metric. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name) -``` - -맞춤 측정항목에 대한 카운터를 1씩 증가시킵니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -모든 앱 유형과 호환됩니다. - -## 설명 - -[사용자 정의 메트릭](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) 에 대한 카운터를 1만큼 증가시키십시오. 이러한 사용자 정의 메트릭을 보려면 [쿼리 빌더](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) 를 사용하여 메트릭을 검색하고 사용자 정의 가능한 차트를 만드십시오. [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent) 및 [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent) 도 참조하십시오. - - - 맞춤 측정항목을 만들 때 `Custom/` 로 이름을 시작합니다(예: `Custom/MyMetric` ). 이름 지정에 대한 자세한 내용은 [사용자 정의 메트릭 수집](/docs/apm/agents/manage-apm-agents/agent-data/collect-custom-metrics/) 을 참조하십시오. - - -## 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$metric_name` - - _끈_ - - 필수의. 증가시킬 메트릭의 이름입니다. -
- -## 예 - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric"); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ispan.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ispan.mdx deleted file mode 100644 index c605fec5219..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/ispan.mdx +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: 이스판 -type: apiDoc -shortDescription: New Relic API의 범위별 메서드에 대한 액세스를 제공합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -Public interface ISpan -``` - -New Relic API의 범위별 메서드에 대한 액세스를 제공합니다. - -## 설명 - -New Relic .NET 에이전트 API의 범위별 메서드에 대한 액세스를 제공합니다. `ISpan` 에 대한 참조를 얻으려면 다음을 사용하십시오. - -* [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) 의 `CurrentSpan` 속성(권장). -* [`ITransaction`](/docs/agents/net-agent/net-agent-api/itransaction) 의 `CurrentSpan` 속성. - -이 섹션에는 `ISpan` 메서드에 대한 설명과 매개변수가 포함되어 있습니다. - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- [`AddCustomAttribute`](#addcustomattribute) - - 애플리케이션의 컨텍스트 정보를 속성 형식으로 현재 범위에 추가합니다. -
- [`SetName`](#setname) - - New Relic에 보고될 현재 스팬/세그먼트/메트릭의 이름을 변경합니다. -
- -## 사용자 정의 속성 추가 [#addcustomattribute] - -[속성](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute) 형식으로 현재 범위에 애플리케이션에 대한 컨텍스트 정보를 추가합니다. - -이 방법을 사용하려면 .NET 에이전트 버전 및 .NET 에이전트 API [버전 8.25](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) 이상이 필요합니다. - -### 통사론 - -```cs -ISpan AddCustomAttribute(string key, object value) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `key` - - _끈_ - - 보고되는 정보를 식별합니다. 이름으로도 알려져 있습니다. - - * 빈 키는 지원되지 않습니다. - * 키는 255바이트로 제한됩니다. 255바이트보다 큰 키가 있는 속성은 무시됩니다. -
- `value` - - _물체_ - - 보고되는 값입니다. - - **참고**: `null` 값은 기록되지 않습니다. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- .NET 유형 - - 가치가 표현되는 방식 -
- `byte`, `Int16` , `Int32` , `Int64` - - `sbyte`, `UInt16` , `UInt32` , `UInt64` - - 적분 값으로. -
- `float`, `double` , `decimal` - - 10진수 기반 숫자입니다. -
- `string` - - 255바이트 이후에 잘린 문자열입니다. - - 빈 문자열이 지원됩니다. -
- `bool` - - 참 또는 거짓. -
- `DateTime` - - 표준 시간대 정보를 포함하여 ISO-8601 형식을 따르는 문자열 표현: - - 예시: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - 초 수를 나타내는 10진수 기반 숫자입니다. -
- 다른 모든 것 - - `ToString()` 메서드가 적용됩니다. 사용자 정의 유형에는 `Object.ToString()` 구현이 있어야 하며 그렇지 않으면 예외가 발생합니다. -
-
- -### 보고 - -현재 범위에 대한 참조입니다. - -### 사용 고려 사항 - -지원되는 데이터 유형에 대한 자세한 내용은 [사용자 정의 속성 가이드](/docs/agents/net-agent/attributes/custom-attributes) 를 참조하십시오. - -## 예 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ISpan currentSpan = agent.CurrentSpan; - -currentSpan - .AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## 세트 이름 [#setname] - -New Relic에 보고될 현재 세그먼트/스팬의 이름을 변경합니다. 사용자 지정 계측으로 인한 세그먼트/스팬의 경우 New Relic에 보고된 메트릭 이름도 변경됩니다. - -이 방법을 사용하려면 .NET 에이전트 버전 및 .NET 에이전트 API 버전 10.1.0이 필요합니다. 또는 더 높게. - -### 통사론 - -```cs -ISpan SetName(string name) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `name` - - _끈_ - - 범위/세그먼트의 새 이름입니다. -
- -### 보고 - -현재 범위에 대한 참조입니다. - -## 예 - -```cs -[Trace] -public void MyTracedMethod() -{ - IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); - ISpan currentSpan = agent.CurrentSpan; - - currentSpan.SetName("MyCustomName"); -} -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx deleted file mode 100644 index 0c9dee56736..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx +++ /dev/null @@ -1,604 +0,0 @@ ---- -title: I트랜잭션 -type: apiDoc -shortDescription: New Relic API의 트랜잭션별 메서드에 대한 액세스를 제공합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -public interface ITransaction -``` - -New Relic API의 트랜잭션별 메서드에 대한 액세스를 제공합니다. - -## 설명 - -New Relic .NET 에이전트 API의 트랜잭션별 메서드에 대한 액세스를 제공합니다. `ITransaction` 에 대한 참조를 얻으려면 { [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) }에서 사용 가능한 현재 트랜잭션 메소드를 사용하십시오. - -다음 방법은 `ITransaction`에서 사용할 수 있습니다. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- [`AcceptDistributedTraceHeaders`](#acceptdistributedtraceheaders) - - 다른 서비스에서 들어오는 추적 컨텍스트 헤더를 수락합니다. -
- [`InsertDistributedTraceHeaders`](#insertdistributedtraceheaders) - - 나가는 요청에 추적 컨텍스트 헤더를 추가합니다. -
- [`AcceptDistributedTracePayload` (구식)](#acceptdistributedtracepayload) - - 다른 서비스에서 들어오는 분산 추적 페이로드를 수락합니다. -
- [`CreateDistributedTracePayload` (구식)](#createdistributedtracepayload) - - 나가는 요청에 포함할 분산 추적 페이로드를 만듭니다. -
- [`AddCustomAttribute`](#addcustomattribute) - - 애플리케이션의 컨텍스트 정보를 속성 형식으로 현재 트랜잭션에 추가합니다. -
- [`CurrentSpan`](#currentspan) - - 현재 실행 중인 [범위](/docs/agents/net-agent/net-agent-api/ispan) 에 대한 액세스를 제공합니다. 이는 New Relic API의 범위별 메서드에 대한 액세스를 제공합니다. -
- [`SetUserId`](#setuserid) - - 사용자 ID를 현재 트랜잭션에 연결합니다. -
- -## AcceptDistributedTraceHeaders - -`ITransaction.AcceptDistributedTraceHeaders` 분산 추적에 포함하기 위해 호출된 서비스를 계측하는 데 사용됩니다. [`InsertDistributedTraceHeaders`](/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#transaction-handle-insertDistributedTraceHeaders) 에서 생성하거나 다른 W3C 추적 컨텍스트 호환 추적 프로그램에서 생성한 페이로드를 수락하여 추적의 범위를 연결합니다. 이 메서드는 들어오는 요청의 헤더를 수락하고 W3C 추적 컨텍스트 헤더를 찾고 찾지 못하면 New Relic 분산 추적 헤더로 대체합니다. 이 메서드는 New Relic 분산 추적 페이로드만 처리하는 더 이상 사용되지 않는 [`AcceptDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#acceptdistributedtracepayload) 메서드를 대체합니다. - -### 통사론 - -```cs -void AcceptDistributedTraceHeaders(carrier, getter, transportType) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- `carrier` - - _<티>_ - - 필수의. 들어오는 추적 컨텍스트 헤더의 소스입니다. -
- `getter` - - _Func<T, 문자열, IEnumerable<문자열>>_ - - 필수의. 캐리어에서 헤더 데이터를 추출하는 호출자 정의 함수. -
- `transportType` - - _TransportType 열거형_ - - 필수의. 수신 페이로드의 전송을 설명합니다(예: `TransportType.HTTP` ). -
- -### 사용 고려 사항 - -* [분산 추적을 활성화해야 합니다](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) . -* `AcceptDistributedTraceHeaders` 이 트랜잭션에 대해 `InsertDistributedTraceHeaders` 또는 `AcceptDistributedTraceHeaders` 이(가) 이미 호출된 경우 무시됩니다. - -### 예시 - -```cs -HttpContext httpContext = HttpContext.Current; -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -currentTransaction.AcceptDistributedTraceHeaders(httpContext, Getter, TransportType.HTTP); -IEnumerable Getter(HttpContext carrier, string key) -{ - string value = carrier.Request.Headers[key]; - return value == null ? null : new string[] { value }; -} -``` - -## InsertDistributedTraceHeaders - -`ITransaction.InsertDistributedTraceHeaders` 분산 추적을 구현하는 데 사용됩니다. W3C Trace Context 헤더와 New Relic Distributed Trace 헤더를 추가하여 전달되는 캐리어 개체를 수정합니다. New Relic 헤더는 구성에서 `` 으로 비활성화할 수 있습니다. 이 메서드는 New Relic Distributed Trace 페이로드만 생성하는 더 이상 사용되지 않는 [`CreateDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#createdistributedtracepayload) 메서드를 대체합니다. - -### 통사론 - -```cs -void InsertDistributedTraceHeaders(carrier, setter) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- `carrier` - - _<티>_ - - 필수의. Trace Context 헤더가 삽입되는 컨테이너.. -
- `setter` - - _액션<T, 문자열, 문자열>_ - - 필수의. 헤더 데이터를 캐리어에 삽입하기 위한 호출자 정의 작업입니다. -
- -### 사용 고려 사항 - -* [분산 추적을 활성화해야 합니다](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) . - -### 예시 - -```cs -HttpWebRequest requestMessage = (HttpWebRequest)WebRequest.Create("https://remote-address"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -var setter = new Action((carrier, key, value) => { carrier.Headers?.Set(key, value); }); -currentTransaction.InsertDistributedTraceHeaders(requestMessage, setter); -``` - -## AcceptDistributedTracePayload [#acceptdistributedtracepayload] - - - 이 API는 .NET 에이전트 v9.0 이상에서 사용할 수 없습니다. 대신 [`AcceptDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders) 을(를) 사용하십시오. - - -업스트림 서비스에서 들어오는 분산 추적 페이로드를 수락합니다. 이 메서드를 호출하면 업스트림 서비스의 트랜잭션이 이 트랜잭션으로 연결됩니다. - -### 통사론 - -```cs -void AcceptDistributedPayload(payload, transportType) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- `payload` - - _끈_ - - 필수의. 들어오는 분산 추적 페이로드의 문자열 표현입니다. -
- `transportType` - - _전송 유형_ - _열거_ - - 추천. 수신 페이로드의 전송을 설명합니다(예: `http` ). - - 기본값 `TransportType.Unknown` . -
- -### 사용 고려 사항 - -* [분산 추적을 활성화해야 합니다](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) . -* 페이로드는 Base64 인코딩 또는 일반 텍스트 문자열일 수 있습니다. -* `AcceptDistributedTracePayload` 이 트랜잭션에 대해 `CreateDistributedTracePayload` 이(가) 이미 호출된 경우 무시됩니다. - -### 예시 - -```cs -//Obtain the information from the request object from the upstream caller. -//The method by which this information is obtain is specific to the transport -//type being used. For example, in an HttpRequest, this information is -//contained in the -header.KeyValuePair metadata = GetMetaDataFromRequest("requestPayload"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AcceptDistributedTracePayload(metadata.Value, TransportType.Queue); -``` - -## CreateDistributedTracePayload(구식) [#createdistributedtracepayload] - - - 이 API는 .NET 에이전트 v9.0 이상에서 사용할 수 없습니다. 대신 [`InsertDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders) 을(를) 사용하십시오. - - -다운스트림 시스템으로 보내는 요청에 포함할 분산 추적 페이로드를 만듭니다. - -### 통사론 - -```cs -IDistributedTracePayload CreateDistributedTracePayload() -``` - -### 보고 - -생성된 분산 추적 페이로드에 대한 액세스를 제공하는 `IDistributedTracePayload` 을 구현하는 객체입니다. - -### 사용 고려 사항 - -* [분산 추적을 활성화해야 합니다](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) . -* `CreateDistributedTracePayload` 이 트랜잭션에 대해 `AcceptDistributedTracePayload` 이(가) 이미 호출된 경우 무시됩니다. - -### 예시 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -IDistributedTracePayload payload = transaction.CreateDistributedTracePayload(); -``` - -## 사용자 정의 속성 추가 - -[속성](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute) 형식으로 현재 트랜잭션에 애플리케이션에 대한 컨텍스트 정보를 추가합니다. - -이 방법을 사용하려면 .NET 에이전트 버전 및 .NET 에이전트 API [버전 8.24.244.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) 이상이 필요합니다. 더 이상 사용되지 않는 [`AddCustomParameter`](/docs/agents/net-agent/net-agent-api/add-custom-parameter) 을(를) 대체했습니다. - -### 통사론 - -```cs -ITransaction AddCustomAttribute(string key, object value) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `key` - - _끈_ - - 보고되는 정보를 식별합니다. 이름으로도 알려져 있습니다. - - * 빈 키는 지원되지 않습니다. - * 키는 255바이트로 제한됩니다. 255바이트보다 큰 키가 있는 속성은 무시됩니다. -
- `value` - - _물체_ - - 보고되는 값입니다. - - **참고**: `null` 값은 기록되지 않습니다. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- .NET 유형 - - 가치가 표현되는 방식 -
- `byte`, `Int16` , `Int32` , `Int64` - - `sbyte`, `UInt16` , `UInt32` , `UInt64` - - 적분 값으로. -
- `float`, `double` , `decimal` - - 10진수 기반 숫자입니다. -
- `string` - - 255바이트 이후에 잘린 문자열입니다. - - 빈 문자열이 지원됩니다. -
- `bool` - - 참 또는 거짓. -
- `DateTime` - - 표준 시간대 정보를 포함하여 ISO-8601 형식을 따르는 문자열 표현: - - 예시: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - 초 수를 나타내는 10진수 기반 숫자입니다. -
- 다른 모든 것 - - `ToString()` 메서드가 적용됩니다. 사용자 정의 유형에는 `Object.ToString()` 구현이 있어야 하며 그렇지 않으면 예외가 발생합니다. -
-
- -### 보고 - -현재 트랜잭션에 대한 참조입니다. - -### 사용 고려 사항 - -지원되는 데이터 유형에 대한 자세한 내용은 [사용자 정의 속성 안내서](/docs/agents/net-agent/attributes/custom-attributes) 를 참조하십시오. - -### 예시 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## 현재 범위 - -현재 실행 중인 [범위](/docs/apm/agents/net-agent/net-agent-api/ispan/) 에 대한 액세스를 제공하여 New Relic API 내에서 [범위별 메서드를](/docs/apm/agents/net-agent/net-agent-api/ispan) 사용할 수 있도록 합니다. - -### 예시 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -ISpan currentSpan = transaction.CurrentSpan; -``` - -## SetUserId - -사용자 ID를 현재 트랜잭션과 연결합니다. - -이 방법에는 .NET 에이전트 및 .NET 에이전트 API [버전 10.9.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-1090) 이상이 필요합니다. - -### 통사론 - -```cs -ITransaction SetUserId(string userId) -``` - -### 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `userId` - - _끈_ - - 이 거래와 관련된 사용자 ID입니다. - - * `null`, 공백 및 공백 값은 무시됩니다. -
- -### 예시 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.SetUserId("BobSmith123"); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx deleted file mode 100644 index 9fc96b8d0c9..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: NoticeError(.NET 에이전트 API) -type: apiDoc -shortDescription: 오류를 확인하고 선택적 사용자 정의 속성과 함께 New Relic에 보고합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to capture exceptions or error messages and report them. -freshnessValidatedDate: never -translationType: machine ---- - -## 과부하 [#overloads] - -오류를 확인하고 선택적 사용자 정의 속성과 함께 New Relic에 보고합니다. - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception); -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected); -``` - -## 요구 사항 [#requirements] - -이 API 호출은 다음과 호환됩니다. - -* 모든 에이전트 버전 -* 모든 앱 유형 - -## 설명 [#description] - -오류를 확인하고 선택적 사용자 지정 속성과 함께 New Relic에 보고합니다. 각 트랜잭션에 대해 에이전트는 `NoticeError()` 에 대한 첫 번째 호출의 예외 및 속성만 유지합니다. 실제 예외를 전달하거나 문자열을 전달하여 임의의 오류 메시지를 캡처할 수 있습니다. - -이 메서드가 [트랜잭션](/docs/glossary/glossary/#transaction) 내에서 호출되면 에이전트는 상위 트랜잭션 내에서 예외를 보고합니다. 트랜잭션 외부에서 호출되는 경우 에이전트는 [오류 추적](/docs/errors-inbox/errors-inbox) 을 생성하고 New Relic UI의 오류를 `NewRelic.Api.Agent.NoticeError` API 호출로 분류합니다. 트랜잭션 외부에서 호출되는 경우 `NoticeError()` 호출은 애플리케이션의 오류율에 기여하지 않습니다. - -에이전트는 추적된 오류에만 속성을 추가합니다. New Relic으로 보내지 않습니다. 자세한 내용은 [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) 을(를) 참조하세요. - -이 API로 보고된 오류는 에이전트 구성에서 무시하도록 구성된 HTTP 상태 코드(예: `404` )를 초래하는 트랜잭션 내에서 보고될 때 여전히 New Relic으로 전송됩니다. 자세한 내용 [은 APM의 오류 관리](/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected) 에 대한 설명서를 참조하십시오. - -이 호출을 사용하는 방법의 예를 보려면 아래 섹션을 검토하세요. - -## 알림 오류(예외) [#exception-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception) -``` - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$exception` - - _예외_ - - 필수의. 계측하려는 `Exception` . 스택 추적의 처음 10,000자만 유지됩니다. -
- -## NoticeError(예외, 사전) [#exception-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$exception` - - _예외_ - - 필수의. 계측하려는 `Exception` . 스택 추적의 처음 10,000자만 유지됩니다. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - 오류 메시지에 주석을 달기 위해 속성의 키/값 쌍을 지정하십시오. `TKey` 은 문자열이어야 하며 `TValue` 은 문자열 또는 객체일 수 있습니다. -
- -## NoticeError(문자열, 사전) [#string-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$error_message` - - _끈_ - - 필수의. 예외인 것처럼 New Relic에 보고할 문자열을 지정합니다. 이 메서드는 [오류 이벤트](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) 와 [오류 추적](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details) 을 모두 만듭니다. 처음 1023자만 오류 이벤트에 유지되는 반면 오류 추적은 전체 메시지를 유지합니다. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - 필수(null일 수 있음). 오류 메시지에 주석을 달기 위해 속성의 키/값 쌍을 지정하십시오. `TKey` 은 문자열이어야 하고, `TValue` 은 문자열 또는 객체일 수 있으며, 속성을 전송하지 않으려면 `null` 를 전달합니다. - -
- -## NoticeError(문자열, IDictionary, bool) [#string-idictionary-bool-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$error_message` - - _끈_ - - 필수의. 예외인 것처럼 New Relic에 보고할 문자열을 지정합니다. 이 메서드는 [오류 이벤트](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) 와 [오류 추적](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details) 을 모두 만듭니다. 처음 1023자만 오류 이벤트에 유지되는 반면 오류 추적은 전체 메시지를 유지합니다. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - 필수(null일 수 있음). 오류 메시지에 주석을 달기 위해 속성의 키/값 쌍을 지정하십시오. `TKey` 은 문자열이어야 하고, `TValue` 은 문자열 또는 객체일 수 있으며, 속성을 전송하지 않으려면 `null` 를 전달합니다. -
- `$is_expected` - - _부울_ - - Apdex 점수 및 오류율에 영향을 미치지 않도록 오류를 예상대로 표시합니다. -
- -## 사용자 정의 속성 없이 예외 전달 [#exception-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError(ex); -} -``` - -## 사용자 정의 속성으로 예외 전달 [#exception-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary() {{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError(ex, errorAttributes); -} -``` - -## 사용자 정의 속성이 있는 오류 메시지 문자열 전달 [#string-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary{{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", errorAttributes); -} -``` - -## 사용자 정의 속성 없이 오류 메시지 문자열 전달 [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null); -} -``` - -## 오류 메시지 문자열을 전달하고 예상대로 표시하십시오. [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null, true); -} -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx deleted file mode 100644 index e6827d66d1d..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: RecordCustomEvent(.NET 에이전트 API) -type: apiDoc -shortDescription: 주어진 이름과 속성으로 사용자 정의 이벤트를 기록합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to report custom event data to New Relic. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) -``` - -주어진 이름과 속성으로 사용자 정의 이벤트를 기록합니다. - -## 요구 사항 - -에이전트 버전 4.6.29.0 이상. - -모든 앱 유형과 호환됩니다. - -## 설명 - -[쿼리 빌더](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) 에서 쿼리할 수 있는 지정된 이름과 속성으로 [사용자 지정 이벤트](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#event-data) 를 기록합니다. 이벤트가 올바르게 기록되고 있는지 확인하려면[대시보드](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards) 에서 데이터를 찾습니다. - -관련 API 호출은 [.NET 에이전트 API 가이드](/docs/agents/net-agent/api-guides/guide-using-net-agent-api#custom-data) 를 참조하세요. - - - * 많은 이벤트를 보내면 에이전트의 메모리 오버헤드가 증가할 수 있습니다. - * 또한, 1MB(10^6바이트) 이상의 게시물은 최대 이벤트 수에 관계없이 기록되지 않습니다. - * 사용자 정의 이벤트는 64개 속성으로 제한됩니다. - * 사용자 정의 속성 값이 처리되는 방법에 대한 자세한 내용은 [사용자 정의 속성](/docs/agents/net-agent/attributes/custom-attributes) 가이드를 참조하십시오. - - -## 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `eventType` - - _끈_ - - 필수의. 기록할 이벤트 유형의 이름입니다. 255자를 초과하는 문자열을 사용하면 API 호출이 뉴렐릭으로 전송되지 않습니다. 이름에는 영숫자 문자, 밑줄 `_` 및 콜론 `:` 만 포함할 수 있습니다. 이벤트 유형 이름에 대한 추가 제한 사항은 [예약어를](/docs/data-apis/custom-data/custom-events/data-requirements-limits-custom-event-data/#reserved-words) 참조하세요. -
- `attributeValues` - - _IEnumerable<string, object>_ - - 필수의. 이벤트에 주석을 추가할 속성의 키/값 쌍을 지정하십시오. -
- -## 예 - -### 값을 기록 [#record-strings] - -```cs -var eventAttributes = new Dictionary() -{ -  {"foo", "bar"}, -  {"alice", "bob"}, -  {"age", 32}, -  {"height", 21.3f} -}; - -NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx deleted file mode 100644 index df3a3d89775..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordMetric(.NET 에이전트 API) -type: apiDoc -shortDescription: 지정된 이름으로 사용자 지정 메트릭을 기록합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.RecordMetric(string $metric_name, single $metric_value) -``` - -지정된 이름으로 사용자 지정 메트릭을 기록합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -모든 앱 유형과 호환됩니다. - -## 설명 - -지정된 이름으로 [사용자 지정 메트릭](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) 을 기록합니다. 이러한 사용자 지정 메트릭을 보려면 [쿼리 빌더](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) 를 사용하여 메트릭을 검색하고 사용자 지정 가능한 차트를 만드십시오. [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) 및 [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent) 도 참조하십시오. - - - 맞춤 측정항목을 생성할 때 이름은 `Custom/` 으로 시작합니다(예: `Custom/MyMetric` ). - - -## 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$metric_name` - - _끈_ - - 필수의. 기록할 측정항목의 이름입니다. 처음 255자만 유지됩니다. -
- `$metric_value` - - _하나의_ - - 필수의. 메트릭에 대해 기록할 수량입니다. -
- -## 예 - -### 슬리핑 프로세스의 응답 시간 기록 [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordMetric("Custom/DEMO_Record_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx deleted file mode 100644 index dc0b927dc91..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordResponseTimeMetric(.NET 에이전트 API) -type: apiDoc -shortDescription: 지정된 이름과 응답 시간(밀리초)을 사용하여 사용자 지정 메트릭을 기록합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record response time as custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value) -``` - -지정된 이름과 응답 시간(밀리초)을 사용하여 사용자 지정 메트릭을 기록합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -모든 앱 유형과 호환됩니다. - -## 설명 - -[맞춤 측정항목](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) 에 대한 응답 시간을 밀리초 단위로 기록합니다. 이러한 사용자 지정 메트릭을 보려면 [쿼리 빌더](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) 를 사용하여 메트릭을 검색하고 사용자 지정 가능한 차트를 만드십시오. [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) 및 [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent) 도 참조하십시오. - - - 맞춤 측정항목을 생성할 때 이름은 `Custom/` 으로 시작합니다(예: `Custom/MyMetric` ). - - -## 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$metric_name` - - _끈_ - - 필수의. 기록할 응답 시간 메트릭의 이름입니다. 처음 255자만 유지됩니다. -
- `$metric_value` - - _Int64_ - - 필수의. 기록할 응답 시간(밀리초)입니다. -
- -## 예 - -### 슬리핑 프로세스의 응답 시간 기록 [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx deleted file mode 100644 index a13615d6523..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: SetApplicationName(.NET 에이전트 API) -type: apiDoc -shortDescription: 데이터 롤업을 위한 앱 이름을 설정합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to set the New Relic app name, which controls data rollup.' -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName(string $name[, string $name_2, string $name_3]) -``` - -데이터 롤업을 위한 앱 이름을 설정합니다. - -## 요구 사항 - -에이전트 버전 5.0.136.0 이상. - -모든 앱 유형과 호환됩니다. - -## 설명 - -New Relic에 보고된 애플리케이션 이름을 설정합니다. 애플리케이션 이름 지정에 대한 자세한 내용은 [.NET 애플리케이션 이름 지정을 참조하세요](/docs/agents/net-agent/installation-configuration/name-your-net-application) . 이 메서드는 응용 프로그램을 시작하는 동안 한 번만 호출됩니다. - - - 앱 이름을 업데이트하면 에이전트가 강제로 다시 시작됩니다. 에이전트는 이전 앱 이름과 연결된 보고되지 않은 데이터를 삭제합니다. 관련 데이터 손실로 인해 애플리케이션의 수명 주기 동안 앱 이름을 여러 번 변경하는 것은 권장되지 않습니다. - - -## 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$name` - - _끈_ - - 필수의. 기본 애플리케이션 이름입니다. -
- `$name_2` - - `$name_3` - - _끈_ - - 선택 과목. 앱 롤업의 두 번째 및 세 번째 이름입니다. 자세한 내용 [은 앱에 여러 이름 사용](/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app) 을 참조하십시오. -
- -## 예 - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName("AppName1", "AppName2"); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx deleted file mode 100644 index a05035ae8c8..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: SetTransactionUri(.NET 에이전트 API) -type: apiDoc -shortDescription: 현재 트랜잭션의 URI를 설정합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the URI of a transaction (use with attribute-based custom instrumentation). -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionUri(Uri $uri) -``` - -현재 트랜잭션의 URI를 설정합니다. - -## 요구 사항 - -[트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 내에서 호출되어야 합니다. - -에이전트 버전 6.16 이상. - - - 이 메소드는 `Web` 속성이 `true` 로 설정된 `Transaction` 속성을 사용하여 생성된 트랜잭션 내에서 사용될 때만 작동합니다. ( [속성을 사용하여 계측을](/docs/agents/net-agent/api-guides/net-agent-api-instrument-using-attributes) 참조하십시오.) 에이전트가 자동으로 지원하지 않는 사용자 정의 웹 기반 프레임워크에 대한 지원을 제공합니다. - - -## 설명 - -현재 트랜잭션의 URI를 설정합니다. URI는 [트랜잭션 추적](/docs/apm/transactions/transaction-traces/transaction-traces) 및 [트랜잭션 이벤트](/docs/using-new-relic/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data) 의 'request.uri' [속성](/docs/agents/net-agent/attributes/net-agent-attributes) 에 나타나며 트랜잭션 이름 지정에도 영향을 줄 수 있습니다. - -동일한 트랜잭션 내에서 이 호출을 여러 번 사용하면 각 호출이 이전 호출을 덮어씁니다. 마지막 호출은 URI를 설정합니다. - -**참고** : 에이전트 버전 8.18부터 `request.uri` 속성의 값은 API에 전달된 `System.Uri` 객체의 `Uri.AbsolutePath` 속성 값으로 설정됩니다. - -## 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$uri` - - _우리_ - - 이 트랜잭션의 URI입니다. -
- -## 예 - -```cs -var uri = new System.Uri("https://www.mydomain.com/path"); -NewRelic.Api.Agent.NewRelic.SetTransactionUri(uri); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx deleted file mode 100644 index bd62a47182a..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: SetUserParameters(.NET 에이전트) -type: apiDoc -shortDescription: 사용자 관련 사용자 지정 속성을 만듭니다. AddCustomAttribute()가 더 유연합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach user-related custom attributes to APM and browser events. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value) -``` - -사용자 관련 맞춤 속성을 만듭니다. [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) 은 더 유연합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -[트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 내에서 호출되어야 합니다. - -## 설명 - - - 이 호출을 통해 기존 키에 값을 할당할 수 있습니다. 키/값 쌍을 생성하는 보다 유연한 방법을 사용하려면 [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction) 을 사용합니다. - - -브라우저 페이지 보기(사용자 이름, 계정 이름 및 제품 이름)와 연결할 사용자 관련 [사용자 정의 속성을](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)정의합니다. 값은 자동으로 기존 키(`user`, `account` 및 `product`)와 연결된 다음 상위 APM 트랜잭션에 연결됩니다. [또한 이러한 속성을](/docs/insights/new-relic-insights/decorating-events/insights-custom-attributes#forwarding-attributes) 브라우저 [PageView 이벤트에](/docs/agents/manage-apm-agents/agent-metrics/agent-attributes#destinations) 첨부(또는 "전달") 할 수도 있습니다. - -## 매개변수 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$user_value` - - _끈_ - - 필수(null일 수 있음). 이 페이지 보기와 연결할 이름 또는 사용자 이름을 지정하십시오. 이 값은 `user` 키에 할당됩니다. -
- `$account_value` - - _끈_ - - 필수(null일 수 있음). 이 페이지 보기와 연결할 사용자 계정의 이름을 지정하십시오. 이 값은 `account` 키에 할당됩니다. -
- `$product_value` - - _끈_ - - 필수(null일 수 있음). 이 페이지 보기와 연결할 제품의 이름을 지정하십시오. 이 값은 `product` 키에 할당됩니다. -
- -## 예 - -### 세 가지 사용자 속성 기록 [#report-three] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName"); -``` - -### 두 개의 사용자 속성과 하나의 빈 속성 기록 [#report-two] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName"); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx deleted file mode 100644 index 714be79034b..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: SetErrorGroupCallback(.NET 에이전트 API) -type: apiDoc -shortDescription: 속성 데이터를 기반으로 오류 그룹 이름을 결정하기 위한 콜백 메소드 제공 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to provide a callback method for determining the error group name for an error, based on attribute data.' -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(Func, string> errorGroupCallback); -``` - -속성 데이터의 `IReadOnlyDictionary` 를 사용하고 오류 그룹 이름을 반환하는 콜백 메서드를 제공합니다. - -## 요구 사항 [#requirements] - -이 API 호출은 다음과 호환됩니다. - -* 에이전트 버전 >= 10.9.0 -* 모든 앱 유형 - -## 설명 [#description] - -에이전트가 오류 이벤트 및 추적에 대한 오류 그룹 이름을 결정하는 데 사용할 콜백 메서드를 설정합니다. 이 이름은 오류 수신함에서 오류를 논리 그룹으로 그룹화하는 데 사용됩니다. - -콜백 메서드는 `IReadOnlyDictionary`유형의 단일 인수를 수락하고 문자열(오류 그룹 이름)을 반환해야 합니다. `IReadOnlyDictionary` 은 사용자 정의 속성을 포함하여 각 오류 이벤트와 연관된 [속성 데이터](/docs/apm/agents/manage-apm-agents/agent-data/agent-attributes/) 의 모음입니다. - -각 오류에 사용할 수 있는 속성의 정확한 목록은 다음에 따라 다릅니다. - -* 오류를 생성한 애플리케이션 코드 -* 에이전트 구성 설정 -* 맞춤 속성이 추가되었는지 여부 - -그러나 다음 속성은 항상 존재해야 합니다. - -* `error.class` -* `error.message` -* `stack_trace` -* `transactionName` -* `request.uri` -* `error.expected` - -오류를 논리적 오류 그룹에 할당할 수 없는 경우 오류 그룹 이름에 대해 빈 문자열이 반환될 수 있습니다. - -## 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$callback` - - _'Func<IReadOnlyDictionary<string,object>,string>'_ - - 속성 데이터를 기반으로 오류 그룹 이름을 결정하는 콜백입니다. -
- -## 예 - -오류 클래스 이름별로 오류 그룹화: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("error.class", out var errorClass)) - { - if (errorClass.ToString() == "System.ArgumentOutOfRangeException" || errorClass.ToString() == "System.ArgumentNullException") - { - errorGroupName = "ArgumentErrors"; - } - else - { - errorGroupName = "OtherErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` - -트랜잭션 이름별로 오류 그룹화: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("transactionName", out var transactionName)) - { - if (transactionName.ToString().IndexOf("WebTransaction/MVC/Home") != -1) - { - errorGroupName = "HomeControllerErrors"; - } - else - { - errorGroupName = "OtherControllerErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx deleted file mode 100644 index 33c99a2e204..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: SetLlmTokenCountingCallback(.NET 에이전트 API) -type: apiDoc -shortDescription: LLM 완료를 위한 토큰 수를 결정하는 콜백 메서드 제공 -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to provide a callback method that determines the token count for an LLM completion. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(Func callback); -``` - -토큰 수를 계산하는 콜백 메서드를 제공합니다. - -## 요구 사항 [#requirements] - -이 API 호출은 다음과 호환됩니다. - -* 에이전트 버전 >= 10.23.0 -* 모든 앱 유형 - -## 설명 [#description] - -에이전트가 LLM 이벤트의 토큰 수를 결정하는 데 사용할 콜백 방법을 설정합니다. 높은 보안 모드에서 또는 콘텐츠 기록이 비활성화된 경우 LLM 이벤트에 대한 토큰 수를 결정하기 위해 이 메서드가 호출됩니다. - -콜백 메서드는 `string` 유형의 두 인수를 허용하고 정수를 반환해야 합니다. 첫 번째 문자열 인수는 LLM 모델 이름이고 두 번째 문자열 인수는 LLM에 대한 입력입니다. 콜백 메소드는 LLM 이벤트에 대한 토큰 수를 반환해야 합니다. 0 이하의 값은 무시됩니다. - -## 매개변수 - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$callback` - - '\_Func<string, string, int>\_' - - 토큰 수를 결정하는 콜백입니다. -
- -## 예시 - -```cs -Func llmTokenCountingCallback = (modelName, modelInput) => { - - int tokenCount = 0; - // split the input string by spaces and count the tokens - if (!string.IsNullOrEmpty(modelInput)) - { - tokenCount = modelInput.Split(' ').Length; - } - - return tokenCount; -}; - -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(llmTokenCountingCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx deleted file mode 100644 index aed30a303a8..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: SetTransactionName(.NET 에이전트 API) -type: apiDoc -shortDescription: 현재 트랜잭션의 이름을 설정합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the name of a transaction. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name) -``` - -현재 트랜잭션의 이름을 설정합니다. - -## 요구 사항 - -모든 에이전트 버전과 호환됩니다. - -[트랜잭션](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction) 내에서 호출되어야 합니다. - -## 설명 - -현재 트랜잭션의 이름을 설정합니다. 이 호출을 사용하기 전에 [측정항목 그룹화 문제](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues) 의 의미를 이해해야 합니다. - -동일한 트랜잭션 내에서 이 호출을 여러 번 사용하면 각 호출이 이전 호출을 덮어쓰고 마지막 호출이 이름을 설정합니다. - - - 거래 이름 끝에 대괄호 `[suffix]` 를 사용하지 마십시오. New Relic은 자동으로 이름에서 괄호를 제거합니다. 대신 필요한 경우 괄호 `(suffix)` 또는 기타 기호를 사용하십시오. - - -URL, 페이지 제목, 16진수 값, 세션 ID 및 고유하게 식별 가능한 값과 같은 고유한 값은 거래 이름을 지정할 때 사용해서는 안 됩니다. 대신 [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) 호출을 사용하여 해당 데이터를 사용자 정의 매개변수로 트랜잭션에 추가하십시오. - - - 고유한 트랜잭션 이름을 1000개 이상 만들지 마십시오(예: 가능하면 URL로 이름을 지정하지 마십시오). 이렇게 하면 차트의 유용성이 떨어지고 계정당 고유한 거래 이름의 수에 대해 New Relic이 설정하는 제한에 부딪힐 수 있습니다. 또한 애플리케이션의 성능을 저하시킬 수 있습니다. - - -## 매개변수 - - - - - - - - - - - - - - - - - - - - - - - -
- 매개변수 - - 설명 -
- `$category` - - _끈_ - - 필수의. 다양한 유형의 거래를 구별하는 데 사용할 수 있는 이 거래의 범주입니다. 기본값은 **`Custom`** 입니다. 처음 255자만 유지됩니다. -
- `$name` - - _끈_ - - 필수의. 트랜잭션의 이름입니다. 처음 255자만 유지됩니다. -
- -## 예 - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction"); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx deleted file mode 100644 index 9486cbb5c42..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: StartAgent(.NET 에이전트 API) -type: apiDoc -shortDescription: 에이전트가 아직 시작되지 않은 경우 시작합니다. 일반적으로 불필요합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to force the .NET agent to start, if it hasn''t been started already. Usually unnecessary, since the agent starts automatically.' -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent() -``` - -에이전트가 아직 시작되지 않은 경우 시작합니다. 일반적으로 불필요합니다. - -## 요구 사항 - -에이전트 버전 5.0.136.0 이상. - -모든 앱 유형과 호환됩니다. - -## 설명 - -에이전트가 아직 시작되지 않은 경우 에이전트를 시작합니다. 이 호출은 일반적으로 필요하지 않습니다. [`autoStart`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-autoStart) 을 비활성화하지 않는 한 에이전트가 계측된 메서드에 도달할 때 자동으로 시작되기 때문입니다. [`SetApplicationName()`](/docs/agents/net-agent/net-agent-api/setapplicationname-net-agent) 을 사용하는 경우 에이전트를 시작 **하기 전에** 앱 이름을 설정해야 합니다. - - - 이 메서드는 [`syncStartup`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-syncStartup) 또는 [`sendDataOnExit`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-sendDataOnExit) 을 활성화하지 않는 한 에이전트를 비동기식으로 시작합니다(즉, 앱 시작을 차단하지 않음). - - -## 예 - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx b/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx deleted file mode 100644 index 1c21ebc40c0..00000000000 --- a/src/i18n/content/kr/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: TraceMetadata(.NET 에이전트 API) -type: apiDoc -shortDescription: 추적을 지원하는 데 사용되는 현재 실행 환경의 속성을 반환합니다. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## 통사론 - -```cs -NewRelic.Api.Agent.TraceMetadata; -``` - -추적을 지원하는 데 사용되는 현재 실행 환경의 속성을 반환합니다. - -## 요구 사항 - -에이전트 버전 8.19 이상. - -모든 앱 유형과 호환됩니다. - -의미 있는 값을 얻으려면 [분산 추적을 활성화해야 합니다](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) . - -## 설명 - -다음 속성에 대한 액세스를 제공합니다. - -### 속성 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 이름 - - 설명 -
- `TraceId` - - 현재 실행 중인 추적을 나타내는 문자열을 반환합니다. 추적 ID를 사용할 수 없거나 분산 추적이 비활성화된 경우 값은 `string.Empty` 입니다. -
- `SpanId` - - 현재 실행 중인 범위를 나타내는 문자열을 반환합니다. 스팬 ID를 사용할 수 없거나 분산 추적이 비활성화된 경우 값은 `string.Empty` 입니다. -
- `IsSampled` - - 현재 추적이 포함을 위해 샘플링된 경우 `true` 을 반환하고 샘플링된 경우 `false` 을 반환합니다. -
- -## 예 - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -TraceMetadata traceMetadata = agent.TraceMetadata; -string traceId = traceMetadata.TraceId; -string spanId = traceMetadata.SpanId; -bool isSampled = traceMetadata.IsSampled; -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx deleted file mode 100644 index e0c8dca60fd..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: DisableBrowserMonitoring (API do agente .NET) -type: apiDoc -shortDescription: Desabilitar injeção automática de monitoramento de trecho do Browser em páginas específicas. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to disable browser monitoring on specific pages or views. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override]) -``` - -Desabilitar injeção automática de monitoramento de trecho do Browser em páginas específicas. - -## Requisitos - -Compatível com todas as versões do agente. - -Deve ser chamado dentro de uma [transação](/docs/glossary/glossary/#transaction). - -## Descrição - -Adicione esta chamada para desativar a injeção **automatic** do script [](/docs/browser/new-relic-browser/getting-started/new-relic-browser)em páginas específicas. Você também pode adicionar uma substituição opcional para desativar a injeção manual e automática **both** . Em ambos os casos, coloque esta chamada de API o mais próximo possível do topo da visualização na qual você deseja desabilitar o browser. - - - Compare [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent), que **adds** é o script do browser com a página. - - -## Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$override` - - _boleano_ - - Opcional. Quando `true`, desativa toda injeção de script do browser. Este sinalizador afeta a injeção manual e automática. Isso também substitui a chamada [`GetBrowserTimingHeader()`](/docs/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent) . -
- -## Exemplos - -### Desativar injeção automática [#automatic-only] - -Este exemplo desativa apenas a injeção **automatic** do trecho: - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(); -``` - -### Desativar injeção automática e manual [#disable-both] - -Este exemplo desativa **both** injeção automática e manual do trecho: - -```cs -NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getagent.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getagent.mdx deleted file mode 100644 index f1fc86ac942..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getagent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Obter Agente -type: apiDoc -shortDescription: Obtenha acesso ao agente por meio da interface do IAgent. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.GetAgent() -``` - -Obtenha acesso ao agente por meio da interface `IAgent` . - -## Requisitos - -Versão do agente 8.9 ou superior. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Obtenha acesso aos métodos da API do agente por meio da interface [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) . - -## Valores de retorno - -Uma implementação do [IAgent](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api) que fornece acesso à [API do IAgent](/docs/agents/net-agent/net-agent-api/iagent-net-agent-api). - -## Exemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx deleted file mode 100644 index ed64b86cfdd..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api.mdx +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: GetBrowserTimingHeader (API do agente .NET) -type: apiDoc -shortDescription: Gerar um monitoramento de HTML do browser para browsers de usuários finais. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to instrument a webpage with browser. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(); -NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader(string nonce); -``` - -Gerar um monitoramento de HTML do browser para browsers de usuários finais. - -## Requisitos - -Compatível com todas as versões do agente. - -Deve ser chamado dentro de uma [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descrição - -Retorna um trecho HTML usado para ativar [](/docs/browser/new-relic-browser/getting-started/new-relic-browser). O trecho instrui o browser a buscar um pequeno arquivo JavaScript e iniciar o cronômetro da página. Você pode então inserir o trecho retornado no cabeçalho de suas páginas HTML. Para obter mais informações, consulte [Adicionando aplicativos ao monitoramento do navegador](/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser). - - - Compare [`DisableBrowserMonitoring()`](/docs/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent), que **disables** é o script do browser em uma página. - - -## Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `nonce` - - _corda_ - - O nonce criptográfico por solicitação usado pelas políticas de Política de Segurança de Conteúdo. -
- - - Esta chamada de API requer atualizações na lista de permissões de segurança. Para obter mais informações sobre as considerações da Política de Segurança de Conteúdo (CSP), visite a página [de monitoramento de compatibilidade e requisitos do navegador](/docs/browser/new-relic-browser/getting-started/compatibility-requirements-browser-monitoring) . - - -## Valores de retorno - -Uma string HTML a ser incorporada em um cabeçalho de página. - -## Exemplos - -### Com ASPX [#aspx] - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%> - ... - - - ... -``` - -```aspnet - - - <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")%> - ... - - - ... -``` - -### Com navalha [#razor] - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` - -### Com Blazor [#blazor] - - - Esta API não é compatível com Blazor Webassembly, porque o agente não consegue instrumentar o código do Webassembly. Os exemplos a seguir são apenas para o aplicativo Blazor Server. Use o [método copiar e colar](/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#copy-paste) para adicionar o agente browser às páginas do Blazor Webassembly. - - - - Esta API não pode ser colocada em um elemento `` de uma página `.razor` . Em vez disso, ele deve ser chamado de `_Layout.cshtml` ou de um arquivo de layout equivalente. - - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) - ... - - - ... -``` - -```cshtml - - - - @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader("YOUR_NONCE_VALUE")) - ... - - - ... -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx deleted file mode 100644 index 18f755dfe64..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: GetLinkingMetadata (API do agente .NET) -type: apiDoc -shortDescription: Retorna pares de valores principais que podem ser usados para vincular rastreamento ou entidade. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.GetLinkingMetadata(); -``` - -Retorna pares de valores principais que podem ser usados para vincular rastreamento ou entidade. - -## Requisitos - -Versão do agente 8.19 ou superior. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -O Dicionário de pares de valores principais retornados inclui itens usados para vincular rastreamento e entidade no produto APM. Ele conterá apenas itens com valores significativos. Por exemplo, se distributed tracing estiver desabilitado, `trace.id` não será incluído. - -## Valores de retorno - -`Dictionary ()` retornado inclui itens usados para vincular rastreamento e entidade no produto APM. - -## Exemplos - -```cs -NewRelic.Api.Agent.IAgent Agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -var linkingMetadata = Agent.GetLinkingMetadata(); -foreach (KeyValuePair kvp in linkingMetadata) -{ - Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); -} -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx deleted file mode 100644 index 284d247d3ed..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api.mdx +++ /dev/null @@ -1,326 +0,0 @@ ---- -title: Guia para usar a API do agente .NET -tags: - - Agents - - NET agent - - API guides -metaDescription: 'A goal-focused guide to the New Relic .NET agent API, with links to relevant sections of the complete API documentation.' -freshnessValidatedDate: never -translationType: machine ---- - -O agente .NET da New Relic inclui uma [API](/docs/agents/net-agent/net-agent-api) que permite estender a funcionalidade padrão do agente. Por exemplo, você pode usar a API do agente .NET para: - -* Personalizando o nome do seu aplicativo -* Criando parâmetro de transação personalizado -* Relatando erros personalizados e métricas - -Você também pode personalizar alguns dos comportamentos padrão do agente .NET ajustando [as definições de configuração](/docs/agents/net-agent/configuration/net-agent-configuration) ou usando [instrumentação personalizada](/docs/agents/net-agent/custom-instrumentation/introduction-net-custom-instrumentation). - -## Requisitos - - - A partir de setembro de 2021, um pequeno subconjunto de API, opções de configuração e opções de instalação para .NET será substituído por novos métodos. Para obter mais detalhes, incluindo como você pode se preparar facilmente para essa transição, consulte nossa [postagem no Fórum de suporte](https://discuss.newrelic.com/t/important-upcoming-changes-to-support-and-capabilities-across-browser-node-js-agent-query-builder-net-agent-apm-errors-distributed-tracing/153373). - - -Para usar a API do agente .NET: - -1. Certifique-se de ter a [versão mais recente do agente .NET](/docs/release-notes/agent-release-notes/net-release-notes). - -2. Adicione uma referência ao agente no seu projeto: - - * Adicione uma referência a `NewRelic.Api.Agent.dll` ao seu projeto. - - OU - - * Visualize e baixe o pacote de API da [biblioteca de pacotes NuGet](https://www.nuget.org/packages/NewRelic.Agent.Api/). - -## Instrumento faltando seções do seu código com transação [#creating-transactions] - -Para instrumentar seu aplicativo, o New Relic separa cada caminho do seu código em sua própria [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). A New Relic utiliza (ou "instrumento") o método pai nessas transações para medir o desempenho geral do seu aplicativo e coleta [o rastreamento da transação](/docs/apm/transactions/transaction-traces/introduction-transaction-traces) de transações de longa duração para obter detalhes adicionais. - -Use estes métodos quando o New Relic não estiver instrumentado em uma parte específica do seu código: - - - - - - - - - - - - - - - - - - - - - - - -
- Se você quiser... - - Fazem isto... -
- Impedir que uma transação seja reportada à New Relic - - Use [`IgnoreTransaction()`](/docs/agents/net-agent/net-agent-api/ignore-transaction) ou [um arquivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation) para ignorar a transação. -
- Crie uma transação onde não existe nenhuma - - Use [atributo](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) ou [um arquivo XML](/docs/agents/net-agent/instrumentation/net-custom-transactions) para criar uma nova transação. -
- -## Métodos específicos de tempo usando segmentos [#segments] - -Se uma transação já estiver visível na interface do New Relic, mas você não tiver dados suficientes sobre um método específico que foi chamado durante essa transação, você poderá criar segmentos para cronometrar esses métodos individuais com mais detalhes. Por exemplo, você pode querer cronometrar um método particularmente crítico com lógica complexa. - -Quando desejar instrumentar um método dentro de uma transação existente, consulte [instrumentação personalizada via atributo](/docs/agents/net-agent/api-guides/custom-instrumentation-attributes-net) ou [Adicionar detalhe às transações via XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net). - -## Aprimore os metadados de uma transação [#metadata] - -Às vezes, o código que você está direcionando fica visível na interface do New Relic, mas alguns detalhes do método não são úteis. Por exemplo: - -* O nome padrão pode não ser útil. (Talvez esteja causando um [problema de agrupamento métrico](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues#video).) -* Você deseja adicionar [um atributo personalizado](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) à sua transação para poder filtrá-los no painel. - -Use estes métodos quando quiser alterar a forma como o New Relic utiliza uma transação que já está visível na interface do New Relic: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Se você quiser... - - Fazem isto... -
- Alterar o nome de uma transação - - Use [`SetTransactionName()`](/docs/agents/net-agent/net-agent-api/set-transaction-name) ou [um arquivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#name-transactions). -
- Evite que uma transação afete sua pontuação [Apdex](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#apdex) - - Usar [`IgnoreApdex()`](/docs/agents/net-agent/net-agent-api/ignore-apdex). -
- Adicione metadados (como o nome da conta do seu cliente ou nível de assinatura) à sua transação - - Use [atributo personalizado](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes). Consulte [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction#addcustomattribute). -
- -## Veja o registro relacionado [#logs] - -Para ver o log diretamente no contexto dos erros e rastreamento do seu aplicativo, use esta chamada de API para anotar seu log: - -* [`TraceMetadata`](/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0/) -* [`GetLinkingMetadata`](/docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api/) - -Para obter mais informações sobre como correlacionar dados log com outros dados de telemetria, consulte nossa documentação [de logs contextualizados](/docs/logs/logs-context/net-configure-logs-context-all/) . - -## Trabalho assíncrono de instrumento [#async] - -Para estruturas suportadas, o agente .NET geralmente detecta o trabalho assíncrono e o instrumenta corretamente. No entanto, se seu aplicativo usar outra framework ou se a [instrumentação assíncrona padrão](/docs/agents/net-agent/features/async-support-net) for imprecisa, você poderá conectar explicitamente o trabalho assíncrono. - - - - - - - - - - - - - - - - - - - - - - - -
- Se você quiser... - - Fazem isto... -
- Trace um método assíncrono que o New Relic já está instrumentado - - Use [um arquivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) para instrumentar métodos assíncronos em aplicativos IIS. Para dicas de resolução de problemas, veja [faltando métrica assíncrona](/docs/agents/net-agent/troubleshooting/missing-async-metrics). -
- Trace um método assíncrono que New Relic não é instrumentado - - Use [um arquivo XML](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#example-custom-txn-async) para instrumentar métodos assíncronos em aplicativos IIS. Para dicas de resolução de problemas, veja [faltando métrica assíncrona](/docs/agents/net-agent/troubleshooting/missing-async-metrics). -
- -## Ver chamadas para serviços externos [#externals] - -Para o agente .NET versão 8.9 ou superior, você pode usar a de [distributed tracing carga útil API](/docs/apm/agents/net-agent/configuration/distributed-tracing-net-agent/#manual-instrumentation) a seguir para passar manualmente distributed tracing o contexto entre os serviços de monitoramento do New Relic que não se conectam automaticamente entre si em um [distributed trace](/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing). - - - - - - - - - - - - - - - - - - - - - - - -
- Se você quiser... - - Fazem isto... -
- Instrumento uma solicitação de saída para um aplicativo ou banco de dados externo - - Adicione uma carga de distributed trace a uma solicitação de saída usando [`InsertDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders). -
- Conecte as solicitações recebidas ao originador da solicitação para concluir uma [extensão](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#span) do trace - - Receba uma carga útil em uma solicitação recebida usando [`AcceptDistributedTraceHeaders()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders). -
- -Para versões do agente .NET inferiores a 8.9, utilize [o rastreamento multiaplicativo](/docs/apm/transactions/cross-application-traces/introduction-cross-application-traces). - -## Colete ou erro ignorado [#errors] - -Normalmente, o agente .NET detecta erros automaticamente. No entanto, você pode marcar manualmente um erro com o agente. Você também pode [errar ignorado](/docs/apm/applications-menu/error-analytics/ignoring-errors-new-relic-apm) . - - - - - - - - - - - - - - - - - - - - - - - -
- Se você quiser... - - Fazem isto... -
- Relatar um erro que o agente .NET não relata automaticamente - - Usar [`NoticeError()`](/docs/agents/net-agent/net-agent-api/notice-error). -
- Capture erros ou evite que o agente .NET relate um erro - - Use [o arquivo de configuração do agente .NET](/docs/agents/net-agent/configuration/net-agent-configuration#error_collector). -
- -## Envie dados de eventos personalizados e métricos do seu aplicativo [#custom-data] - -O APM inclui diversas maneiras de registrar dados personalizados arbitrários. Para obter uma explicação dos tipos de dados do New Relic, consulte [Coleta de dados](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Se você quiser... - - Fazem isto... -
- Envie dados sobre um evento para que você possa analisá-lo no painel - - Crie um [evento personalizado](/docs/insights/insights-data-sources/custom-data/insert-custom-events-new-relic-apm-agents#net-att). Consulte [`RecordCustomEvent()`](/docs/agents/net-agent/net-agent-api/record-custom-event). -
- Tag seu evento com metadados para filtrá-los e facetá-los no painel ou na análise de erros - - Adicionar [atributo personalizado](/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes). Consulte Atributo do agente .NET e [Habilitar e desabilitar atributo](/docs/agents/net-agent/attributes/enable-disable-attributes-net). -
- Relatar dados de desempenho personalizados - - Use [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/record-metric) para criar uma [métrica personalizada](/docs/agents/manage-apm-agents/agent-data/collect-custom-metrics). Para visualizar os dados, utilize o [criador de consulta](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data). -
- -## Controle o agente de monitoramento do Browser [#browser] - -Normalmente o agente é adicionado automaticamente às suas páginas ou implantado copiando/colando o trecho JavaScript. Para obter mais informações sobre esses métodos recomendados, consulte [Adicionar aplicativos ao monitoramento do navegador](/docs/browser/new-relic-browser/installation-configuration/add-apps-new-relic-browser). - -No entanto, você também pode controlar o agente browser por meio da chamada de API do agente APM. Para mais informações, consulte [monitoramento de Browser e agente .NET](/docs/agents/net-agent/instrumentation-features/new-relic-browser-net-agent). \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/iagent.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/iagent.mdx deleted file mode 100644 index 8a1358b3cf6..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/iagent.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Agente IA -type: apiDoc -shortDescription: 'Fornece acesso a artefatos e métodos do agente, como a transação em execução no momento.' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -public interface IAgent -``` - -Fornece acesso a artefatos e métodos do agente, como a transação em execução no momento. - -## Requisitos - -Versão do agente 8.9 ou superior. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Fornece acesso a artefatos e métodos do agente, como a transação em execução no momento. Para obter uma referência a `IAgent`, use [`GetAgent`](/docs/agents/net-agent/net-agent-api/getagent). - -### Propriedades - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- Transação Atual - - Propriedade que fornece acesso à transação atualmente em execução por meio da interface [ITransaction](/docs/agents/net-agent/net-agent-api/itransaction) . Deve ser chamado dentro de uma [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). -
- Período Atual - - Propriedade que fornece acesso ao intervalo atualmente em execução por meio da interface [ISpan](/docs/agents/net-agent/net-agent-api/iSpan) . -
- -## Exemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx deleted file mode 100644 index e344395c0f4..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ignore-apdex.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: IgnoreApdex (API do agente .NET) -type: apiDoc -shortDescription: Ignore a transação atual ao calcular o Apdex. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction when calculating your app's overall Apdex score. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex() -``` - -Ignore a transação atual ao calcular o Apdex. - -## Requisitos - -Compatível com todas as versões do agente. - -## Descrição - -Ignora a transação atual ao calcular sua [pontuação Apdex](/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction). Isso é útil quando você tem transações muito curtas ou muito longas (como downloads de arquivos) que podem distorcer sua pontuação Apdex. - -## Exemplos - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreApdex(); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx deleted file mode 100644 index f35fada566a..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ignore-transaction.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: IgnoreTransaction (API do agente .NET) -type: apiDoc -shortDescription: Não instrumento a transação atual. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to ignore the current transaction entirely. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction() -``` - -Não instrumento a transação atual. - -## Requisitos - -Compatível com todas as versões do agente. - -Deve ser chamado dentro de uma [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descrição - -Ignora a transação atual. - - - Você também pode ignorar a transação [através de um arquivo XML de instrumentação personalizado](/docs/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net#blocking-instrumentation). - - -## Exemplos - -```cs -NewRelic.Api.Agent.NewRelic.IgnoreTransaction(); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx deleted file mode 100644 index b1bd7323d1e..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: IncrementCounter (API do agente .NET) -type: apiDoc -shortDescription: Aumente o contador de uma métrica personalizada em 1. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to increment the value of a custom metric. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name) -``` - -Aumente o contador de uma métrica personalizada em 1. - -## Requisitos - -Compatível com todas as versões do agente. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Aumente o contador de uma [métrica personalizada](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) em 1. Para visualizar essas métricas personalizadas, utilize o [criador de consulta](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) para pesquisar métricas e criar gráficos customizáveis. Consulte também [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent) e [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent). - - - Ao criar uma métrica personalizada, comece o nome com `Custom/` (por exemplo, `Custom/MyMetric`). Para mais informações sobre nomenclatura, veja [Coletar métrica personalizada](/docs/apm/agents/manage-apm-agents/agent-data/collect-custom-metrics/). - - -## Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$metric_name` - - _corda_ - - Obrigatório. O nome da métrica a ser incrementada. -
- -## Exemplos - -```cs -NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric"); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ispan.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ispan.mdx deleted file mode 100644 index 16a7be42cac..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/ispan.mdx +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: ISpan -type: apiDoc -shortDescription: Fornece acesso a métodos específicos de span na API New Relic. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -Public interface ISpan -``` - -Fornece acesso a métodos específicos de span na API New Relic. - -## Descrição - -Fornece acesso a métodos específicos de span na API do agente .NET da New Relic. Para obter uma referência a `ISpan`, use: - -* A propriedade `CurrentSpan` em [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent) (recomendado). -* A propriedade `CurrentSpan` em [`ITransaction`](/docs/agents/net-agent/net-agent-api/itransaction). - -Esta seção contém descrições e parâmetros dos métodos `ISpan` : - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- [`AddCustomAttribute`](#addcustomattribute) - - Adicione informações contextuais da sua aplicação ao período atual em forma de atributo. -
- [`SetName`](#setname) - - Altera o nome do intervalo/segmento/métrica atual que será relatado ao New Relic. -
- -## AdicionarAtributoCustom [#addcustomattribute] - -Adiciona informações contextuais sobre sua aplicação ao intervalo atual na forma de [atributo](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). - -Este método requer a versão do agente .NET e a API do agente .NET [versão 8.25](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) ou superior. - -### Sintaxe - -```cs -ISpan AddCustomAttribute(string key, object value) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `key` - - _corda_ - - Identifica as informações que estão sendo relatadas. Também conhecido como nome. - - * Chaves vazias não são suportadas. - * As chaves são limitadas a 255 bytes. atributo com chaves maiores que 255 bytes será ignorado. -
- `value` - - _objeto_ - - O valor que está sendo informado. - - **Note**: `null` valores não serão registrados. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Tipo .NET - - Como o valor será representado -
- `byte`, `Int16`, `Int32`, `Int64` - - `sbyte`, `UInt16`, `UInt32`, `UInt64` - - Como valor integral. -
- `float`, `double`, `decimal` - - Um número baseado em decimal. -
- `string` - - Uma string truncada após 255 bytes. - - Strings vazias são suportadas. -
- `bool` - - Verdadeiro ou falso. -
- `DateTime` - - Uma representação de string seguindo o formato ISO-8601, incluindo informações de fuso horário: - - Exemplo: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - Um número decimal que representa o número de segundos. -
- todo o resto - - O método `ToString()` será aplicado. Os tipos personalizados devem ter uma implementação de `Object.ToString()` ou gerarão uma exceção. -
-
- -### Devoluções - -Uma referência ao intervalo atual. - -### Considerações de uso - -Para obter detalhes sobre os tipos de dados suportados, consulte o [guia de atributo personalizado](/docs/agents/net-agent/attributes/custom-attributes). - -## Exemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ISpan currentSpan = agent.CurrentSpan; - -currentSpan - .AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## Nome do conjunto [#setname] - -Altera o nome do segmento/span atual que será reportado ao New Relic. Para segmentos/extensões resultantes de instrumentação personalizada, o nome da métrica relatado à New Relic também será alterado. - -Este método requer a versão do agente .NET e a API do agente .NET versão 10.1.0 ou mais alto. - -### Sintaxe - -```cs -ISpan SetName(string name) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `name` - - _corda_ - - O novo nome do intervalo/segmento. -
- -### Devoluções - -Uma referência ao intervalo atual. - -## Exemplos - -```cs -[Trace] -public void MyTracedMethod() -{ - IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); - ISpan currentSpan = agent.CurrentSpan; - - currentSpan.SetName("MyCustomName"); -} -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx deleted file mode 100644 index a75b11918ac..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/itransaction.mdx +++ /dev/null @@ -1,604 +0,0 @@ ---- -title: ITransação -type: apiDoc -shortDescription: Fornece acesso a métodos específicos de transação na API New Relic. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API: provides transaction-specific methods, including attaching custom attributes.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -public interface ITransaction -``` - -Fornece acesso a métodos específicos de transação na API New Relic. - -## Descrição - -Fornece acesso a métodos específicos de transação na API do agente .NET da New Relic. Para obter uma referência a `ITransaction`, use o método de transação atual disponível em [`IAgent`](/docs/agents/net-agent/net-agent-api/iagent). - -Os seguintes métodos estão disponíveis em `ITransaction`: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- [`AcceptDistributedTraceHeaders`](#acceptdistributedtraceheaders) - - Aceita cabeçalhos de contexto do trace recebidos de outro serviço. -
- [`InsertDistributedTraceHeaders`](#insertdistributedtraceheaders) - - Adiciona cabeçalhos de contexto do trace a uma solicitação de saída. -
- [`AcceptDistributedTracePayload` (obsoleto)](#acceptdistributedtracepayload) - - Aceita uma carga útil distributed trace de entrada de outro serviço. -
- [`CreateDistributedTracePayload` (obsoleto)](#createdistributedtracepayload) - - Cria uma carga de distributed trace para inclusão em uma solicitação de saída. -
- [`AddCustomAttribute`](#addcustomattribute) - - Adicione informações contextuais da sua aplicação à transação atual em forma de atributo. -
- [`CurrentSpan`](#currentspan) - - Fornece acesso ao [span](/docs/agents/net-agent/net-agent-api/ispan) em execução atualmente, que fornece acesso a métodos específicos de span na API New Relic. -
- [`SetUserId`](#setuserid) - - Associa um ID de usuário à transação atual. -
- -## AcceptDistributedTraceHeaders - -`ITransaction.AcceptDistributedTraceHeaders` É usado para instrumentar o serviço chamado para inclusão em um distributed trace. Ele vincula os intervalos em um trace aceitando uma carga gerada por ou gerada por algum [`InsertDistributedTraceHeaders`](/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#transaction-handle-insertDistributedTraceHeaders) outro W3C Trace Context compatível com tracer. Este método aceita os cabeçalhos de uma solicitação recebida, procura cabeçalhos W3C Trace Context e, se não for encontrado, recorre aos cabeçalhos distributed trace da New Relic. Este método substitui o método [`AcceptDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#acceptdistributedtracepayload) obsoleto, que lida apenas com carga distributed trace do New Relic. - -### Sintaxe - -```cs -void AcceptDistributedTraceHeaders(carrier, getter, transportType) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- `carrier` - - _<T>_ - - Obrigatório. Fonte do contexto de entrada dos cabeçalhos de rastreamento. -
- `getter` - - _Func<T, string, IEnumerable<string>>_ - - Obrigatório. Função definida pelo chamador para extrair dados de cabeçalho da operadora. -
- `transportType` - - _Enumeração TransportType_ - - Obrigatório. Descreve o transporte da carga de entrada (por exemplo `TransportType.HTTP`). -
- -### Considerações de uso - -* [Distributed tracing deve estar ativado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `AcceptDistributedTraceHeaders` será ignorado se `InsertDistributedTraceHeaders` ou `AcceptDistributedTraceHeaders` já tiver sido chamado para esta transação. - -### Exemplo - -```cs -HttpContext httpContext = HttpContext.Current; -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -currentTransaction.AcceptDistributedTraceHeaders(httpContext, Getter, TransportType.HTTP); -IEnumerable Getter(HttpContext carrier, string key) -{ - string value = carrier.Request.Headers[key]; - return value == null ? null : new string[] { value }; -} -``` - -## InsertDistributedTraceHeaders - -`ITransaction.InsertDistributedTraceHeaders` é usado para implementar distributed tracing. Ele modifica o objeto transportador que é transmitido adicionando cabeçalhos de contexto de rastreamento W3C e cabeçalhos distributed trace New Relic. Os cabeçalhos New Relic podem ser desativados com `` na configuração. Este método substitui o método [`CreateDistributedTracePayload`](/docs/agents/net-agent/net-agent-api/itransaction#createdistributedtracepayload) obsoleto, que cria apenas carga distributed trace da New Relic. - -### Sintaxe - -```cs -void InsertDistributedTraceHeaders(carrier, setter) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- `carrier` - - _<T>_ - - Obrigatório. contêiner onde são inseridos os cabeçalhos do contexto do trace. -
- `setter` - - _Action<T, string, string>_ - - Obrigatório. Ação definida pelo chamador para inserir dados de cabeçalho na operadora. -
- -### Considerações de uso - -* [Distributed tracing deve estar ativado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). - -### Exemplo - -```cs -HttpWebRequest requestMessage = (HttpWebRequest)WebRequest.Create("https://remote-address"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction currentTransaction = agent.CurrentTransaction; -var setter = new Action((carrier, key, value) => { carrier.Headers?.Set(key, value); }); -currentTransaction.InsertDistributedTraceHeaders(requestMessage, setter); -``` - -## AcceptDistributedTracePayload [#acceptdistributedtracepayload] - - - Esta API não está disponível no agente .NET v9.0 ou superior. Use [`AcceptDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#acceptdistributedtraceheaders) em vez disso. - - -Aceita uma carga útil distributed trace de entrada de um serviço upstream. Chamar esse método vincula a transação do serviço upstream a essa transação. - -### Sintaxe - -```cs -void AcceptDistributedPayload(payload, transportType) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- `payload` - - _corda_ - - Obrigatório. Uma representação de cadeia de caracteres da carga útil distributed trace de entrada. -
- `transportType` - - _Tipo de transporte_ - _enumeração_ - - Recomendado. Descreve o transporte da carga de entrada (por exemplo, `http`). - - Padrão `TransportType.Unknown`. -
- -### Considerações de uso - -* [Distributed tracing deve estar ativado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* A carga útil pode ser uma string de texto simples ou codificada em Base64. -* `AcceptDistributedTracePayload` será ignorado se `CreateDistributedTracePayload` já tiver sido chamado para esta transação. - -### Exemplo - -```cs -//Obtain the information from the request object from the upstream caller. -//The method by which this information is obtain is specific to the transport -//type being used. For example, in an HttpRequest, this information is -//contained in the -header.KeyValuePair metadata = GetMetaDataFromRequest("requestPayload"); -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AcceptDistributedTracePayload(metadata.Value, TransportType.Queue); -``` - -## CreateDistributedTracePayload (obsoleto) [#createdistributedtracepayload] - - - Esta API não está disponível no agente .NET v9.0 ou superior. Use [`InsertDistributedTraceHeaders`](/docs/agents/net-agent/net-agent-api/itransaction/#insertdistributedtraceheaders) em vez disso. - - -Cria uma carga distributed trace para inclusão em uma solicitação de saída para um sistema downstream. - -### Sintaxe - -```cs -IDistributedTracePayload CreateDistributedTracePayload() -``` - -### Devoluções - -Um objeto que implementa `IDistributedTracePayload` que fornece acesso à carga distributed trace que foi criada. - -### Considerações de uso - -* [Distributed tracing deve estar ativado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing). -* `CreateDistributedTracePayload` será ignorado se `AcceptDistributedTracePayload` já tiver sido chamado para esta transação. - -### Exemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -IDistributedTracePayload payload = transaction.CreateDistributedTracePayload(); -``` - -## AdicionarAtributoCustom - -Adiciona informações contextuais sobre sua aplicação à transação atual na forma de [atributo](/docs/using-new-relic/welcome-new-relic/get-started/glossary#attribute). - -Este método requer a versão do agente .NET e a API do agente .NET [versão 8.24.244.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-8242440) ou superior. Ele substituiu o obsoleto [`AddCustomParameter`](/docs/agents/net-agent/net-agent-api/add-custom-parameter). - -### Sintaxe - -```cs -ITransaction AddCustomAttribute(string key, object value) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `key` - - _corda_ - - Identifica as informações que estão sendo relatadas. Também conhecido como nome. - - * Chaves vazias não são suportadas. - * As chaves são limitadas a 255 bytes. atributo com chaves maiores que 255 bytes será ignorado. -
- `value` - - _objeto_ - - O valor que está sendo informado. - - **Note**: `null` valores não serão registrados. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Tipo .NET - - Como o valor será representado -
- `byte`, `Int16`, `Int32`, `Int64` - - `sbyte`, `UInt16`, `UInt32`, `UInt64` - - Como valor integral. -
- `float`, `double`, `decimal` - - Um número baseado em decimal. -
- `string` - - Uma string truncada após 255 bytes. - - Strings vazias são suportadas. -
- `bool` - - Verdadeiro ou falso. -
- `DateTime` - - Uma representação de string seguindo o formato ISO-8601, incluindo informações de fuso horário: - - Exemplo: `2020-02-13T11:31:19.5767650-08:00` -
- `TimeSpan` - - Um número decimal que representa o número de segundos. -
- todo o resto - - O método `ToString()` será aplicado. Os tipos personalizados devem ter uma implementação de `Object.ToString()` ou gerarão uma exceção. -
-
- -### Devoluções - -Uma referência à transação atual. - -### Considerações de uso - -Para obter detalhes sobre os tipos de dados suportados, consulte o [Guia de atributo personalizado](/docs/agents/net-agent/attributes/custom-attributes). - -### Exemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.AddCustomAttribute("customerName","Bob Smith") - .AddCustomAttribute("currentAge",31) - .AddCustomAttribute("birthday", new DateTime(2000, 02, 14)) - .AddCustomAttribute("waitTime", TimeSpan.FromMilliseconds(93842)); -``` - -## Período Atual - -Fornece acesso ao [span](/docs/apm/agents/net-agent/net-agent-api/ispan/) em execução atualmente, disponibilizando [métodos específicos do span](/docs/apm/agents/net-agent/net-agent-api/ispan) na API New Relic. - -### Exemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -ISpan currentSpan = transaction.CurrentSpan; -``` - -## DefinirUserId - -Associa um ID de usuário à transação atual. - -Este método requer o agente .NET e a API do agente .NET [versão 10.9.0](/docs/release-notes/agent-release-notes/net-release-notes/net-agent-1090) ou superior. - -### Sintaxe - -```cs -ITransaction SetUserId(string userId) -``` - -### Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `userId` - - _corda_ - - O ID do usuário a ser associado a esta transação. - - * `null`, os valores vazios e de espaço em branco serão ignorados. -
- -### Exemplo - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -ITransaction transaction = agent.CurrentTransaction; -transaction.SetUserId("BobSmith123"); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx deleted file mode 100644 index eccb0272cd4..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api.mdx +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: NoticeError (API do agente .NET) -type: apiDoc -shortDescription: 'Observe um erro e reporte à New Relic, juntamente com um atributo personalizado opcional.' -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to capture exceptions or error messages and report them. -freshnessValidatedDate: never -translationType: machine ---- - -## Sobrecargas [#overloads] - -Observe um erro e reporte à New Relic, juntamente com um atributo personalizado opcional. - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception); -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes); -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected); -``` - -## Requisitos [#requirements] - -Esta chamada de API é compatível com: - -* Todas as versões do agente -* Todos os tipos de aplicativos - -## Descrição [#description] - -Observe um erro e relate-o à New Relic junto com um atributo personalizado opcional. Para cada transação, o agente retém apenas a exceção e o atributo da primeira chamada para `NoticeError()`. Você pode passar uma exceção real ou uma string para capturar uma mensagem de erro arbitrária. - -Se este método for invocado em uma [transação](/docs/glossary/glossary/#transaction), o agente reportará a exceção na transação pai. Se for invocado fora de uma transação, o agente criará um [tracede erro](/docs/errors-inbox/errors-inbox) e categorizará o erro na interface do New Relic como uma chamada de API `NewRelic.Api.Agent.NoticeError`. Se invocada fora de uma transação, a chamada `NoticeError()` não contribuirá para a taxa de erros de um aplicativo. - -O agente adiciona o atributo apenas ao erro de rastreamento; não os envia para a New Relic. Para obter mais informações, consulte [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute). - -Os erros relatados com esta API ainda são enviados para a New Relic quando são relatados em uma transação que resulta em um código de status HTTP, como `404`, configurado para ser ignorado pela configuração do agente. Para obter mais informações, consulte nossa documentação sobre [gerenciamento de erros no APM](/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected). - -Revise as seções abaixo para ver exemplos de como usar esta chamada. - -## NoticeError (Exceção) [#exception-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception) -``` - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$exception` - - _Exceção_ - - Obrigatório. O `Exception` que você deseja instrumento. Somente os primeiros 10.000 caracteres do stack trace são retidos. -
- -## NoticeError(Exception, IDictionary) [#exception-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(Exception $exception, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$exception` - - _Exceção_ - - Obrigatório. O `Exception` que você deseja instrumento. Somente os primeiros 10.000 caracteres do stack trace são retidos. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Especifique pares de valor principal de atributo para anotar a mensagem de erro. O `TKey` deve ser uma string, o `TValue` pode ser uma string ou um objeto. -
- -## NoticeError(String, IDictionary) [#string-idictionary-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes) -``` - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$error_message` - - _corda_ - - Obrigatório. Especifique uma string para reportar ao New Relic como se fosse uma exceção. Este método cria [eventos de erro](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) e [rastreamentos de erro](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details). Somente os primeiros 1.023 caracteres são retidos no evento de erro, enquanto o rastreamento de erro retém a mensagem completa. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Obrigatório (pode ser nulo). Especifique pares de valor principal de atributo para anotar a mensagem de erro. O `TKey` deve ser uma string, o `TValue` pode ser uma string ou objeto, para não enviar atributo passe `null`. - -
- -## NoticeError(String, IDictionary, bool) [#string-idictionary-bool-overload] - -```cs -NewRelic.Api.Agent.NewRelic.NoticeError(string $error_message, IDictionary $attributes, bool $is_expected) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$error_message` - - _corda_ - - Obrigatório. Especifique uma string para reportar ao New Relic como se fosse uma exceção. Este método cria [eventos de erro](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#events) e [rastreamentos de erro](/docs/apm/apm-ui-pages/error-analytics/manage-error-data#trace-details). Somente os primeiros 1.023 caracteres são retidos no evento de erro, enquanto o rastreamento de erro retém a mensagem completa. -
- `$attributes` - - _IDictionary<TKey, TValue>_ - - Obrigatório (pode ser nulo). Especifique pares de valor principal de atributo para anotar a mensagem de erro. O `TKey` deve ser uma string, o `TValue` pode ser uma string ou objeto, para não enviar nenhum atributo passe `null`. -
- `$is_expected` - - _bool_ - - Marque o erro como esperado para que não afete a pontuação do Apdex e a taxa de erros. -
- -## Passe uma exceção sem atributo personalizado [#exception-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError(ex); -} -``` - -## Passe uma exceção com atributo personalizado [#exception-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary() {{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError(ex, errorAttributes); -} -``` - -## Passar uma string de mensagem de erro com atributo personalizado [#string-yes-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - var errorAttributes = new Dictionary{{"foo", "bar"},{"baz", "luhr"}}; - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", errorAttributes); -} -``` - -## Passar uma string de mensagem de erro sem atributo personalizado [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null); -} -``` - -## Passe uma string de mensagem de erro e marque-a como esperado [#string-no-attributes] - -```cs -try -{ - string ImNotABool = "43"; - bool.Parse(ImNotABool); -} -catch (Exception ex) -{ - NewRelic.Api.Agent.NewRelic.NoticeError("String error message", null, true); -} -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx deleted file mode 100644 index d8bf5be310b..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: RecordCustomEvent (API do agente .NET) -type: apiDoc -shortDescription: Registra um evento personalizado com o nome e atributo fornecidos. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to report custom event data to New Relic. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable attributeValues) -``` - -Registra um evento personalizado com o nome e atributo fornecidos. - -## Requisitos - -Versão do agente 4.6.29.0 ou superior. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Registra um [evento personalizado](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#event-data) com o nome e atributo fornecido, que você pode consultar no [criador de consulta](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder). Para verificar se um evento está sendo registrado corretamente, procure os dados no [dashboard](/docs/query-your-data/explore-query-data/dashboards/introduction-new-relic-one-dashboards). - -Para chamadas de API relacionadas, consulte o [guia de API do agente .NET](/docs/agents/net-agent/api-guides/guide-using-net-agent-api#custom-data). - - - * O envio de muitos eventos pode aumentar a sobrecarga de memória do agente. - * Além disso, postagens com tamanho superior a 1MB (10^6 bytes) não serão gravadas independente do número máximo de eventos. - * Eventos personalizados estão limitados a 64 atributos. - * Para mais informações sobre como são processados os valores de atributo personalizado, consulte o guia [atributo personalizado](/docs/agents/net-agent/attributes/custom-attributes) . - - -## Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `eventType` - - _corda_ - - Obrigatório. O nome do tipo de evento a ser registrado. Strings com mais de 255 caracteres farão com que a chamada de API não seja enviada para o New Relic. O nome só pode conter caracteres alfanuméricos, sublinhados `_` e dois pontos `:`. Para restrições adicionais sobre nomes de tipos de eventos, consulte [Palavras reservadas](/docs/data-apis/custom-data/custom-events/data-requirements-limits-custom-event-data/#reserved-words). -
- `attributeValues` - - _IEnumerable<string, object>_ - - Obrigatório. Especifique pares de valores principais de atributo para anotar o evento. -
- -## Exemplos - -### Valores de registro [#record-strings] - -```cs -var eventAttributes = new Dictionary() -{ -  {"foo", "bar"}, -  {"alice", "bob"}, -  {"age", 32}, -  {"height", 21.3f} -}; - -NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx deleted file mode 100644 index 96ec16f2a49..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordMetric (API do agente .NET) -type: apiDoc -shortDescription: Registra uma métrica personalizada com o nome fornecido. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.RecordMetric(string $metric_name, single $metric_value) -``` - -Registra uma métrica personalizada com o nome fornecido. - -## Requisitos - -Compatível com todas as versões do agente. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Registra uma [métrica personalizada](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics) com o nome fornecido. Para visualizar essas métricas personalizadas, utilize o [criador de consulta](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) para pesquisar métricas e criar gráficos customizáveis. Consulte também [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) e [`RecordResponseTimeMetric()`](/docs/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent). - - - Ao criar uma métrica personalizada, comece o nome com `Custom/` (por exemplo, `Custom/MyMetric`). - - -## Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$metric_name` - - _corda_ - - Obrigatório. O nome da métrica a ser registrada. Apenas os primeiros 255 caracteres são mantidos. -
- `$metric_value` - - _solteiro_ - - Obrigatório. A quantidade a ser registrada para a métrica. -
- -## Exemplos - -### Registrar o tempo de resposta de um processo adormecido [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordMetric("Custom/DEMO_Record_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx deleted file mode 100644 index 44a111f0ad3..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: RecordResponseTimeMetric (API do agente .NET) -type: apiDoc -shortDescription: Registra uma métrica personalizada com o nome fornecido e o tempo de resposta em milissegundos. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to record response time as custom metric timeslice data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value) -``` - -Registra uma métrica personalizada com o nome fornecido e o tempo de resposta em milissegundos. - -## Requisitos - -Compatível com todas as versões do agente. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Registra o tempo de resposta em milissegundos para uma [métrica personalizada](/docs/agents/manage-apm-agents/agent-metrics/custom-metrics). Para visualizar essas métricas personalizadas, utilize o [criador de consulta](/docs/query-your-data/explore-query-data/query-builder/use-advanced-nrql-mode-specify-data) para pesquisar métricas e criar gráficos customizáveis. Consulte também [`IncrementCounter()`](/docs/agents/net-agent/net-agent-api/incrementcounter-net-agent) e [`RecordMetric()`](/docs/agents/net-agent/net-agent-api/recordmetric-net-agent). - - - Ao criar uma métrica personalizada, comece o nome com `Custom/` (por exemplo, `Custom/MyMetric`). - - -## Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$metric_name` - - _corda_ - - Obrigatório. O nome da métrica de tempo de resposta a ser registrada. Apenas os primeiros 255 caracteres são mantidos. -
- `$metric_value` - - _Int64_ - - Obrigatório. O tempo de resposta para gravar em milissegundos. -
- -## Exemplos - -### Registrar o tempo de resposta de um processo adormecido [#record-stopwatch] - -```cs -Stopwatch stopWatch = Stopwatch.StartNew(); -System.Threading.Thread.Sleep(5000); -stopWatch.Stop(); -NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx deleted file mode 100644 index 42b14ebc437..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-application-name.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: SetApplicationName (API do agente .NET) -type: apiDoc -shortDescription: Defina o nome do aplicativo para agregar dados. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to set the New Relic app name, which controls data rollup.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName(string $name[, string $name_2, string $name_3]) -``` - -Defina o nome do aplicativo para agregar dados. - -## Requisitos - -Versão do agente 5.0.136.0 ou superior. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Defina os nomes dos aplicativos relatados à New Relic. Para obter mais informações sobre nomenclatura de aplicativos, consulte [Nomeie seu aplicativo .NET](/docs/agents/net-agent/installation-configuration/name-your-net-application). Este método deve ser chamado uma vez, durante a inicialização de um aplicativo. - - - A atualização do nome do aplicativo força a reinicialização do agente. O agente descarta quaisquer dados não relatados associados a nomes de aplicativos anteriores. Alterar o nome do aplicativo várias vezes durante o ciclo de vida de um aplicativo não é recomendado devido à perda de dados associada. - - -## Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$name` - - _corda_ - - Obrigatório. O nome do aplicativo principal. -
- `$name_2` - - `$name_3` - - _corda_ - - Opcional. Segundo e terceiro nomes para app agregar. Para obter mais informações, consulte [Usar vários nomes para um aplicativo](/docs/agents/manage-apm-agents/app-naming/use-multiple-names-app). -
- -## Exemplos - -```cs -NewRelic.Api.Agent.NewRelic.SetApplicationName("AppName1", "AppName2"); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx deleted file mode 100644 index f7723570106..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-transaction-uri.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: SetTransactionUri (API do agente .NET) -type: apiDoc -shortDescription: Define o URI da transação atual. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the URI of a transaction (use with attribute-based custom instrumentation). -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionUri(Uri $uri) -``` - -Define o URI da transação atual. - -## Requisitos - -Deve ser chamado dentro de uma [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -Versão do agente 6.16 ou superior. - - - Este método só funciona quando usado em uma transação criada usando o atributo `Transaction` com a propriedade `Web` definida como `true`. (Veja [instrumento usando atributo](/docs/agents/net-agent/api-guides/net-agent-api-instrument-using-attributes).) Ele fornece suporte para estrutura personalizada baseada na Web que o agente não suporta automaticamente. - - -## Descrição - -Define o URI da transação atual. O URI aparece em 'request.uri' [atributo](/docs/agents/net-agent/attributes/net-agent-attributes) de [rastreamento da transação](/docs/apm/transactions/transaction-traces/transaction-traces) e [evento de transação](/docs/using-new-relic/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data), podendo também afetar a nomenclatura da transação. - -Se você usar essa chamada diversas vezes na mesma transação, cada chamada substituirá a chamada anterior. A última chamada define o URI. - -**Note**: a partir da versão 8.18 do agente, o valor do atributo `request.uri` é definido como o valor da propriedade `Uri.AbsolutePath` do objeto `System.Uri` passado para a API. - -## Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$uri` - - _Uri_ - - O URI desta transação. -
- -## Exemplos - -```cs -var uri = new System.Uri("https://www.mydomain.com/path"); -NewRelic.Api.Agent.NewRelic.SetTransactionUri(uri); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx deleted file mode 100644 index 1aa61d2a8d5..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/set-user-parameters.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: SetUserParameters (agente .NET) -type: apiDoc -shortDescription: Crie um atributo personalizado relacionado ao usuário. AddCustomAttribute() é mais flexível. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach user-related custom attributes to APM and browser events. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value) -``` - -Crie um atributo personalizado relacionado ao usuário. [`AddCustomAttribute`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) é mais flexível. - -## Requisitos - -Compatível com todas as versões do agente. - -Deve ser chamado dentro de uma [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descrição - - - Esta chamada permite apenas atribuir valores a chaves pré-existentes. Para um método mais flexível para criar pares de valores principais, use [`AddCustomAttribute()`](/docs/agents/net-agent/net-agent-api/itransaction). - - -Definir [atributo personalizado](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute)relacionado ao usuário para associar a uma visualização de página do browser (nome de usuário, nome de conta e nome de produto). Os valores são automaticamente associados a chaves pré-existentes (`user`, `account` e `product`) e, em seguida, anexados à transação APM pai. Você também pode [anexar (ou "encaminhar") esses atributos](/docs/insights/new-relic-insights/decorating-events/insights-custom-attributes#forwarding-attributes) ao evento [PageView](/docs/agents/manage-apm-agents/agent-metrics/agent-attributes#destinations) do browser. - -## Parâmetro - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$user_value` - - _corda_ - - Obrigatório (pode ser nulo). Especifique um nome ou nome de usuário para associar a esta visualização de página. Este valor é atribuído à chave `user` . -
- `$account_value` - - _corda_ - - Obrigatório (pode ser nulo). Especifique o nome de uma conta de usuário a ser associada a esta visualização de página. Este valor é atribuído à chave `account` . -
- `$product_value` - - _corda_ - - Obrigatório (pode ser nulo). Especifique o nome de um produto a ser associado a esta visualização de página. Este valor é atribuído à chave `product` . -
- -## Exemplos - -### Registre três atributos de usuários [#report-three] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName"); -``` - -### Registre dois atributos de usuário e um atributo vazio [#report-two] - -```cs -NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName"); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx deleted file mode 100644 index eae48a191f4..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api.mdx +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: SetErrorGroupCallback (API do agente .NET) -type: apiDoc -shortDescription: Forneça um método de retorno de chamada para determinar o nome do grupo de erros com base nos dados do atributo -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to provide a callback method for determining the error group name for an error, based on attribute data.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(Func, string> errorGroupCallback); -``` - -Forneça um método de retorno de chamada que receba um `IReadOnlyDictionary` de dados de atributo e retorne um nome de grupo de erros. - -## Requisitos [#requirements] - -Esta chamada de API é compatível com: - -* Versões do agente >= 10.9.0 -* Todos os tipos de aplicativos - -## Descrição [#description] - -Configure um método de retorno de chamada que o agente usará para determinar o nome do grupo de erros para evento de erro e rastreio. Este nome é usado na Errors Inbox para agrupar erros em grupos lógicos. - -O método de retorno de chamada deve aceitar um único argumento do tipo `IReadOnlyDictionary` e retornar uma string (o nome do grupo de erros). O `IReadOnlyDictionary` é uma coleção de [dados de atributo](/docs/apm/agents/manage-apm-agents/agent-data/agent-attributes/) associados a cada evento de erro, incluindo atributo personalizado. - -A lista exata de atributos disponíveis para cada erro irá variar dependendo de: - -* Qual código do aplicativo gerou o erro -* Definições de configuração do agente -* Se algum atributo personalizado foi adicionado - -Contudo, deverá sempre existir o seguinte atributo: - -* `error.class` -* `error.message` -* `stack_trace` -* `transactionName` -* `request.uri` -* `error.expected` - -Uma cadeia de caracteres vazia pode ser retornada para o nome do grupo de erros quando o erro não pode ser atribuído a um grupo de erros lógicos. - -## Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$callback` - - _'Func<IReadOnlyDictionary<string,object>,string>'_ - - O retorno de chamada para determinar o nome do grupo de erros com base nos dados do atributo. -
- -## Exemplos - -Agrupar erros por nome de classe de erro: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("error.class", out var errorClass)) - { - if (errorClass.ToString() == "System.ArgumentOutOfRangeException" || errorClass.ToString() == "System.ArgumentNullException") - { - errorGroupName = "ArgumentErrors"; - } - else - { - errorGroupName = "OtherErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` - -Erros de grupo por nome de transação: - -```cs -Func, string> errorGroupCallback = (attributes) => { - string errorGroupName = string.Empty; - if (attributes.TryGetValue("transactionName", out var transactionName)) - { - if (transactionName.ToString().IndexOf("WebTransaction/MVC/Home") != -1) - { - errorGroupName = "HomeControllerErrors"; - } - else - { - errorGroupName = "OtherControllerErrors"; - } - } - return errorGroupName; -}; - -NewRelic.Api.Agent.NewRelic.SetErrorGroupCallback(errorGroupCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx deleted file mode 100644 index da0bf6dc63a..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/setllmtokencountingcallback-net-agent-api.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: SetLlmTokenCountingCallback (API do agente .NET) -type: apiDoc -shortDescription: Forneça um método de retorno de chamada que determine a contagem token para uma conclusão do LLM -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to provide a callback method that determines the token count for an LLM completion. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(Func callback); -``` - -Forneça um método de retorno de chamada que calcule a contagem token . - -## Requisitos [#requirements] - -Esta chamada de API é compatível com: - -* Versões do agente >= 10.23.0 -* Todos os tipos de aplicativos - -## Descrição [#description] - -Defina um método de retorno de chamada que o agente usará para determinar a contagem token para um evento LLM. No modo de alta segurança ou quando a gravação de conteúdo estiver desabilitada, este método será chamado para determinar a contagem token para o evento LLM. - -O método de retorno de chamada deve aceitar dois argumentos do tipo `string` e retornar um número inteiro. O primeiro argumento de string é o nome do modelo LLM e o segundo argumento de string é a entrada para o LLM. O método de retorno de chamada deve retornar a contagem token para o evento LLM. Valores de 0 ou menos serão ignorados. - -## Parâmetro - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$callback` - - '\_Func<string, string, int>\_' - - O retorno de chamada para determinar a contagem token . -
- -## Exemplo - -```cs -Func llmTokenCountingCallback = (modelName, modelInput) => { - - int tokenCount = 0; - // split the input string by spaces and count the tokens - if (!string.IsNullOrEmpty(modelInput)) - { - tokenCount = modelInput.Split(' ').Length; - } - - return tokenCount; -}; - -NewRelic.Api.Agent.NewRelic.SetLlmTokenCountingCallback(llmTokenCountingCallback); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx deleted file mode 100644 index 368bd271450..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: SetTransactionName (API do agente .NET) -type: apiDoc -shortDescription: Define o nome da transação atual. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to customize the name of a transaction. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName(string $category, string $name) -``` - -Define o nome da transação atual. - -## Requisitos - -Compatível com todas as versões do agente. - -Deve ser chamado dentro de uma [transação](/docs/accounts-partnerships/education/getting-started-new-relic/glossary#transaction). - -## Descrição - -Define o nome da transação atual. Antes de usar esta chamada, certifique-se de compreender as implicações dos [problemas de agrupamento métrico](/docs/agents/manage-apm-agents/troubleshooting/metric-grouping-issues). - -Se você usar essa chamada diversas vezes na mesma transação, cada chamada substituirá a chamada anterior e a última chamada definirá o nome. - - - Não use colchetes `[suffix]` no final do nome da sua transação. O New Relic remove automaticamente os colchetes do nome. Em vez disso, use parênteses `(suffix)` ou outros símbolos, se necessário. - - -Valor exclusivo como URLs, títulos de páginas, valores hexadecimais, IDs de sessão e valores identificáveis exclusivamente não devem ser usados na nomenclatura de sua transação. Em vez disso, adicione esses dados à transação como um parâmetro personalizado com a chamada [`AddCustomAttribute()`](/docs/apm/agents/net-agent/net-agent-api/itransaction/#addcustomattribute) . - - - Não crie mais de 1000 nomes de transação exclusivos (por exemplo, evite nomear por URL se possível). Isso tornará seus gráficos menos úteis e você poderá atingir os limites definidos pela New Relic quanto ao número de nomes de transação exclusivos por conta. Também pode diminuir o desempenho do seu aplicativo. - - -## Parâmetro - - - - - - - - - - - - - - - - - - - - - - - -
- Parâmetro - - Descrição -
- `$category` - - _corda_ - - Obrigatório. A categoria desta transação, que você pode usar para distinguir diferentes tipos de transações. O padrão é **`Custom`**. Apenas os primeiros 255 caracteres são mantidos. -
- `$name` - - _corda_ - - Obrigatório. O nome da transação. Apenas os primeiros 255 caracteres são mantidos. -
- -## Exemplos - -```cs -NewRelic.Api.Agent.NewRelic.SetTransactionName("Other", "MyTransaction"); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx deleted file mode 100644 index d5d2fa4162a..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/start-agent.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: StartAgent (API do agente .NET) -type: apiDoc -shortDescription: Inicie o agente se ele ainda não tiver sido iniciado. Geralmente desnecessário. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: 'New Relic .NET agent API call to force the .NET agent to start, if it hasn''t been started already. Usually unnecessary, since the agent starts automatically.' -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent() -``` - -Inicie o agente se ele ainda não tiver sido iniciado. Geralmente desnecessário. - -## Requisitos - -Versão do agente 5.0.136.0 ou superior. - -Compatível com todos os tipos de aplicativos. - -## Descrição - -Inicia o agente se ainda não tiver sido iniciado. Essa chamada geralmente é desnecessária, pois o agente inicia automaticamente quando atinge um método instrumentado, a menos que você desative [`autoStart`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-autoStart). Se você usar [`SetApplicationName()`](/docs/agents/net-agent/net-agent-api/setapplicationname-net-agent), certifique-se de definir o nome do aplicativo **before** para iniciar o agente. - - - Este método inicia o agente de forma assíncrona (ou seja, não bloqueará a inicialização do aplicativo), a menos que você habilite [`syncStartup`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-syncStartup) ou [`sendDataOnExit`](/docs/apm/agents/net-agent/configuration/net-agent-configuration/#service-sendDataOnExit). - - -## Exemplos - -```cs -NewRelic.Api.Agent.NewRelic.StartAgent(); -``` \ No newline at end of file diff --git a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx b/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx deleted file mode 100644 index 81d6739b05a..00000000000 --- a/src/i18n/content/pt/docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: TraceMetadata (API do agente .NET) -type: apiDoc -shortDescription: Retorna propriedades no ambiente de execução atual usado para dar suporte ao rastreamento. -tags: - - Agents - - NET agent - - NET agent API -metaDescription: New Relic .NET agent API call to attach custom attributes to your transaction data. -freshnessValidatedDate: never -translationType: machine ---- - -## Sintaxe - -```cs -NewRelic.Api.Agent.TraceMetadata; -``` - -Retorna propriedades no ambiente de execução atual usado para dar suporte ao rastreamento. - -## Requisitos - -Versão do agente 8.19 ou superior. - -Compatível com todos os tipos de aplicativos. - -[Distributed tracing deve ser ativado](/docs/agents/net-agent/configuration/net-agent-configuration#distributed_tracing) para obter valores significativos. - -## Descrição - -Fornece acesso às seguintes propriedades: - -### Propriedades - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Nome - - Descrição -
- `TraceId` - - Retorna uma string representando o trace atualmente em execução. Se o ID trace não estiver disponível ou distributed tracing estiver desativado, o valor será `string.Empty`. -
- `SpanId` - - Retorna uma string que representa o intervalo em execução no momento. Se o ID do período não estiver disponível ou distributed tracing estiver desativado, o valor será `string.Empty`. -
- `IsSampled` - - Retornará `true` se o trace atual for amostrado para inclusão, `false` se for amostrado. -
- -## Exemplos - -```cs -IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent(); -TraceMetadata traceMetadata = agent.TraceMetadata; -string traceId = traceMetadata.TraceId; -string spanId = traceMetadata.SpanId; -bool isSampled = traceMetadata.IsSampled; -``` \ No newline at end of file diff --git a/src/nav/apm.yml b/src/nav/apm.yml index c271e046c19..8c591a0a9b0 100644 --- a/src/nav/apm.yml +++ b/src/nav/apm.yml @@ -383,51 +383,7 @@ pages: - title: Name queries path: /docs/apm/agents/net-agent/custom-instrumentation/query-naming - title: .NET agent API - pages: - - title: .NET agent API guide - path: /docs/apm/agents/net-agent/net-agent-api/guide-using-net-agent-api - - title: DisableBrowserMonitoring - path: /docs/apm/agents/net-agent/net-agent-api/disablebrowsermonitoring-net-agent-api - - title: GetAgent - path: /docs/apm/agents/net-agent/net-agent-api/getagent - - title: GetBrowserTimingHeader - path: /docs/apm/agents/net-agent/net-agent-api/getbrowsertimingheader-net-agent-api - - title: GetLinkingMetadata - path: /docs/apm/agents/net-agent/net-agent-api/getlinkingmetadata-net-agent-api - - title: IAgent - path: /docs/apm/agents/net-agent/net-agent-api/iagent - - title: ITransaction - path: /docs/apm/agents/net-agent/net-agent-api/itransaction - - title: ISpan - path: /docs/apm/agents/net-agent/net-agent-api/ispan - - title: IgnoreApdex - path: /docs/apm/agents/net-agent/net-agent-api/ignore-apdex - - title: IgnoreTransaction - path: /docs/apm/agents/net-agent/net-agent-api/ignore-transaction - - title: NoticeError - path: /docs/apm/agents/net-agent/net-agent-api/noticeerror-net-agent-api - - title: IncrementCounter - path: /docs/apm/agents/net-agent/net-agent-api/incrementcounter-net-agent-api - - title: RecordCustomEvent - path: /docs/apm/agents/net-agent/net-agent-api/recordcustomevent-net-agent-api - - title: RecordMetric - path: /docs/apm/agents/net-agent/net-agent-api/recordmetric-net-agent-api - - title: RecordResponseTimeMetric - path: /docs/apm/agents/net-agent/net-agent-api/recordresponsetimemetric-net-agent-api - - title: SetApplicationName - path: /docs/apm/agents/net-agent/net-agent-api/set-application-name - - title: SetErrorGroupCallback - path: /docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api - - title: SetTransactionName - path: /docs/apm/agents/net-agent/net-agent-api/settransactionname-net-agent-api - - title: SetTransactionUri - path: /docs/apm/agents/net-agent/net-agent-api/set-transaction-uri - - title: SetUserParameters - path: /docs/apm/agents/net-agent/net-agent-api/set-user-parameters - - title: StartAgent - path: /docs/apm/agents/net-agent/net-agent-api/start-agent - - title: TraceMetadata - path: /docs/apm/agents/net-agent/net-agent-api/tracemetadata-net-agent-api-0 + path: /docs/apm/agents/net-agent/net-agent-api/net-agent-api - title: Attributes path: /docs/apm/agents/net-agent/attributes pages: