Skip to content

Commit

Permalink
Merge pull request #16238 from ndesai-newrelic/develop
Browse files Browse the repository at this point in the history
hybrid agent release
  • Loading branch information
ally-sassman committed Feb 26, 2024
2 parents 04c8bc5 + 3f17351 commit 8f164de
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ First, you'll need to add our agent, a NuGet package, to your MAUI project:
</Step>
<Step>
### Copy your application token from the UI [#app-token]
The application token is used for New Relic to authenticate your .NET MAUI app's data.
The application token is used for New Relic to authenticate your .NET MAUI app's data.
To view and copy your application token in the New Relic UI:
1. Go to **[one.newrelic.com](https://one.newrelic.com/all-capabilities)**, click **Add data**, then click **Mobile**.
2. Select your .NET MAUI app.
2. Select your .NET MAUI app.
3. Go to **Settings > Application** and copy the displayed **Application token**.


Expand All @@ -77,21 +77,22 @@ using NewRelic.MAUI.Plugin;
{
InitializeComponent();
MainPage = new AppShell();

CrossNewRelic.Current.HandleUncaughtException();
CrossNewRelic.Current.TrackShellNavigatedEvents();
// Set optional agent configuration
// Options are: crashReportingEnabled, loggingEnabled, logLevel, collectorAddress, crashCollectorAddress
// AgentStartConfiguration agentConfig = new AgentStartConfiguration(true, true, LogLevel.INFO, "mobile-collector.newrelic.com", "mobile-crash.newrelic.com");
// Options are: crashReportingEnabled, loggingEnabled, logLevel, collectorAddress, crashCollectorAddress,analyticsEventEnabled, networkErrorRequestEnabled, networkRequestEnabled, interactionTracingEnabled,webViewInstrumentation, fedRampEnabled
// AgentStartConfiguration agentConfig = new AgentStartConfiguration(crashReportingEnabled:false);
if (DeviceInfo.Current.Platform == DevicePlatform.Android)
{
CrossNewRelic.Current.Start("<YOUR_APP_TOKEN>");
// Start with optional agent configuration
// Start with optional agent configuration
// CrossNewRelic.Current.Start("<YOUR_APP_TOKEN>", agentConfig);
} else if (DeviceInfo.Current.Platform == DevicePlatform.iOS)
{
CrossNewRelic.Current.Start("<YOUR_APP_TOKEN>");
// Start with optional agent configuration
// Start with optional agent configuration
// CrossNewRelic.Current.Start("<YOUR_APP_TOKEN>", agentConfig);
}
}
Expand Down Expand Up @@ -239,4 +240,4 @@ The following customizations are available for the .NET MAUI agent.

Missing HTTP data in the UI?

After installing the .NET MAUI agent, wait at least 5 minutes. If no HTTP data appears on the HTTP errors and HTTP requests UI pages, make sure you used `HttpMessageHandler` in `HttpClient`.
After installing the .NET MAUI agent, wait at least 5 minutes. If no HTTP data appears on the HTTP errors and HTTP requests UI pages, make sure you used `HttpMessageHandler` in `HttpClient`.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ You'll also need to add our iOS agent binding to your `Xamarin.iOS` project:
</Step>
<Step>
### Copy your application token from the UI [#app-token]
The application token is used for New Relic to authenticate your Xamarin app's data.
The application token is used for New Relic to authenticate your Xamarin app's data.
To view and copy your application token in the New Relic UI:
1. Go to **[one.newrelic.com](https://one.newrelic.com/all-capabilities)**, click **Add data**, then click **Mobile**.
2. Select your Xamarin app.
2. Select your Xamarin app.
3. Go to **Settings > Application** and copy the displayed **Application token**.

You'll add this application token in the next step.
Expand All @@ -83,17 +83,18 @@ using NewRelic.Xamarin.Plugin;
CrossNewRelicClient.Current.HandleUncaughtException();
CrossNewRelicClient.Current.TrackShellNavigatedEvents()
// Set optional agent configuration
// Options are: crashReportingEnabled, loggingEnabled, logLevel, collectorAddress, crashCollectorAddress
// AgentStartConfiguration agentConfig = new AgentStartConfiguration(true, true, LogLevel.INFO, "mobile-collector.newrelic.com", "mobile-crash.newrelic.com");
if (Device.RuntimePlatform == Device.Android)
// Options are: crashReportingEnabled, loggingEnabled, logLevel, collectorAddress, crashCollectorAddress,analyticsEventEnabled, networkErrorRequestEnabled, networkRequestEnabled, interactionTracingEnabled,webViewInstrumentation, fedRampEnabled
// AgentStartConfiguration agentConfig = new AgentStartConfiguration(crashReportingEnabled:false);
if (Device.RuntimePlatform == Device.Android)
{
CrossNewRelicClient.Current.Start("<YOUR_APP_TOKEN>");
// Start with optional agent configuration
// CrossNewRelicClient.Current.Start("<YOUR_APP_TOKEN>", agentConfig);
} else if (Device.RuntimePlatform == Device.iOS)
{
CrossNewRelicClient.Current.Start("<YOUR_APP_TOKEN>");
// Start with optional agent configuration
// Start with optional agent configuration
// CrossNewRelicClient.Current.Start("<YOUR_APP_TOKEN>", agentConfig);
}
}
Expand Down Expand Up @@ -241,4 +242,4 @@ The following customizations are available for the Xamarin agent.

Missing HTTP data in the UI?

After installing the .NET MAUI agent, wait at least 5 minutes. If **No HTTP data appears:** on the HTTP errors and HTTP requests UI pages, make sure you used `HttpMessageHandler` in `HttpClient`.
After installing the .NET MAUI agent, wait at least 5 minutes. If **No HTTP data appears:** on the HTTP errors and HTTP requests UI pages, make sure you used `HttpMessageHandler` in `HttpClient`.

0 comments on commit 8f164de

Please sign in to comment.