From decb0cb78b359b11e2e6862ea1b785a9ac36245b Mon Sep 17 00:00:00 2001 From: a-sassman Date: Fri, 11 Oct 2024 11:33:35 -0700 Subject: [PATCH 1/5] chore(style): create a cheat sheet for the style guide --- src/content/docs/style-guide/cheat-sheet.mdx | 80 ++++++++++++++++++++ src/nav/style-guide.yml | 2 + 2 files changed, 82 insertions(+) create mode 100644 src/content/docs/style-guide/cheat-sheet.mdx diff --git a/src/content/docs/style-guide/cheat-sheet.mdx b/src/content/docs/style-guide/cheat-sheet.mdx new file mode 100644 index 00000000000..0cd2ad598f3 --- /dev/null +++ b/src/content/docs/style-guide/cheat-sheet.mdx @@ -0,0 +1,80 @@ +--- +title: Cheat sheet for writers +--- + +Welcome to our style guide cheat sheet. This handy resource is designed to quickly guide you to the most essential pages within our style guide, based on our team's most frequently referenced pages. Consider this a companion to the main left-hand table of contents, where it may be hard to find what you're looking for. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/nav/style-guide.yml b/src/nav/style-guide.yml index addac1a660b..732afe2303b 100644 --- a/src/nav/style-guide.yml +++ b/src/nav/style-guide.yml @@ -5,6 +5,8 @@ pages: pages: - title: Introduction to the style guide path: /docs/style-guide/writing-strategies/introduction-style-guide + - title: Cheat sheet for writers + path: /docs/style-guide/cheat-sheet - title: Usage dictionary path: /docs/style-guide/word-choice/usage-dictionary - title: Contribute to the docs site From 1c14ddb69a6f265504bfd434c3732a7e0926476f Mon Sep 17 00:00:00 2001 From: Shawn Kilburn Date: Fri, 11 Oct 2024 16:34:33 -0700 Subject: [PATCH 2/5] fix(Mobile): Fixed codeblock issues --- .../mobile-sdk/add-tracked-headers.mdx | 80 +-- .../mobile-sdk/configure-settings.mdx | 564 +++++++++--------- .../mobile-sdk/create-attribute.mdx | 104 ++-- .../mobile-sdk/current-session-id.mdx | 146 ++--- .../increment-session-attribute-count.mdx | 112 ++-- .../mobile-sdk/mobile-sdk-api-guide.mdx | 4 +- .../mobile-sdk/name-interaction.mdx | 32 +- .../mobile-sdk/network-request-failures.mdx | 72 +-- .../mobile-sdk/network-request-success.mdx | 96 +-- .../mobile-sdk/record-breadcrumb.mdx | 104 ++-- .../mobile-sdk/record-custom-events.mdx | 136 ++--- .../mobile-sdk/record-custom-metrics.mdx | 112 ++-- .../mobile-sdk/record-errors.mdx | 84 +-- .../mobile-sdk/record-handled-exceptions.mdx | 68 +-- .../mobile-sdk/remove-all-attributes.mdx | 88 +-- .../mobile-sdk/remove-attribute.mdx | 94 +-- .../set-application-build-number.mdx | 32 +- .../mobile-sdk/set-application-version.mdx | 32 +- .../mobile-sdk/set-custom-user-id.mdx | 96 +-- .../mobile-sdk/set-max-event-buffer-time.mdx | 96 +-- .../mobile-sdk/set-max-event-pool-size.mdx | 96 +-- .../mobile-sdk/set-max-offline-storage.mdx | 120 ++-- .../mobile-sdk/shut-down-agent.mdx | 80 +-- .../mobile-sdk/start-interaction.mdx | 100 ++-- .../mobile-sdk/stop-interaction.mdx | 92 +-- .../mobile-sdk/test-crash-reporting.mdx | 88 +-- 26 files changed, 1364 insertions(+), 1364 deletions(-) diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx index acd7c9784fe..08a6957d332 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx @@ -48,15 +48,15 @@ freshnessValidatedDate: 2023-11-02 ### Java [#java] - ```java +```java NewRelic.addHTTPHeadersTrackingFor(List headers) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.addHTTPHeadersTrackingFor(List headers) - ``` +``` ## Description [#description] @@ -109,7 +109,7 @@ freshnessValidatedDate: 2023-11-02 ### Java [#java] - ```java +```java List headers = new ArrayList(); headers.add("httpClient"); headers.add("CustomAttribute"); @@ -121,11 +121,11 @@ freshnessValidatedDate: 2023-11-02 .addHeader("httpClient","Okhttp3") .addHeader("CustomAttribute","OutOfMemoryAPI") .build(); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val headers = mutableListOf() headers.add("httpClient") @@ -142,7 +142,7 @@ freshnessValidatedDate: 2023-11-02 .addHeader("httpClient", "Okhttp3") .addHeader("CustomAttribute", "OutOfMemoryAPI") .build() - ``` +``` @@ -150,15 +150,15 @@ freshnessValidatedDate: 2023-11-02 ### Objective-c - ```objectivec +```objectivec (void)addHTTPHeaderTrackingFor:(NSArray*_Nonnull)headers; - ``` +``` ### Swift [#swift] - ```swift +```swift func addHTTPHeaderTracking(for: [String]) - ``` +``` ## Description [#description] @@ -205,7 +205,7 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: - ```objectivec +```objectivec [NewRelic addHTTPHeadersTrackingFor:@[@"Example", @"Example2"]]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.newrelic.com"]]; @@ -214,16 +214,16 @@ freshnessValidatedDate: 2023-11-02 [mutableRequest addValue:@"Test2" forHTTPHeaderField:@"Example2"]; request = [mutableRequest copy]; [[NSURLSession sharedSession] dataTaskWithRequest:request]; - ``` +``` - ```swift +```swift NewRelic.addHTTPHeadersTracking(for:["Example", "Example2"]) var request = URLRequest(url: URL(string:"https://www.newrelic.com")!) request.addValue("Test", forHTTPHeaderField: "Example") request.addValue("Test2", forHTTPHeaderField: "Example2") URLSession.shared.dataTask(with: request) - ``` +``` @@ -231,9 +231,9 @@ freshnessValidatedDate: 2023-11-02 ### Typescript [#typescript] - ```js +```js NewRelic.addHTTPHeadersTrackingFor((options:{headers: string[]})) - ``` +``` ## Description [#description] @@ -286,9 +286,9 @@ freshnessValidatedDate: 2023-11-02 ### Typescript [#typescript] - ```ts +```ts NewRelicCapacitorPlugin.addHTTPHeadersTrackingFor({headers:["Car","Music"]}); - ``` +``` @@ -296,9 +296,9 @@ freshnessValidatedDate: 2023-11-02 ### Javascript [#javascript] - ```js +```js NewRelic.addHTTPHeadersTrackingFor(headers) - ``` +``` ## Description [#description] @@ -350,18 +350,18 @@ freshnessValidatedDate: 2023-11-02 ### Javascript [#javascript] - ```js +```js NewRelic.addHTTPHeadersTrackingFor(["Car"]); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp NewRelic.addHTTPHeadersTrackingFor(List headers) - ``` +``` ## Description [#description] @@ -411,20 +411,20 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: - ```csharp +```csharp List headers = new List(); headers.Add("Car"); headers.Add("Music"); CrossNewRelic.Current.AddHTTPHeadersTrackingFor(headers); - ``` +``` ## Syntax [#syntax] - ```dart +```dart NewRelic.addHTTPHeadersTrackingFor(List headers) - ``` +``` ## Description [#description] @@ -474,18 +474,18 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: - ```dart +```dart NewRelic.addHTTPHeadersTrackingFor(["Car"]); - ``` +``` ## Syntax [#syntax] - ```js +```js NewRelic.addHTTPHeadersTrackingFor(headers:string[]) - ``` +``` ## Description [#description] @@ -536,17 +536,17 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: - ```js +```js NewRelic.addHTTPHeadersTrackingFor(["Car"]); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp NewRelic.addHTTPHeadersTrackingFor(List headers) - ``` +``` ## Description [#description] @@ -598,12 +598,12 @@ freshnessValidatedDate: 2023-11-02 ## Example [#example] - ```csharp +```csharp List headers = new List(); headers.Add("Car"); headers.Add("Music"); CrossNewRelic.Current.AddHTTPHeadersTrackingFor(headers); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings.mdx index 40b8f6735fd..eed54ae6dc1 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings.mdx @@ -72,21 +72,21 @@ freshnessValidatedDate: 2024-09-06 * Change the setting on its own line for each specific condition. For example: - ```java +```java NewRelic.disableFeature(FeatureFlag.DefaultInteractions); NewRelic.enableFeature(FeatureFlag.CrashReporting); NewRelic.withApplicationToken().start(this.getApplication()); - ``` +``` OR * Change the setting as part of the agent start call using the `.with` method. For example: - ```java +```java NewRelic.withApplicationToken() .withDefaultInteractions(false) .withCrashReportingEnabled(true) .start(this.getApplication()); - ``` +``` ## Analytics settings @@ -111,9 +111,9 @@ freshnessValidatedDate: 2024-09-06 @@ -125,9 +125,9 @@ freshnessValidatedDate: 2024-09-06
TopicDescriptionStyle guide doc
Word choiceWord usage guidelines for things like update vs. upgrade, e.g. and i.e., and version numbering. + + [Usage dictionary](/docs/style-guide/word-choice/usage-dictionary/) + +
Capitalization and punctuationLearn what to capitalize (and what not to) for products, capabilities, and features. + + * [Product, capability, and feature usage](/docs/style-guide/capitalization/product-capability-feature-usage/) + * [Punctuation](/docs/style-guide/punctuation/) + +
ComponentsHow to use components like tables, buttons, and callouts.[Intro to components](/docs/style-guide/structure/intro-to-components/)
ImagesHow to handle screenshots, images, and embedding visuals within your docs. + * [Screenshots and images](/docs/style-guide/images/screenshots-images/) + * [Embedding images](/docs/style-guide/images/embed-images/) +
Docs-as-code essentialsLearn the structure of the docs site, how set up local environments, and go through workflows for writing and editing docs. + + * [Understanding the docs site structure](/docs/style-guide/writing-docs/processes-procedures/understand-edit-docs-site-structure/) + * [Navigation (working with `yml` files)](/docs/style-guide/writing-strategies/nav-best-practices/) + * [Tech writer workflow](/docs/style-guide/writing-docs/writer-workflow/tech-writer-workflow/) + * [Setting up a local environment](/docs/style-guide/writing-docs/writer-workflow/set-up-local/) + * [Useful terminal scripts](/docs/style-guide/writing-docs/writer-workflow/useful-scripts/) +
TemplatesTemplates and guidelines for writing different documentation types such as troubleshooting guides and release notes. + * [Overview of templates](/docs/style-guide/writing-docs/processes-procedures/use-content-types-text-formats/) + * [Troubleshooting template](/docs/style-guide/writing-docs/article-templates/troubleshooting-docs-guide/) + * [Release notes template](/docs/style-guide/writing-docs/processes-procedures/create-release-notes/) + * [What's new template](/docs/style-guide/writing-docs/article-templates/whats-new-template/) +
Hero-ingInformation about GitHub processes, merging, and the role of a Docs hero. + + * [What is a Docs hero?](/docs/agile-handbook/heroing/what-is-a-hero/) + * [GitHub intro](/docs/style-guide/writing-docs/writer-workflow/github-intro/) + +
- ```java +```java withAnalyticsEvents(false) - ``` +```
- ```java +```java FeatureFlag.AnalyticsEvents(true) - ``` +```
@@ -158,9 +158,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.AppStartMetrics(false) - ``` +``` @@ -186,9 +186,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java withApplicationVersion("MY APP VERSION") - ``` +``` @@ -198,9 +198,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java withBuildVersion("MY BUILD VERSION") - ``` +``` @@ -229,9 +229,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```java +```java NewRelic.enableFeature(FeatureFlag.BackgroundReporting) - ``` +``` @@ -258,9 +258,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java withCrashReportingEnabled(true) - ``` +``` @@ -270,9 +270,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.HandledExceptions(false) - ``` +``` @@ -282,9 +282,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.NativeReporting(false) - ``` +``` @@ -314,9 +314,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.DistributedTracing(false) - ``` +``` @@ -344,9 +344,9 @@ freshnessValidatedDate: 2024-09-06 Event persistence is disabled by default. To enable it, add the following feature flag: - ```java +```java NewRelic.enableFeature(FeatureFlag.EventPersistence) - ``` +``` @@ -375,9 +375,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.FedRampEnabled(false) - ``` +``` @@ -405,9 +405,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.InteractionTracing(false) - ``` +``` @@ -419,9 +419,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.DefaultInteractions(false) - ``` +``` @@ -449,9 +449,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java withLoggingEnabled(false) - ``` +``` @@ -470,9 +470,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java withLogLevel(AgentLog.ERROR) - ``` +``` @@ -500,9 +500,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.NetworkRequests(false) - ``` +``` @@ -514,9 +514,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.NetworkErrorRequests(false) - ``` +``` @@ -528,9 +528,9 @@ freshnessValidatedDate: 2024-09-06 - ```java +```java FeatureFlag.HttpResponseBodyCaptureEnabled(false) - ``` +``` @@ -561,9 +561,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is disabled by default. To enable it, add the following feature flag: - ```java +```java NewRelic.enableFeature(FeatureFlag.OfflineStorage) - ``` +``` @@ -576,15 +576,15 @@ freshnessValidatedDate: 2024-09-06 * Objective-C: - ```objectivec +```objectivec + [NewRelic startWithApplicationToken:] - ``` +``` * Swift: - ```swift +```swift NewRelic.start(withApplicationToken:) - ``` +``` ## Enable or disable feature flags [#ios-feature-flags] @@ -614,26 +614,26 @@ freshnessValidatedDate: 2024-09-06 Enable a feature flag: - ```objectivec +```objectivec +[NewRelic enableFeatures:(NRMAFeatureFlags)flags]; - ``` +``` Disable a feature flag: - ```objectivec +```objectivec +[NewRelic disableFeatures:(NRMAFeatureFlags)flags]; - ``` +``` Here is an example where: * Interaction tracing and experimental networking instrumentation are enabled. * `NSURLSession` instrumentation and crash reporting are disabled. - ```objectivec +```objectivec [NewRelic enableFeatures:NRFeatureFlag_SwiftInteractionTracing | NRFeatureFlag_FedRampEnabled]; [NewRelic disableFeatures:NRFeatureFlag_NSURLSessionInstrumentation | NRFeatureFlag_CrashReporting]; [NewRelic startWithApplicationToken:...]; - ``` +``` @@ -645,21 +645,21 @@ freshnessValidatedDate: 2024-09-06 Enable a feature flag: - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.[NRMAFeatureFlag]) - ``` +``` Disable a feature flag: - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.[NRMAFeatureFlag]) - ``` +``` Example to disable default interaction tracing: - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DefaultInteractions) - ``` +``` @@ -693,11 +693,11 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.start(withApplicationToken:YOUR_APP_TOKEN andCollectorAddress:"harvest-upload.domain.com" andCrashCollectorAddress:"crash-upload.domain.com"); - ``` +``` @@ -711,11 +711,11 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.start(withApplicationToken:YOUR_APP_TOKEN andCollectorAddress:"harvest-upload.domain.com" andCrashCollectorAddress:"crash-upload.domain.com"); - ``` +``` @@ -751,9 +751,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_CrashReporting) - ``` +``` @@ -765,9 +765,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_HandledExceptionEvents) - ``` +``` @@ -797,9 +797,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DistributedTracing) - ``` +``` @@ -831,9 +831,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DefaultInteractions) - ``` +``` @@ -847,9 +847,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_InteractionTracing) - ``` +``` @@ -865,9 +865,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_SwiftInteractionTracing) - ``` +``` @@ -879,9 +879,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_WebViewInstrumentation) - ``` +``` @@ -897,9 +897,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_GestureInstrumentation) - ``` +``` @@ -935,9 +935,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_ExperimentalNetworkingInstrumentation) - ``` +``` @@ -949,9 +949,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_NSURLSessionInstrumentation) - ``` +``` @@ -963,9 +963,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_NetworkRequestEvents) - ``` +``` @@ -977,9 +977,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_RequestErrorEvents) - ``` +``` @@ -991,9 +991,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_HttpResponseBodyCapture) - ``` +``` @@ -1005,9 +1005,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_SwiftAsyncURLSessionSupport) - ``` +``` @@ -1040,9 +1040,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_AppStartMetrics) - ``` +``` @@ -1072,9 +1072,9 @@ freshnessValidatedDate: 2024-09-06 - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_FedRampEnabled) - ``` +``` @@ -1104,9 +1104,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is disabled by default. To enable it, add the following feature flag: - ```swift +```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_OfflineStorage) - ``` +``` @@ -1136,9 +1136,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```swift +```swift NewRelic.enableFeatures([NRMAFeatureFlags.NRFeatureFlag_BackgroundReporting]) - ``` +``` Prerequisites in your iOS app project to use background instrumentation: @@ -1160,7 +1160,7 @@ freshnessValidatedDate: 2024-09-06 Here's a sample configuration: - ```typescript +```typescript import { NewRelicCapacitorPlugin, NREnums, AgentConfiguration } from '@newrelic/newrelic-capacitor-plugin'; import { Capacitor } from '@capacitor/core'; @@ -1191,7 +1191,7 @@ freshnessValidatedDate: 2024-09-06 } NewRelicCapacitorPlugin.start({appKey:appToken, agentConfiguration:agentConfig}) - ``` +``` ## Available configurations [#configurations] @@ -1215,9 +1215,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript analyticsEventEnabled: true - ``` +``` @@ -1227,9 +1227,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript crashReportingEnabled: true - ``` +``` @@ -1239,9 +1239,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript interactionTracingEnabled: true - ``` +``` @@ -1251,9 +1251,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript networkRequestEnabled: true - ``` +``` @@ -1263,9 +1263,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript networkErrorRequestEnabled: true - ``` +``` @@ -1275,9 +1275,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript httpResponseBodyCaptureEnabled: true - ``` +``` @@ -1287,9 +1287,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript loggingEnabled: true - ``` +``` @@ -1301,9 +1301,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript logLevel: NREnums.LogLevel.INFO - ``` +``` @@ -1313,9 +1313,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript webViewInstrumentation: true - ``` +``` @@ -1325,9 +1325,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript collectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -1337,9 +1337,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript crashCollectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -1349,9 +1349,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript sendConsoleEvents: true - ``` +``` @@ -1361,9 +1361,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript fedRampEnabled: false - ``` +``` @@ -1375,9 +1375,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is enabled by default. To disable it, add the following feature flag: - ```typescript +```typescript offlineStorageEnabled: false - ``` +``` @@ -1389,9 +1389,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```typescript +```typescript backgroundReportingEnabled: true - ``` +``` To use background instrumentation, you'll need the following in your iOS app project: @@ -1413,14 +1413,14 @@ freshnessValidatedDate: 2024-09-06 Here's a sample configuration: - ```typescript +```typescript # Disable Crash Reporting cordova plugin add https://github.com/newrelic/newrelic-cordova-plugin.git --variable IOS_APP_TOKEN="{ios-app-token}" --variable ANDROID_APP_TOKEN="{android-app-token}" --variable CRASH_REPORTING_ENABLED="false" --variable OFFLINE_STORAGE_ENABLED="false" - ``` +``` ## Available configurations [#configurations] @@ -1444,9 +1444,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript CRASH_REPORTING_ENABLED = "true" - ``` +``` @@ -1456,9 +1456,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript INTERACTION_TRACING_ENABLED = "true" - ``` +``` @@ -1468,9 +1468,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript networkRequestEnabled: true - ``` +``` @@ -1480,9 +1480,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript networkErrorRequestEnabled: true - ``` +``` @@ -1492,9 +1492,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript httpResponseBodyCaptureEnabled: true - ``` +``` @@ -1504,9 +1504,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript LOGGING_ENABLED = "true" - ``` +``` @@ -1518,9 +1518,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript LOG_LEVEL = "INFO" - ``` +``` @@ -1530,9 +1530,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript WEB_VIEW_INSTRUMENTATION = "true" - ``` +``` @@ -1542,9 +1542,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript COLLECTOR_ADDRESS = "crash-upload-delegate.domain.com" - ``` +``` @@ -1554,9 +1554,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript CRASH_COLLECTOR_ADDRESS = "crash-upload-delegate.domain.com" - ``` +``` @@ -1566,9 +1566,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript sendConsoleEvents: true - ``` +``` @@ -1578,9 +1578,9 @@ freshnessValidatedDate: 2024-09-06 - ```typescript +```typescript FEDRAMP_ENABLED = "false" - ``` +``` @@ -1592,9 +1592,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is enabled by default. To disable it, add the following feature flag: - ```typescript +```typescript OFFLINE_STORAGE_ENABLED = "false" - ``` +``` @@ -1606,9 +1606,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```typescript +```typescript BACKGROUND_REPORTING_ENABLED = "true" - ``` +``` To use background instrumentation, you'll need the following in your iOS app project: @@ -1630,7 +1630,7 @@ freshnessValidatedDate: 2024-09-06 Here's a sample configuration: - ```csharp +```csharp using NewRelic.MAUI.Plugin; ... @@ -1685,7 +1685,7 @@ freshnessValidatedDate: 2024-09-06 } - ``` +``` ## Available configurations [#configurations] @@ -1709,9 +1709,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp analyticsEventEnabled: true - ``` +``` @@ -1721,9 +1721,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp crashReportingEnabled: true - ``` +``` @@ -1733,9 +1733,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp loggingEnabled: true - ``` +``` @@ -1745,9 +1745,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp networkRequestEnabled: true - ``` +``` @@ -1757,9 +1757,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp networkErrorRequestEnabled: true - ``` +``` @@ -1769,9 +1769,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp interactionTracingEnabled: false - ``` +``` @@ -1781,9 +1781,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp webViewInstrumentation: false - ``` +``` @@ -1793,9 +1793,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp fedRampEnabled: false - ``` +``` @@ -1807,9 +1807,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp logLevel: NREnums.LogLevel.INFO - ``` +``` @@ -1819,9 +1819,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp collectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -1831,9 +1831,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp crashCollectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -1845,9 +1845,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is enabled by default. To disable it, add the following feature flag: - ```csharp +```csharp offlineStorageEnabled: false - ``` +``` @@ -1859,9 +1859,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```csharp +```csharp backgroundReportingEnabled: true - ``` +``` To use background instrumentation, you'll need the following in your iOS app project: @@ -1879,7 +1879,7 @@ freshnessValidatedDate: 2024-09-06 Here's a sample configuration: - ```dart +```dart if (Platform.isAndroid) { appToken = AppConfig.androidToken; } else if (Platform.isIOS) { @@ -1912,7 +1912,7 @@ freshnessValidatedDate: 2024-09-06 }, (Object error, StackTrace stackTrace) { NewrelicMobile.instance.recordError(error, stackTrace); }); - ``` +``` ## Available configurations [#configurations] @@ -1936,9 +1936,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart analyticsEventEnabled: true - ``` +``` @@ -1948,9 +1948,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart crashReportingEnabled: true - ``` +``` @@ -1960,9 +1960,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart interactionTracingEnabled: true - ``` +``` @@ -1972,9 +1972,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart networkRequestEnabled: true - ``` +``` @@ -1984,9 +1984,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart networkErrorRequestEnabled: true - ``` +``` @@ -1996,9 +1996,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart httpResponseBodyCaptureEnabled: true - ``` +``` @@ -2008,9 +2008,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart loggingEnabled: true - ``` +``` @@ -2022,9 +2022,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart logLevel: NREnums.LogLevel.INFO - ``` +``` @@ -2034,9 +2034,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart webViewInstrumentation: true - ``` +``` @@ -2046,9 +2046,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart collectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -2058,9 +2058,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart crashCollectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -2070,9 +2070,9 @@ freshnessValidatedDate: 2024-09-06 - ```dart +```dart sendConsoleEvents: true - ``` +``` @@ -2084,9 +2084,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is enabled by default. To disable it, add the following feature flag: - ```dart +```dart offlineStorageEnabled: false - ``` +``` @@ -2102,9 +2102,9 @@ freshnessValidatedDate: 2024-09-06 Distributed tracing is enabled by default. To disable it, add the following feature flag: - ```dart +```dart distributedTracingEnabled: false - ``` +``` @@ -2116,9 +2116,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```typescript +```typescript backgroundReportingEnabled: true - ``` +``` To use background instrumentation, you'll need the following in your iOS app project: @@ -2140,7 +2140,7 @@ freshnessValidatedDate: 2024-09-06 Here's a sample configuration: - ```javascript +```javascript import NewRelic from 'newrelic-react-native-agent'; import * as appVersion from './package.json'; import {Platform} from 'react-native'; @@ -2176,7 +2176,7 @@ freshnessValidatedDate: 2024-09-06 NewRelic.startAgent(appToken,agentConfiguration); NewRelic.setJSAppVersion(appVersion.version); AppRegistry.registerComponent(appName, () => App); - ``` +``` ## Available configurations [#configurations] @@ -2200,9 +2200,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript analyticsEventEnabled: true - ``` +``` @@ -2212,9 +2212,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript crashReportingEnabled: true - ``` +``` @@ -2224,9 +2224,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript interactionTracingEnabled: true - ``` +``` @@ -2236,9 +2236,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript networkRequestEnabled: true - ``` +``` @@ -2248,9 +2248,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript networkErrorRequestEnabled: true - ``` +``` @@ -2260,9 +2260,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript httpResponseBodyCaptureEnabled: true - ``` +``` @@ -2272,9 +2272,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript loggingEnabled: true - ``` +``` @@ -2286,9 +2286,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript logLevel: NREnums.LogLevel.INFO - ``` +``` @@ -2298,9 +2298,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript webViewInstrumentation: true - ``` +``` @@ -2310,9 +2310,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript collectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -2322,9 +2322,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript crashCollectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -2334,9 +2334,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript sendConsoleEvents: true - ``` +``` @@ -2346,9 +2346,9 @@ freshnessValidatedDate: 2024-09-06 - ```javascript +```javascript fedRampEnabled: false - ``` +``` @@ -2360,9 +2360,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is enabled by default. To disable it, add the following feature flag: - ```typescript +```typescript offlineStorageEnabled: false - ``` +``` @@ -2374,9 +2374,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```typescript +```typescript backgroundReportingEnabled: true - ``` +``` To use background instrumentation, you'll need the following in your iOS app project: @@ -2434,7 +2434,7 @@ freshnessValidatedDate: 2024-09-06 Here's a sample configuration: - ```csharp +```csharp public App () { InitializeComponent(); @@ -2464,7 +2464,7 @@ freshnessValidatedDate: 2024-09-06 } } } - ``` +``` ## Available configurations [#configurations] @@ -2488,9 +2488,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp analyticsEventEnabled: true - ``` +``` @@ -2500,9 +2500,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp crashReportingEnabled: true - ``` +``` @@ -2512,9 +2512,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp loggingEnabled: true - ``` +``` @@ -2524,9 +2524,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp networkRequestEnabled: true - ``` +``` @@ -2536,9 +2536,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp networkErrorRequestEnabled: true - ``` +``` @@ -2550,9 +2550,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp logLevel: NREnums.LogLevel.INFO - ``` +``` @@ -2562,9 +2562,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp collectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -2574,9 +2574,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp crashCollectorAddress: "crash-upload-delegate.domain.com" - ``` +``` @@ -2586,9 +2586,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp interactionTracingEnabled: false - ``` +``` @@ -2598,9 +2598,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp webViewInstrumentation: false - ``` +``` @@ -2610,9 +2610,9 @@ freshnessValidatedDate: 2024-09-06 - ```csharp +```csharp fedRampEnabled: false - ``` +``` @@ -2624,9 +2624,9 @@ freshnessValidatedDate: 2024-09-06 Offline storage is enabled by default. To disable it, add the following feature flag: - ```csharp +```csharp offlineStorageEnabled: false - ``` +``` @@ -2638,9 +2638,9 @@ freshnessValidatedDate: 2024-09-06 Background reporting is disabled by default. To enable it, add the following feature flag: - ```csharp +```csharp backgroundReportingEnabled: true - ``` +``` To use background instrumentation, you'll need the following in your iOS app project: diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/create-attribute.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/create-attribute.mdx index 7c3510fbb07..f47c0912a91 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/create-attribute.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/create-attribute.mdx @@ -65,17 +65,17 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.setAttribute(string $name, string or float $value) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setAttribute(name: String?, value: String?) NewRelic.setAttribute(name: String?, value: Double) NewRelic.setAttribute(name: String?, value: Boolean) - ``` +``` ## Description [#description] @@ -168,29 +168,29 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java boolean attributeSet = NewRelic.setAttribute("storeId", "SampleStoreId000"); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributeSet = NewRelic.setAttribute("storeId", "SampleStoreId000") - ``` +``` Here's an example of creating an attribute with the specified text name and numeric value: ### Java [#java] - ```java +```java boolean attributeSet = NewRelic.setAttribute("rate", 9999.99); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributeSet = NewRelic.setAttribute("rate", 9999.99) - ``` +``` @@ -198,15 +198,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ```objectivec +```objectivec setAttribute:(NSString*)name value:(id) value; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setAttribute(string $name, string or float $value) - ``` +``` ## Description [#description] @@ -297,25 +297,25 @@ freshnessValidatedDate: 2023-07-21 ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL attributeSet = [NewRelic setAttribute:@"buildConfiguration" value:@"AppStore-release"]; BOOL attributeSet = [NewRelic setAttribute:@"rate" value:@9999.99]; - ``` +``` ### Swift [#swift] - ```swift +```swift var attributeSet = NewRelic.setAttribute("buildConfiguration", value: "AppStore-release") attributeSet = NewRelic.setAttribute("rate", value: 9999.99) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setAttribute(options: { name: string; value: string; }) => void - ``` +``` ## Description [#description] @@ -373,17 +373,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.setAttribute({ name: "CapacitorAttribute", value: "123" }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setAttribute(attributeName: string, value: boolean | number | string): void; - ``` +``` ## Description [#description] @@ -441,21 +441,21 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.setAttribute(Name: "CordovaAttribute", value: "123"): void; - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetAttribute(string name, string value) : bool; SetAttribute(string name, double value) : bool; SetAttribute(string name, bool value) : bool; - ``` +``` ## Description [#description] @@ -513,19 +513,19 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.SetAttribute("MAUIBoolAttr", false); CrossNewRelic.Current.SetAttribute("MAUIStrAttr", "Cat"); CrossNewRelic.Current.SetAttribute("MAUINumAttr", 13.5); - ``` +``` ## Syntax [#syntax] - ```dart +```dart setAttribute (String name, dynamic value) : void; - ``` +``` ## Description [#description] @@ -583,17 +583,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.setAttribute('RNCustomAttrNumber', 37); - ``` +``` ## Syntax [#syntax] - ```js +```js setAttribute(name: string, value: boolean | number | string): void; - ``` +``` ## Description [#description] @@ -651,21 +651,21 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.setAttribute('RNCustomAttrNumber', 37); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp setAttribute(string name, string value) : bool; setAttribute(string name, double value) : bool; setAttribute(string name, bool value) : bool; - ``` +``` ## Description [#description] @@ -723,24 +723,24 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp NewRelicAgent.SetAttribute("UnityBoolCustomAttr", false); NewRelicAgent.SetAttribute("UnityStringCustomAttr", "Cat"); NewRelicAgent.SetAttribute('UnityCustomAttrNumber', 37); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp setStringAttribute(FString name,FString value) : void; setDoubleAttribute(FString name,double value):void; setBooleanAttribute(FString name ,bool value):void; - ``` +``` ## Description [#description] @@ -798,7 +798,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" @@ -808,7 +808,7 @@ freshnessValidatedDate: 2023-07-21 UNewRelicBPLibrary::setStringAttribute("Unreal String","From UnReal"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetAttribute(string name, string value) : bool; SetAttribute(string name, double value) : bool; SetAttribute(string name, bool value) : bool; - ``` +``` ## Description [#description] @@ -884,11 +884,11 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.SetAttribute("XamarinBoolAttr", false); CrossNewRelicClient.Current.SetAttribute("XamarinStrAttr", "Cat"); CrossNewRelicClient.Current.SetAttribute("XamarinNumAttr", 13.5); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx index b8064f2f166..40ee0eb92ff 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx @@ -65,15 +65,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java - NewRelic.currentSessionId() - ``` +```java +NewRelic.currentSessionId() +``` ### Kotlin [#kotlin] - ```kotlin - NewRelic.currentSessionId() - ``` +```kotlin +NewRelic.currentSessionId() +``` ## Description [#description] @@ -91,15 +91,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java - String sessionId = NewRelic.currentSessionId(); - ``` +```java +String sessionId = NewRelic.currentSessionId(); +``` ### Kotlin [#kotlin] - ```kotlin - val sessionId = NewRelic.currentSessionId() - ``` +```kotlin + val sessionId = NewRelic.currentSessionId() +``` @@ -107,15 +107,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec - + (NSString* _Null_unspecified) currentSessionId; - ``` +```objectivec ++ (NSString* _Null_unspecified) currentSessionId; +``` ### Swift [#swift] - ```swift - NewRelic.currentSessionId() - ``` +```swift +NewRelic.currentSessionId() +``` ## Description [#description] @@ -129,23 +129,23 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec - NSString* sessionId = [NewRelic currentSessionId()]; - ``` +```objectivec +NSString* sessionId = [NewRelic currentSessionId()]; +``` ### Swift [#swift] - ```swift - let sessionId = NewRelic.currentSessionId() - ``` +```swift +let sessionId = NewRelic.currentSessionId() +``` ## Syntax [#syntax] - ```typescript - currentSessionId(options?: {} | undefined) => Promise<{ sessionId: string; }> - ``` +```typescript +currentSessionId(options?: {} | undefined) => Promise<{ sessionId: string; }> +``` ## Description [#description] @@ -157,17 +157,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript - let { sessionId } = await NewRelicCapacitorPlugin.currentSessionId(); - ``` +```typescript + let { sessionId } = await NewRelicCapacitorPlugin.currentSessionId(); +``` ## Syntax [#syntax] - ```typescript - currentSessionId(): Promise; - ``` +```typescript +currentSessionId(): Promise; +``` ## Description [#description] @@ -179,17 +179,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js - let sessionId = await NewRelic.currentSessionId(); - ``` +```js +let sessionId = await NewRelic.currentSessionId(); +``` ## Syntax [#syntax] - ```csharp - CurrentSessionId() : string; - ``` +```csharp + CurrentSessionId() : string; +``` ## Description [#description] @@ -201,17 +201,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# - string sessionId = CrossNewRelic.Current.CurrentSessionId(); - ``` +```C# +string sessionId = CrossNewRelic.Current.CurrentSessionId(); +``` ## Syntax [#syntax] - ```dart - currentSessionId(): Promise; - ``` +```dart +currentSessionId(): Promise; +``` ## Description [#description] @@ -223,17 +223,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart - var sessionId = await NewrelicMobile.instance.currentSessionId(); - ``` +```dart +var sessionId = await NewrelicMobile.instance.currentSessionId(); +``` ## Syntax [#syntax] - ```js - currentSessionId(): Promise; - ``` +```js +currentSessionId(): Promise; +``` ## Description [#description] @@ -245,17 +245,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js - let sessionId = await NewRelic.currentSessionId(); - ``` +```js + let sessionId = await NewRelic.currentSessionId(); +``` ## Syntax [#syntax] - ```csharp - currentSessionId() : string; - ``` +```csharp +currentSessionId() : string; +``` ## Description [#description] @@ -267,17 +267,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp - string sessionId = NewRelicAgent.CurrentSessionId(); - ``` +```csharp + string sessionId = NewRelicAgent.CurrentSessionId(); +``` ## Syntax [#syntax] - ```cpp - currentSessionId() : FString; - ``` +```cpp +currentSessionId() : FString; +``` ## Description [#description] @@ -289,19 +289,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp - #include "NewRelicBPLibrary.h" +```cpp + #include "NewRelicBPLibrary.h" - FString id = UNewRelicBPLibrary::currentSessionId(); - ``` + FString id = UNewRelicBPLibrary::currentSessionId(); +``` ## Syntax [#syntax] - ```csharp - CurrentSessionId() : string; - ``` +```csharp +CurrentSessionId() : string; +``` ## Description [#description] @@ -313,9 +313,9 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp - string sessionId = CrossNewRelic.Current.CurrentSessionId(); - ``` +```csharp +string sessionId = CrossNewRelic.Current.CurrentSessionId(); +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/increment-session-attribute-count.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/increment-session-attribute-count.mdx index eeda276b29d..5e37cb2e5a6 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/increment-session-attribute-count.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/increment-session-attribute-count.mdx @@ -64,15 +64,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.incrementAttribute(string $name[, float $value]) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.incrementAttribute(name: String!, value : Double) - ``` +``` ## Description [#description] @@ -140,29 +140,29 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java boolean incremented = NewRelic.incrementAttribute("rate"); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val incremented = NewRelic.incrementAttribute("rate") - ``` +``` Here's an example to increment the count for the specified attribute by the float value amount: ### Java [#java] - ```java +```java boolean incremented = NewRelic.incrementAttribute("rate", 9999.99, false); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val incremented: Boolean = NewRelic.incrementAttribute("rate", 9999.99) - ``` +``` @@ -170,15 +170,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec +```objectivec incrementAttribute:(NSString*)name value:(NSNumber*)amount; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.incrementAttribute(string $name[, float $value]) - ``` +``` ## Description [#description] @@ -246,37 +246,37 @@ freshnessValidatedDate: 2023-07-20 Here's an example to increment the count for the specified session attribute by 1. If the attribute does not exist, it creates the attribute with a value of 1: - ```objectivec +```objectivec BOOL incremented = [NewRelic incrementAttribute@"rate"]; - ``` +``` Here's another example to increment the count for the specified session attribute by the amount specified in `NSNumber*`: - ```objectivec +```objectivec BOOL incremented = [NewRelic incrementAttribute:@"rate" value:@1]; - ``` +``` ### Swift [#swift] Here's an example to increment the count for the specified session attribute by 1. If the attribute does not exist, it creates the attribute with a value of 1: - ```swift +```swift let incremented = NewRelic.incrementAttribute("rate") - ``` +``` Here's another example to increment the count for the specified session attribute by the amount specified in `NSNumber!`: - ```swift +```swift let incremented = NewRelic.incrementAttribute(name: String!, value: NSNumber!) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript incrementAttribute(options: { name: string; value?: number; }) => void - ``` +``` ## Description [#description] @@ -338,17 +338,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.incrementAttribute({ name: 'CapacitorAttribute', value: 15 }) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript incrementAttribute(name: string, value?: number): void; - ``` +``` ## Description [#description] @@ -410,18 +410,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.incrementAttribute('CordovaCustomAttrNumber'); NewRelic.incrementAttribute('CordovaCustomAttrNumber', 5); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordCustomEvent(string eventType, string eventName, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -483,20 +483,20 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# +```C# // Increment by 1 CrossNewRelic.Current.IncrementAttribute("MAUINumAttr"); // Increment by value CrossNewRelic.Current.IncrementAttribute("MAUINumAttr", 12.3); - ``` +``` ## Syntax [#syntax] - ```dart +```dart incrementAttribute(name: string, value?: number): void; - ``` +``` ## Description [#description] @@ -558,18 +558,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.incrementAttribute("FlutterCustomAttrNumber"); NewrelicMobile.instance.incrementAttribute("FlutterCustomAttrNumber",value :5.0); - ``` +``` ## Syntax [#syntax] - ```js +```js incrementAttribute(name: string, value?: number): void; - ``` +``` ## Description [#description] @@ -631,18 +631,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.incrementAttribute('RNCustomAttrNumber'); NewRelic.incrementAttribute('RNCustomAttrNumber', 5); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp incrementAttribute(string name, float value = 1) : bool; - ``` +``` ## Description [#description] @@ -704,20 +704,20 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp // Increment by 1 NewRelicAgent.IncrementAttribute('UnityCustomAttrNumber'); // Increment by value NewRelicAgent.IncrementAttribute('UnityCustomAttrNumber', 5); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp incrementAttribute(FString name,double value): void; - ``` +``` ## Description [#description] @@ -775,19 +775,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp +```cpp // Increment by 1 UNewRelicBPLibrary::incrementAttribute("Unreal Double",5.0); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp IncrementAttribute(string name, float value = 1) : bool; - ``` +``` ## Description [#description] @@ -849,12 +849,12 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp // Increment by 1 CrossNewRelicClient.Current.IncrementAttribute("XamarinNumAttr"); // Increment by value CrossNewRelicClient.Current.IncrementAttribute("XamarinNumAttr", 12.3); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/mobile-sdk-api-guide.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/mobile-sdk-api-guide.mdx index 69637a9b61c..18b58f622f8 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/mobile-sdk-api-guide.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/mobile-sdk-api-guide.mdx @@ -67,9 +67,9 @@ The table below lists supported SDK methods to customize your mobile agent instr If you use these methods, the instrumented interactions will not show up on the [Interactions](/docs/mobile-monitoring/mobile-monitoring-ui/mobile-app-pages/interactions-page) page, but they can be still found with a NRQL query, such as: - ```sql + ```sql query SELECT name FROM Mobile SINCE 7 DAYS AGO - ``` + ``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/name-interaction.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/name-interaction.mdx index 3b88145bf06..d1bd1452cef 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/name-interaction.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/name-interaction.mdx @@ -37,15 +37,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.setInteractionName(string $interactionName) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setInteractionName(name: String?) - ``` +``` ## Description [#description] @@ -101,7 +101,7 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java public class MainActivity extends Activity { @Override @@ -114,13 +114,13 @@ freshnessValidatedDate: 2023-07-20 // ... continue methods ... } - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setInteractionName("Display MyCustomInteraction") - ``` +``` @@ -128,15 +128,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec +```objectivec - (NSString*) customNewRelicInteractionName; - ``` +``` ### Swift [#swift] - ```swift +```swift @objc func customNewRelicInteractionName() -> String - ``` +``` ## Description [#description] @@ -184,19 +184,19 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec +```objectivec - (NSString*) customNewRelicInteractionName { return @"CustomInteractionNameViewController"; } - ``` +``` ### Swift [#swift] - ```swift +```swift @objc func customNewRelicInteractionName() -> String { return "CustomInteractionNameViewController" } - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-failures.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-failures.mdx index 7642db33f60..a1a4d918a50 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-failures.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-failures.mdx @@ -52,13 +52,13 @@ freshnessValidatedDate: 2023-07-19 ### Java [#java] - ```java +```java NewRelic.noticeNetworkFailure(string $url, string $httpMethod, long $startTime, long $endTime, exception $exception OR enum $networkFailure) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.noticeNetworkFailure( url: String?, httpMethod: String?, @@ -66,7 +66,7 @@ freshnessValidatedDate: 2023-07-19 endTime: Long, failure: NetworkFailure?, ) - ``` +``` ## Description [#description] @@ -184,19 +184,19 @@ freshnessValidatedDate: 2023-07-19 ### Java [#java] - ```java +```java new Response.ErrorListener() { @Override public void onErrorResponse(Error error) { NewRelic.noticeNetworkFailure(badUrl, "GET", System.nanoTime(), System.nanoTime(), NetworkFailure.exceptionToNetworkFailure(error)); } - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.noticeNetworkFailure(badUrl, "GET", System.nanoTime(), System.nanoTime(), NetworkFailure.exceptionToNetworkFailure(error)) - ``` +``` @@ -204,18 +204,18 @@ freshnessValidatedDate: 2023-07-19 ### Objective-c [#objc] - ``` +``` + (void)noticeNetworkFailureForURL:(NSURL*)url httpMethod:(NSString*)httpMethod withTimer:(NRTimer*)timer andFailureCode:(NSInteger)iOSFailureCode; - ``` +``` ### Swift [#swift] - ```swift +```swift func noticeNetworkFailure(for: URL, httpMethod: String, with: NRTimer, andFailureCode: Int) - ``` +``` ## Description [#description] @@ -305,28 +305,28 @@ freshnessValidatedDate: 2023-07-19 ### Objective-C [#obj-c] - ```objectivec +```objectivec [NewRelic noticeNetworkFailureForURL:[NSURL URLWithString:@"https://www.newrelic.com"] httpMethod:@"GET" withTimer:[[NRTimer alloc] init] andFailureCode:NSURLErrorTimedOut]; - ``` +``` ### Swift - ```swift +```swift NewRelic.noticeNetworkFailure(for: URL(string: "https://www.newrelic.com"), httpMethod: "GET", with: NRTimer(), andFailureCode: NSURLErrorTimedOut) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript noticeNetworkFailure(url: string, httpMethod: string, startTime: number, endTime: number, failure: string): void; - ``` +``` ## Description [#description] @@ -428,17 +428,17 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```js +```js NewRelic.noticeNetworkFailure('https://fakewebsite.com', 'GET', Date.now(), Date.now(), 'BadURL'); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp void NoticeNetworkFailure(string url, string httpMethod, long startTime, long endTime, NetworkFailure failure); - ``` +``` ## Description [#description] @@ -540,7 +540,7 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.NoticeNetworkFailure( "https://fakewebsite.com", "GET", @@ -548,15 +548,15 @@ freshnessValidatedDate: 2023-07-19 DateTimeOffset.Now.ToUnixTimeMilliseconds() + 100, NetworkFailure.Unknown ); - ``` +``` ## Syntax [#syntax] - ```dart +```dart noticeNetworkFailure(String url,String httpMethod,int startTime,int endTime,NetworkFailure errorCode): void; - ``` +``` ## Description [#description] @@ -658,17 +658,17 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.noticeNetworkFailure("https://cb6b02be-a319-4de5-a3b1-361de2564493.mock.pstmn.io/searchpage", "GET", 1000, 2000,'Test Network Failure', NetworkFailure.dnsLookupFailed); - ``` +``` ## Syntax [#syntax] - ```js +```js noticeNetworkFailure(url: string, httpMethod: string, startTime: number, endTime: number, failure: string): void; - ``` +``` ## Description [#description] @@ -770,18 +770,18 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```js +```js NewRelic.noticeNetworkFailure('https://github.com', 'GET', Date.now(), Date.now(), NewRelic.NetworkFailure.BadURL); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp NoticeNetworkFailure(string url, string httpMethod, long startTime, long endTime, NetworkFailure failure) - ``` +``` ## Description [#description] @@ -883,7 +883,7 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.NoticeNetworkFailure( "https://fakewebsite.com", "GET", @@ -892,7 +892,7 @@ freshnessValidatedDate: 2023-07-19 NetworkFailure.Unknown ); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-success.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-success.mdx index 685b61f241c..d8106bdb495 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-success.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/network-request-success.mdx @@ -58,13 +58,13 @@ freshnessValidatedDate: 2023-07-19 ### Java [#java] - ```java +```java NewRelic.noticeHttpTransaction(string $url, string $httpMethod, int $statusCode, long $startTime, long $endTime, long $bytesSent, long $bytesReceived [, string $responseBody]) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.noticeHttpTransaction( url: String?, httpMethod: String?, @@ -75,7 +75,7 @@ freshnessValidatedDate: 2023-07-19 bytesReceived: Long, responseBody: String? ) - ``` +``` ## Description [#description] @@ -223,7 +223,7 @@ freshnessValidatedDate: 2023-07-19 ### Java [#java] - ```java +```java public class CustomHttpMetricsLogger implements Interceptor { @Override @@ -244,11 +244,11 @@ freshnessValidatedDate: 2023-07-19 return response; } } - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin class CustomInterceptor : Interceptor { override fun intercept(chain: Interceptor.Chain): Response { val t1 = System.nanoTime() @@ -261,7 +261,7 @@ freshnessValidatedDate: 2023-07-19 return aResponse } } - ``` +``` @@ -269,7 +269,7 @@ freshnessValidatedDate: 2023-07-19 ### Objective-c [#objc] - ```objectivec +```objectivec + (void)noticeNetworkRequestForURL:(NSURL*)url httpMethod:(NSString*)httpMethod withTimer:(NRTimer*)timer @@ -280,13 +280,13 @@ freshnessValidatedDate: 2023-07-19 responseData:(NSData *)responseData traceHeaders:(NSDictionary* _Nullable)traceHeaders andParams:(NSDictionary * _Nullable)params; - ``` +``` ### Swift [#swift] - ```swift +```swift func noticeNetworkRequest(for: URL, httpMethod: String, with: NRTimer, responseHeaders: [AnyHashable : Any], statusCode: Int, bytesSent: UInt, bytesReceived: UInt, responseData: Data, traceHeaders: [String : String], andParams: [AnyHashable : Any]) - ``` +``` ## Description [#description] @@ -494,43 +494,43 @@ freshnessValidatedDate: 2023-07-19 Here's an example of tracking a HTTP transaction: - ```objectivec +```objectivec [NewRelic noticeNetworkRequestForURL:[NSURL URLWithString:@"https://www.newrelic.com"] httpMethod:@"GET" withTimer:[[NRTimer alloc] init] responseHeaders:@{} statusCode:200 bytesSent:1024 bytesReceived:52 responseData:[NSData data] traceHeaders:nil andParams:nil]; - ``` +``` Here's an example with start and end times: - ```objectivec +```objectivec [NewRelic noticeNetworkRequestForURL:[NSURL URLWithString:@"https://www.newrelic.com"] httpMethod:@"GET" startTime:0.0 endTime:0.1 responseHeaders:@{} statusCode:200 bytesSent:1024 bytesReceived:52 responseData:[NSData data] traceHeaders:nil andParams:nil]; - ``` +``` ### Swift [#swift] Here's an example of tracking a HTTP transaction: - ```swift +```swift NewRelic.noticeNetworkRequest(for: URL(string: "https://www.newrelic.com"), httpMethod: "GET", with: NRTimer(), responseHeaders: [:], statusCode: 200, bytesSent: 1000, bytesReceived: 1000, responseData: Data(), traceHeaders: nil, andParams: nil) - ``` +``` Here's an example with start and end times: - ```swift +```swift NewRelic.noticeNetworkRequest(for: URL(string: "https://www.newrelic.com"), httpMethod: "GET", startTime: 0.0, endTime: 0.1, responseHeaders: [:], statusCode: 200, bytesSent: 1000, bytesReceived: 1000, responseData: Data(), traceHeaders: nil, andParams: nil) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript noticeHttpTransaction(options: { url: string; method: string; status: number; startTime: number; endTime: number; bytesSent: number; bytesReceived: number; body: string; }) => void - ``` +``` ## Description [#description] @@ -674,7 +674,7 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.noticeHttpTransaction({ url: "https://fakewebsite.com", method: "GET", @@ -685,16 +685,16 @@ freshnessValidatedDate: 2023-07-19 bytesReceived: 2500, body: "fake http response body 200", }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript noticeHttpTransaction(url: string, method: string, status: number, startTime: number, endTime: number, bytesSent: number, bytesReceived: number, body?: string) - ``` +``` ## Description [#description] @@ -838,18 +838,18 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```js +```js NewRelic.noticeHttpTransaction('https://fakewebsiteurl.com', 'GET', 200, Date.now(), Date.now(), 0, 100000, 'fake request body'); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp NoticeHttpTransaction(string url, string httpMethod, int statusCode, long startTime,long endTime, long bytesSent, long bytesReceived, string responseBody): void; - ``` +``` ## Description [#description] @@ -993,7 +993,7 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```csharp +```csharp CrossNewRelic.Current.NoticeHttpTransaction( "https://newrelic.com", "GET", @@ -1004,15 +1004,15 @@ freshnessValidatedDate: 2023-07-19 1000, "" ); - ``` +``` ## Syntax [#syntax] - ```dart +```dart noticeHttpTransaction(String url,String httpMethod,int statusCode,int startTime,int endTime,int bytesSent,int bytesReceived,Map? traceData,{String responseBody = ""}): void; - ``` +``` ## Description [#description] @@ -1170,17 +1170,17 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.noticeHttpTransaction("https://cb6b02be-a319-4de5-a3b1-361de2564493.mock.pstmn.io/searchpage", "GET",200, 1000, 2000,100,300,null,responseBody: "This is Test Payload"); - ``` +``` ## Syntax [#syntax] - ```js +```js noticeHttpTransaction(url: string, httpMethod: string, statusCode: number, startTime: number, endTime: number, bytesSent: number, bytesReceived: number, responseBody: string): void; - ``` +``` ## Description [#description] @@ -1324,17 +1324,17 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```js +```js NewRelic.noticeHttpTransaction('https://github.com', 'GET', 200, Date.now(), Date.now()+1000, 100, 101, "response body"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp noticeHttpTransaction(string url, string httpMethod, int statusCode, long startTime,long endTime, long bytesSent, long bytesReceived, string responseBody): void; - ``` +``` ## Description [#description] @@ -1478,22 +1478,22 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```csharp +```csharp NewRelicAgent.NoticeHttpTransaction('https://github.com', 'GET', 200, DateTimeOffset.Now.ToUnixTimeMilliseconds(), DateTimeOffset.Now.ToUnixTimeMilliseconds()+1000, 100, 101, "response body", null); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp NoticeHttpTransaction(string url, string httpMethod, int statusCode, long startTime,long endTime, long bytesSent, long bytesReceived, string responseBody): void; - ``` +``` ## Description [#description] @@ -1637,7 +1637,7 @@ freshnessValidatedDate: 2023-07-19 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.NoticeHttpTransaction( "https://newrelic.com", "GET", @@ -1648,7 +1648,7 @@ freshnessValidatedDate: 2023-07-19 1000, "" ); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx index 1fef34dffff..689c7eae9ac 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx @@ -64,21 +64,21 @@ freshnessValidatedDate: 2023-07-18 ### Java [#java] - ```java +```java NewRelic.recordBreadcrumb( string $Name, map $eventAttributes ) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordBreadcrumb( breadcrumbName: String?, attributes: MutableMap? ) - ``` +``` ## Description [#description] @@ -146,38 +146,38 @@ freshnessValidatedDate: 2023-07-18 ### Java [#java] - ```java +```java Map attributes = new HashMap(); attributes.put("attributeName1", "value1"); attributes.put("attributeName1", 2); boolean eventRecorded = NewRelic.recordBreadcrumb("Name", attributes); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val map = mutableMapOf("attributeName1" to "value1", "attributeName1" to 2) val eventRecorded = NewRelic.recordBreadcrumb("Name", map) - ``` +``` Here's an example of a breadcrumb event with real-world values: ### Java [#java] - ```java +```java Map attributes = new HashMap(); attributes.put("button", "sign-in"); attributes.put("location", "LaunchFragment"); NewRelic.recordBreadcrumb("user tapped sign in button", attributes); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributes = mutableMapOf("button" to "sign-in", "location" to "LaunchFragment") NewRelic.recordBreadcrumb("user tapped sign in button", attributes) - ``` +``` @@ -185,15 +185,15 @@ freshnessValidatedDate: 2023-07-18 ### Objective-c [#objc] - ```objectivec +```objectivec recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.recordBreadcrumb(string $Name, map $eventAttributes) - ``` +``` ## Description [#description] @@ -264,25 +264,25 @@ freshnessValidatedDate: 2023-07-18 ### Objective-C [#obj-c] - ```objectivec +```objectivec [NewRelic recordBreadcrumb:@"user 11-3435 tapped sign-in button on LaunchViewController" attributes:@{ @"button" : @"sign-in", @"action" : @"tapped", @"userId" : @"11-3435", @"location" : @"LaunchViewController"}]; - ``` +``` ### Swift [#swift] - ```swift +```swift let eventRecorded = NewRelic.recordBreadcrumb("user 11-3435 tapped sign-in from LaunchViewController", attributes:["button" : "sign-in", "userId" : "11-3435", "action" : "tapped", "location" : "LaunchViewController"]) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordBreadcrumb(options: { name: string; eventAttributes: object; }) => void - ``` +``` ## Description [#description] @@ -346,17 +346,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.recordBreadcrumb({ name: "shoe", eventAttributes: {"shoeColor": "blue","shoesize": 9,"shoeLaces": true} }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordBreadcrumb(eventName: string, attributes?: {[key: string]: boolean | number | string}): void; - ``` +``` ## Description [#description] @@ -420,17 +420,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```js +```js NewRelic.recordBreadcrumb("shoe", {"shoeColor": "blue","shoesize": 9,"shoeLaces": true}); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordBreadcrumb(string name, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -494,7 +494,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.RecordBreadcrumb("MAUIExampleBreadcrumb", new Dictionary() { {"BreadNumValue", 12.3 }, @@ -502,15 +502,15 @@ freshnessValidatedDate: 2023-07-18 {"BreadBoolValue", true } } ); - ``` +``` ## Syntax [#syntax] - ```dart +```dart recordBreadcrumb(String name,{Map? eventAttributes}): void; - ``` +``` ## Description [#description] @@ -574,17 +574,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.recordBreadcrumb("Button Got Pressed on Screen 3"); - ``` +``` ## Syntax [#syntax] - ```js +```js recordBreadcrumb(name: string, attributes?: {[key: string]: any}): void; - ``` +``` ## Description [#description] @@ -648,17 +648,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```js +```js NewRelic.recordBreadcrumb("shoe", {"shoeColor": "blue","shoesize": 9,"shoeLaces": true}); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordBreadcrumb(string name, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -722,22 +722,22 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```csharp +```csharp Dictionary dic = new Dictionary(); dic.Add("Unity Attribute", "Data1"); NewRelicAgent.RecordBreadCrumb("Unity BreadCrumb Example", dic); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp recordBreadCrumb(FString breadcrumbName); recordBreadCrumbWithAttributes(FString breadcrumbName, TMap customData):void - ``` +``` ## Description [#description] @@ -797,7 +797,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" UNewRelicBPLibrary::.recordBreadCrumb("Unreal Breadcrumb Without Attribute"); @@ -807,7 +807,7 @@ freshnessValidatedDate: 2023-07-18 breadCrumbMap.Add("user", TEXT("Nisarg")); UNewRelicBPLibrary::recordBreadCrumbWithAttributes("Unreal Breadcrumb",breadCrumbMap); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordBreadcrumb(string name, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -885,7 +885,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.RecordBreadcrumb("XamarinExampleBreadcrumb", new Dictionary() { {"BreadNumValue", 12.3 }, @@ -893,7 +893,7 @@ freshnessValidatedDate: 2023-07-18 {"BreadBoolValue", true } } ); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-events.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-events.mdx index 8e1eafde735..3e7a1ba6c3d 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-events.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-events.mdx @@ -66,19 +66,19 @@ freshnessValidatedDate: 2023-07-18 ### Java [#java] - ```java +```java NewRelic.recordCustomEvent(string $eventType, [string $eventName,] map $eventAttributes) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordCustomEvent( eventType: String?, eventName: String?, eventAttributes: MutableMap? ) - ``` +``` ## Description [#description] @@ -164,25 +164,25 @@ freshnessValidatedDate: 2023-07-18 ### Java [#java] - ```java +```java Map attributes = new HashMap(); attributes.put("attributeName1", "value1"); attributes.put("attributeName1", 2); boolean eventRecorded = NewRelic.recordCustomEvent("eventType", attributes); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributes = mutableMapOf("attributeName1" to "value1", "attributeName1" to 2) val eventRecorded = NewRelic.recordCustomEvent("eventType", attributes) - ``` +``` Here's an example of a custom event with several attributes: ### Java [#java] - ```java +```java Map attributes = new HashMap(); attributes.put("make", "Ford"); attributes.put("model", "ModelT"); @@ -191,11 +191,11 @@ freshnessValidatedDate: 2023-07-18 attributes.put("maxSpeed", 12); NewRelic.recordCustomEvent("Car", attributes); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributes = mutableMapOf() attributes["make"] = "Ford" attributes["model"] = "ModelT" @@ -203,28 +203,28 @@ freshnessValidatedDate: 2023-07-18 attributes["VIN"] = "123XYZ" attributes["maxSpeed"] = 12 NewRelic.recordCustomEvent("Car", attributes) - ``` +``` Here's an example of a custom event using the `name` parameter: ### Java [#java] - ```java +```java Map attributes = new HashMap(); attributes.put("make", "Ford"); attributes.put("model", "ModelT"); NewRelic.recordCustomEvent("Car", "Ford Model T", attributes); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributes = mutableMapOf() attributes["make"] = "Ford" attributes["model"] = "ModelT" NewRelic.recordCustomEvent("Car", "Ford Model T", attributes); - ``` +``` @@ -238,23 +238,23 @@ freshnessValidatedDate: 2023-07-18 ### Objective-c [#objc] - ```objectivec +```objectivec + (BOOL) recordCustomEvent:(NSString*)eventType attributes:(NSDictionary*)attributes; - ``` +``` - ```objectivec +```objectivec + (BOOL) recordCustomEvent:(NSString*)eventType name:(NSString*)name attributes:(NSDictionary*)attributes; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.recordCustomEvent(eventType: String!, attributes:[NSObject : AnyObject]!) -> Bool - ``` +``` - ```swift +```swift NewRelic.recordCustomEvent(eventType: String!, name: String!, attributes:[NSObject : AnyObject]!) -> Bool - ``` +``` ## Description [#description] @@ -345,33 +345,33 @@ freshnessValidatedDate: 2023-07-18 ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL eventRecorded = [NewRelic recordCustomEvent:@"eventType" attributes:@{@"attributeName1": @"value1", @"attributeName2": @2}]; - ``` +``` - ```objectivec +```objectivec BOOL eventRecorded = [NewRelic recordCustomEvent:@"Vehicle" name:@"1908 Ford ModelT" attributes:@{@"make":@"Ford", @"model":@"ModelT", @"year": @1908, @"color": @"black", @"mileage": @250000}]; - ``` +``` ### Swift [#swift] - ```swift +```swift let eventRecorded = NewRelic.recordCustomEvent("eventType", attributes: ["attributeName1" : "value1", "attributeName2": 2]) - ``` +``` - ```swift +```swift let eventRecorded = NewRelic.recordCustomEvent("Vehicle", name:"1908 Ford ModelT", attributes:["make":"Ford", "model":"ModelT", "year": 1908, "color": "black", "mileage": 250000]); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordCustomEvent(options: { eventType: string; eventName: string; attributes: object; }) => void - ``` +``` ## Description [#description] @@ -447,17 +447,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.recordCustomEvent({ eventType: "mobileClothes", eventName: "pants", attributes:{"pantsColor": "blue","pantssize": 32,"belt": true} }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordCustomEvent(eventType: string, eventName?: string, attributes?: {[key: string]: boolean | number | string}): void; - ``` +``` ## Description [#description] @@ -533,17 +533,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```js +```js NewRelic.recordCustomEvent("mobileClothes", "pants", {"pantsColor": "blue","pantssize": 32,"belt": true}); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordCustomEvent(string eventType, string eventName, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -621,7 +621,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.RecordCustomEvent("MAUICustomEvent", "MAUICustomEventCategory", new Dictionary() { {"BreadNumValue", 12.3 }, @@ -629,15 +629,15 @@ freshnessValidatedDate: 2023-07-18 {"BreadBoolValue", true } } ); - ``` +``` ## Syntax [#syntax] - ```dart +```dart recordCustomEvent(String eventType,{String eventName = "", Map? eventAttributes}): void; - ``` +``` ## Description [#description] @@ -713,18 +713,18 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.recordCustomEvent("Major",eventName: "User Purchase",eventAttributes: {"item1":"Clothes","price":34.00}); - ``` +``` ## Syntax [#syntax] - ```js +```js recordCustomEvent(eventType: string, eventName?: string, attributes?: {[key: string]: any}): void; - ``` +``` ## Description [#description] @@ -800,17 +800,17 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```js +```js NewRelic.recordCustomEvent("mobileClothes", "pants", {"pantsColor": "blue","pantssize": 32,"belt": true}); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordCustomEvent(string name, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -872,20 +872,20 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```csharp +```csharp Dictionary dic = new Dictionary(); dic.Add("Unity Custom Attribute", "Data2"); NewRelicAgent.RecordCustomEvent("Unity Custom Event Example", dic); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordCustomEvent(string name, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -947,23 +947,23 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```csharp +```csharp Dictionary dic = new Dictionary(); dic.Add("Unity Custom Attribute", "Data2"); NewRelicAgent.RecordCustomEvent("Unity Custom Event Example", dic); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp recordCustomEvent(FString eventType, TMap eventAttributes):void recordCustomEventWithEventType(FString eventType,FString eventName, TMap eventAttributes):void - ``` +``` ## Description [#description] @@ -1027,7 +1027,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" TMap customEventMap; @@ -1041,7 +1041,7 @@ freshnessValidatedDate: 2023-07-18 customEventMap.Add("user", TEXT("user1")); UNewRelicBPLibrary::recordCustomEvent("Unreal Custom Event Type","Unreal Custom Event Example", customEventMap); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordCustomEvent(string eventType, string eventName, Dictionary attributes): bool; - ``` +``` ## Description [#description] @@ -1131,7 +1131,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.RecordCustomEvent("XamarinCustomEvent", "XamarinCustomEventCategory", new Dictionary() { {"BreadNumValue", 12.3 }, @@ -1139,7 +1139,7 @@ freshnessValidatedDate: 2023-07-18 {"BreadBoolValue", true } } ); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-metrics.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-metrics.mdx index 8d07dbc2463..edb2c3f61f6 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-metrics.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-custom-metrics.mdx @@ -58,13 +58,13 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.setUserId(string $userId) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordMetric( name: String, category: String, @@ -75,7 +75,7 @@ freshnessValidatedDate: 2023-07-20 valueUnit: MetricUnit ) NewRelic.recordMetric(name: String?, category: String?, value: Double = 1.0) - ``` +``` ## Description [#description] @@ -230,59 +230,59 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.recordMetric("Custom Metric Name","MyCategory", 1.0); NewRelic.recordMetric("Login Auth Metric", "Network", 1.0); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordMetric("Custom Metric Name","MyCategory", 1.0) NewRelic.recordMetric("Login Auth Metric", "Network", 1.0) - ``` +``` Here's an example of creating a custom metric for agent start: ### Java [#java] - ```java +```java NewRelic.recordMetric("Agent start", "Lifecycle"); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordMetric("Agent start", "Lifecycle") - ``` +``` Here's an example of the same metric above, but with elapsed time value added: ### Java [#java] - ```java +```java NewRelic.recordMetric("Agent start", "Lifecycle", 10.11f); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordMetric("Agent start", "Lifecycle", 10.11) - ``` +``` Here's an example of the same metric above, but with five counts of elapsed time, exclusive time, and a unit value parameter: ### Java [#java] - ```java +```java NewRelic.recordMetric("Agent start", "Lifecycle", 5, 10.11, 1.23, MetricUnit.OPERATIONS, MetricUnit.SECONDS); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.recordMetric("Agent start", "Lifecycle", 5, 10.11, 1.23, MetricUnit.OPERATIONS, MetricUnit.SECONDS) - ``` +``` @@ -290,15 +290,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec +```objectivec [NewRelic recordMetricWithName:(NSString *)name category:(NSString *)category value:(NSNumber *)value]; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.recordMetric(withName: String!, category: String!, value: NSNumber!) - ``` +``` ## Description [#description] @@ -385,27 +385,27 @@ freshnessValidatedDate: 2023-07-20 Here's an example of creating a metric in milliseconds: - ```objectivec +```objectivec [NewRelic recordMetricWithName:(NSString *)@"My Important Metric" category:(NSString *)@"Important Metrics" value:(NSNumber *)145.67]; - ``` +``` ### Swift [#swift] Here's an example of creating a metric in milliseconds: - ```swift +```swift NewRelic.recordMetric(withName: "My Important Metric", category: "Important Metrics", value: 145.67) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordMetric(options: { name: string; category: string; value?: number; countUnit?: string; valueUnit?: string; }) => void - ``` +``` ## Description [#description] @@ -513,7 +513,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.recordMetric({ name: "CapacitorMetricName", category: "CapacitorMetricCategory", @@ -530,15 +530,15 @@ freshnessValidatedDate: 2023-07-20 countUnit: NREnums.MetricUnit.SECONDS, valueUnit: NREnums.MetricUnit.OPERATIONS, }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordMetric(name: string, category: string, value?: number, countUnit?: string, valueUnit?: string): void; - ``` +``` ## Description [#description] @@ -646,20 +646,20 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.recordMetric('CordovaCustomMetricName', 'CordovaCustomMetricCategory'); NewRelic.recordMetric('CordovaCustomMetricName', 'CordovaCustomMetricCategory', 12); NewRelic.recordMetric('CordovaCustomMetricName', 'CordovaCustomMetricCategory', 13, 'PERCENT', 'SECONDS'); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordMetric(string name, string category) : void; RecordMetric(string name, string category, double value) : void; - ``` +``` ## Description [#description] @@ -767,18 +767,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp CrossNewRelic.Current.RecordMetric("Agent start", "Lifecycle"); CrossNewRelic.Current.RecordMetric("Login Auth Metric", "Network", 78.9); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordMetric(name: string, category: string, value?: number, countUnit?: string, valueUnit?: string): void; - ``` +``` ## Description [#description] @@ -886,18 +886,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.recordMetric("testMetric", "Test Champ",value: 12.0); NewrelicMobile.instance.recordMetric("testMetric1", "TestChamp12",value: 10,valueUnit: MetricUnit.BYTES,countUnit: MetricUnit.PERCENT); - ``` +``` ## Syntax [#syntax] - ```js +```js recordMetric(name: string, category: string, value?: number, countUnit?: string, valueUnit?: string): void; - ``` +``` ## Description [#description] @@ -1005,21 +1005,21 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.recordMetric('RNCustomMetricName', 'RNCustomMetricCategory'); NewRelic.recordMetric('RNCustomMetricName', 'RNCustomMetricCategory', 12); NewRelic.recordMetric('RNCustomMetricName', 'RNCustomMetricCategory', 13, NewRelic.MetricUnit.PERCENT, NewRelic.MetricUnit.SECONDS); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordMetricWithName(string name, string category) : void; RecordMetricWithName(string name, string category, double value) : void; RecordMetricWithName(string name, string category, double value, MetricUnit countUnit, MetricUnit valueUnit) : void; - ``` +``` ## Description [#description] @@ -1127,21 +1127,21 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp NewRelicAgent.RecordMetricWithName('UnityCustomMetricName', 'UnityCustomMetricCategory'); NewRelicAgent.RecordMetricWithName('UnityCustomMetricName', 'UnityCustomMetricCategory', 12); NewRelicAgent.RecordMetricWithName('UnityCustomMetricName', 'UnityCustomMetricCategory', 13, NewRelicAgent.MetricUnit.PERCENT, NewRelicAgent.MetricUnit.SECONDS); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordMetric(string name, string category) : void; RecordMetric(string name, string category, double value) : void; RecordMetric(string name, string category, double value, MetricUnit countUnit, MetricUnit valueUnit) : void; - ``` +``` ## Description [#description] @@ -1249,11 +1249,11 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.RecordMetric("Agent start", "Lifecycle"); CrossNewRelicClient.Current.RecordMetric("Login Auth Metric", "Network", 78.9); CrossNewRelicClient.Current.RecordMetric("Request Metric", "Network", 20, MetricUnit.SECONDS, MetricUnit.OPERATIONS); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-errors.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-errors.mdx index 2ff05ceb46e..e4ea151f0a5 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-errors.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-errors.mdx @@ -45,15 +45,15 @@ freshnessValidatedDate: 2023-07-26 ### Objective-c - ```objectivec +```objectivec recordError:(NSError* _Nonnull)error attributes:(NSDictionary* _Nullable)attributes; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.recordError(error: $Error, map $eventAttributes); - ``` +``` ## Description [#description] @@ -119,7 +119,7 @@ freshnessValidatedDate: 2023-07-26 Here's an example of a recording a simple error: - ```objectivec +```objectivec @try { @throw [NSException exceptionWithName:@"versionException" reason:@"App version no longer supported" @@ -127,11 +127,11 @@ freshnessValidatedDate: 2023-07-26 } @catch (NSException* e) { [NewRelic recordHandledException:e]; } - ``` +``` Here's another example of recording an error with a dictionary: - ```objectivec +```objectivec [NSJSONSerialization JSONObjectWithData:data options:opt error:error]; @@ -139,37 +139,37 @@ freshnessValidatedDate: 2023-07-26 [NewRelic recordError:error withAttributes:@{@"int": @1, @"Test Group" : @"A | B"}]; } - ``` +``` ### Swift [#swift] Here's an example of a recording a simple error: - ```swift +```swift do { try method() } catch { NewRelic.recordError(error) } - ``` +``` Here's another example of recording an error with a dictionary: - ```swift +```swift do { try method() } catch { NewRelic.recordError(error, attributes: [ "int" : 1, "Test Group" : "A | B" ]) } - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordError(options: { name: string; message: string; stack: string; isFatal: boolean; }) => void - ``` +``` ## Description [#description] @@ -215,7 +215,7 @@ freshnessValidatedDate: 2023-07-26 ## Example [#example] - ```typescript +```typescript try { throw new Error('Example error message'); } catch (e: any) { @@ -226,15 +226,15 @@ freshnessValidatedDate: 2023-07-26 isFatal: false, }); } - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript recordError(err: Error) : void; - ``` +``` ## Description [#description] @@ -246,7 +246,7 @@ freshnessValidatedDate: 2023-07-26 Angular 2+ exposes an ErrorHandler class to handle errors. You can implement New Relic by extending this class as follows: - ```typescript +```typescript import { ErrorHandler, Injectable } from '@angular/core'; import { NewRelic } from "@awesome-cordova-plugins/newrelic"; @@ -260,24 +260,24 @@ freshnessValidatedDate: 2023-07-26 super.handleError(error); } } - ``` +``` Then, you'll need to let Angular 2 know about this new error handler by listing overrides for the provider in app.module.ts: - ```typescript +```typescript @NgModule({ declarations: [AppComponent], imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,HttpClientModule], providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },{provide: ErrorHandler, useClass: GlobalErrorHandler}], bootstrap: [AppComponent], }) - ``` +``` ### React React 16+ has added error boundary components that catch errors that bubble up from child components. These are very useful for tracking errors and reporting errors to New Relic. - ```typescript +```typescript import React, { Component } from "react"; import { NewRelic } from "@awesome-cordova-plugins/newrelic"; @@ -296,13 +296,13 @@ freshnessValidatedDate: 2023-07-26 // Render error messages or other components here. } } - ``` +``` ### Redux You can create [Redux Middleware](https://redux.js.org/tutorials/fundamentals/part-4-store#middleware) and apply it to your store. This will allow you to report any errors to New Relic. - ```typescript +```typescript import { NewRelic } from "@awesome-cordova-plugins/newrelic"; const NewRelicLogger = store => next => action => { @@ -321,22 +321,22 @@ freshnessValidatedDate: 2023-07-26 } export default NewRelicLogger; - ``` +``` Make sure that the middleware is applied when creating your store: - ```typescript +```typescript import { createStore, applyMiddleware } from "redux" import NewRelicLogger from "./middleware/NewRelicLogger" const store = createStore(todoApp, applyMiddleware(NewRelicLogger)); - ``` +``` ### Vue Vue has a global error handler that reports native JavaScript errors and passes in the Vue instance. This handler will be useful for reporting errors to New Relic. - ``` +``` import { NewRelic } from "@awesome-cordova-plugins/newrelic"; Vue.config.errorHandler = (err, vm, info) => { @@ -358,15 +358,15 @@ freshnessValidatedDate: 2023-07-26 // Record the JS error to New Relic NewRelic.recordError(error); } - ``` +``` ## Syntax [#flutter-syntax] - ```dart +```dart recordError(error, StackTrace.current, attributes: attributes); - ``` +``` ## Description [#description] @@ -374,22 +374,22 @@ freshnessValidatedDate: 2023-07-26 ## Example [#example] - ```dart +```dart try { some_code_that_throws_error(); } catch (ex) { NewrelicMobile.instance .recordError(error, StackTrace.current, attributes: attributes); } - ``` +``` ## Syntax [#syntax] - ```javascript +```javascript recordError(e: string|error): void; - ``` +``` ## Description [#description] @@ -397,22 +397,22 @@ freshnessValidatedDate: 2023-07-26 ## Example [#example] - ```javascript +```javascript try { var foo = {}; foo.bar(); } catch(e) { NewRelic.recordError(e); } - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp recordError(FString errorMessage,TMap errorAttributes); - ``` +``` ## Description [#description] @@ -468,14 +468,14 @@ freshnessValidatedDate: 2023-07-26 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" TMap errorsMap; errorsMap.Add("place", TEXT("Robots")); errorsMap.Add("user", TEXT("Nisarg")); UNewRelicBPLibrary::recordError(TEXT("Error Message"), errorsMap); - ``` +``` ? ) - ``` +``` - ```kotlin +```kotlin NewRelic.recordHandledException(throwable: Throwable?) NewRelic. recordHandledException( throwable: Throwable?, attributes: Map? ) - ``` +``` ## Description [#description] @@ -140,7 +140,7 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java public class MainActivity extends Activity { ... coolButton.setOnClickListener(new View.OnClickListener() { @@ -157,11 +157,11 @@ freshnessValidatedDate: 2023-07-20 }); ... } - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin class MainActivity : AppCompatActivity() { @@ -178,7 +178,7 @@ freshnessValidatedDate: 2023-07-20 } } ........ - ``` +``` @@ -186,9 +186,9 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c - ```objectivec +```objectivec recordHandledException:(NSException* __nonnull)exception withAttributes:(NSDictionary* __nullable)attributes; - ``` +``` ## Description [#description] @@ -260,7 +260,7 @@ freshnessValidatedDate: 2023-07-20 Here's an example of a simple handled exception: - ```objectivec +```objectivec @try { @throw [NSException exceptionWithName:@"versionException" reason:@"App version no longer supported" @@ -268,26 +268,26 @@ freshnessValidatedDate: 2023-07-20 } @catch (NSException* e) { [NewRelic recordHandledException:e]; } - ``` +``` Here's another example or a handled exception with a dictionary: - ```objectivec +```objectivec NSException *exception = [NSException exceptionWithName:@"MyException" reason:@"I have my reason" userInfo:nil]; NSDictionary* dictionary = @{@"int": @1, @"Test Group" : @"A | B"}; [NewRelic recordHandledException:exception withAttributes:dictionary]; - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp recordError(error, StackTrace.current, attributes: attributes); - ``` +``` ## Description [#description] @@ -335,22 +335,22 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart try { some_code_that_throws_error(); } catch (ex) { NewrelicMobile.instance .recordError(error, StackTrace.current, attributes: attributes); } - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordException(System.Exception exception) : void; - ``` +``` ## Description [#description] @@ -398,21 +398,21 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp try { some_code_that_throws_error(); } catch (Exception ex) { CrossNewRelic.Current.RecordException(ex); } - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordException(System.Exception exception) : void; - ``` +``` ## Description [#description] @@ -460,21 +460,21 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp try { some_code_that_throws_error(); } catch (Exception ex) { NewRelicAgent.RecordException(e); } - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RecordException(System.Exception exception) : void; - ``` +``` ## Description [#description] @@ -522,13 +522,13 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp try { some_code_that_throws_error(); } catch (Exception ex) { CrossNewRelicClient.Current.RecordException(ex); } - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes.mdx index 2c1c13496d3..b50cf7c5889 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes.mdx @@ -61,15 +61,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.removeAllAttributes () - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.removeAllAttributes() - ``` +``` ## Description [#description] @@ -83,15 +83,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java boolean attributesRemoved = NewRelic.removeAllAttributes(); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributesRemoved = NewRelic.removeAllAttributes() - ``` +``` @@ -99,15 +99,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ``` +``` + (BOOL) removeAllAttributes(); - ``` +``` ### Swift [#swift] - ``` +``` NewRelic.removeAllAttributes() -> Bool - ``` +``` ## Description [#description] @@ -121,23 +121,23 @@ freshnessValidatedDate: 2023-07-21 ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL attributesRemoved = NewRelic.removeAllAttributes(); - ``` +``` ### Swift [#swift] - ```swift +```swift let attributesRemoved = NewRelic.removeAllAttributes() - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript removeAllAttributes(options?: {} | undefined) => void - ``` +``` ## Description [#description] @@ -145,17 +145,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.removeAllAttributes(); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RemoveAllAttributes() : bool; - ``` +``` ## Description [#description] @@ -163,17 +163,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.RemoveAllAttributes(); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript removeAllAttributes(): void; - ``` +``` ## Description [#description] @@ -181,17 +181,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.removeAllAttributes(); - ``` +``` ## Syntax [#syntax] - ```js +```js removeAllAttributes(): void; - ``` +``` ## Description [#description] @@ -199,17 +199,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.removeAllAttributes(); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RemoveAllAttributes() : bool; - ``` +``` ## Description [#description] @@ -217,17 +217,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp NewRelicAgent.RemoveAllAttributes(); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp removeAllAttributes() : void; - ``` +``` ## Description [#description] @@ -235,11 +235,11 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" UNewRelicBPLibrary::removeAllAttributes(); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RemoveAllAttributes() : bool; - ``` +``` ## Description [#description] @@ -261,9 +261,9 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.RemoveAllAttributes(); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-attribute.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-attribute.mdx index 993e00e3fcd..8fe1895b947 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-attribute.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-attribute.mdx @@ -65,15 +65,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.removeAttribute(string $name) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.removeAttribute(name: String?) - ``` +``` ## Description [#description] @@ -125,15 +125,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java boolean attributeRemoved = NewRelic.removeAttribute("rate"); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val attributeRemoved = NewRelic.removeAttribute("rate") - ``` +``` @@ -141,15 +141,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ``` +``` removeAttribute:(NSString*)name; - ``` +``` ### Swift [#swift] - ``` +``` NewRelic.removeAttribute(_ name: : String!)-> Bool - ``` +``` ## Description [#description] @@ -201,27 +201,27 @@ freshnessValidatedDate: 2023-07-21 Here's an example to remove the session attribute specified by a `NSString*` named `rate`: - ````objectivec +````objectivec BOOL attributeRemoved = [NewRelic removedAttribute@"rate"]; ### Swift [#swift] Here's an example to remove the session attribute specified by a `string` named `rate`: - ```swift +```swift let attributeRemoved = NewRelic.removedAttribute("rate") - ```` +```` ## Syntax [#syntax] - ```typescript +```typescript removeAttribute(options: { name: string; }) => void - ``` +``` ## Description [#description] @@ -265,17 +265,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.removeAttribute({ name: "CapacitorAttribute" }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript removeAttribute(name: string): void; - ``` +``` ## Description [#description] @@ -319,17 +319,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.removeAttribute({ name: "CordovaAttribute" }); void - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RemoveAttribute(string name) : bool; - ``` +``` ## Description [#description] @@ -373,17 +373,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.RemoveAttribute("MAUINumAttr"); - ``` +``` ## Syntax [#syntax] - ```dart +```dart removeAttribute(name: string): void; - ``` +``` ## Description [#description] @@ -427,17 +427,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.removeAttribute("FlutterCustomAttrNumber"); - ``` +``` ## Syntax [#syntax] - ```js +```js removeAttribute(name: string): void; - ``` +``` ## Description [#description] @@ -481,17 +481,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.removeAttribute('RNCustomAttrNumber'); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RemoveAttribute(string name) : bool; - ``` +``` ## Description [#description] @@ -535,17 +535,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp NewRelicAgent.RemoveAttribute("UnityCustomAttrNumber"); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp removeAttribute(FString name) : void; - ``` +``` ## Description [#description] @@ -589,11 +589,11 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" UNewRelicBPLibrary::removeAttribute("Unreal String"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp RemoveAttribute(string name) : bool; - ``` +``` ## Description [#description] @@ -651,9 +651,9 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.RemoveAttribute("XamarinNumAttr"); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-build-number.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-build-number.mdx index e287b3297d9..fb0ed5025c0 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-build-number.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-build-number.mdx @@ -41,15 +41,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.withApplicationBuild(string $buildId) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.withApplicationBuild(buildId: String?) - ``` +``` ## Description [#description] @@ -95,15 +95,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.withApplicationToken("").withApplicationBuild("156").start(this.getApplication()); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.withApplicationToken("").withApplicationBuild("1").start(applicationContext) - ``` +``` @@ -111,15 +111,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ```objectivec +```objectivec setApplicationBuild:(NSString *_Nonnull)versionString; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setApplicationBuild:(NSString*)versionString; - ``` +``` ## Description [#description] @@ -165,15 +165,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-C [#obj-c] - ```objectivec +```objectivec [NewRelic setApplicationBuild:@"42"]; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setApplicationBuild("42") - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-version.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-version.mdx index 44de7af8d11..eeeff1ab597 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-version.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-version.mdx @@ -37,15 +37,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.withApplicationVersion(string $appVersion) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.withApplicationVersion(appVersion: String?) - ``` +``` ## Description [#description] @@ -91,15 +91,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.withApplicationToken("").withApplicationVersion("1.23.4").start(this.getApplication()); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.withApplicationToken("").withApplicationVersion("1.23.4").start(applicationContext) - ``` +``` @@ -107,15 +107,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ```objectivec +```objectivec setApplicationVersion:(NSString *_Nonnull)versionString; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setApplicationVersion:(NSString*)versionString; - ``` +``` ## Description [#description] @@ -161,15 +161,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-C [#obj-c] - ```objectivec +```objectivec [NewRelic setApplicationVersion:@"1.2.3"]; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setApplicationVersion("1.2.3") - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-custom-user-id.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-custom-user-id.mdx index 76c442888f1..3bc5f59e7f4 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-custom-user-id.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-custom-user-id.mdx @@ -65,15 +65,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.setUserId(string $userId) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setUserId(userId: String?) - ``` +``` ## Description [#description] @@ -143,15 +143,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java boolean userIdWasSet = NewRelic.setUserId("SampleUserName"); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin val userIdWasSet = NewRelic.setUserId("SampleUserName") - ``` +``` @@ -159,15 +159,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c - ```objectivec +```objectivec + (BOOL) setUserId:(NSString*)userId; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setUserId(userId: String!) -> Bool - ``` +``` ## Description [#description] @@ -234,23 +234,23 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL userIdWasSet = [NewRelic setUserId:@"SampleUserName"]; - ``` +``` ### Swift [#swift] - ```swift +```swift let userIdWasSet = NewRelic.setUserId("SampleUserName") - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setUserId(options: { userId: string; }) => void - ``` +``` ## Description [#description] @@ -308,17 +308,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.setUserId({ userId: "CapacitorUserId" }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setUserId(userId: string): void; - ``` +``` ## Description [#description] @@ -362,17 +362,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.setUserId("CORDOVA12934"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetUserId(string userId): bool; - ``` +``` ## Description [#description] @@ -416,17 +416,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.SetUserId("User123"); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setUserId(String userId): void; - ``` +``` ## Description [#description] @@ -470,17 +470,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.setUserId("RN12934"); - ``` +``` ## Syntax [#syntax] - ```js +```js setUserId(userId: string): void; - ``` +``` ## Description [#description] @@ -524,17 +524,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.setUserId("RN12934"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetUserId(string userId): bool; - ``` +``` ## Description [#description] @@ -578,17 +578,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp NewRelicAgent.SetUserId("User123"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp setUserId(FString userId): void; - ``` +``` ## Description [#description] @@ -632,19 +632,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" UNewRelicBPLibrary::setUserId("Unreal12934"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetUserId(string userId): bool; - ``` +``` ## Description [#description] @@ -688,9 +688,9 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.SetUserId("User123"); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-buffer-time.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-buffer-time.mdx index 172b3380e05..22c68a9320c 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-buffer-time.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-buffer-time.mdx @@ -65,15 +65,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.setMaxEventBufferTime(int $maxBufferTimeInSec) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setMaxEventBufferTime(maxBufferTimeInSec: Int) - ``` +``` ## Description [#description] @@ -135,15 +135,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java boolean NewRelic.setMaxEventBufferTime(300); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setMaxEventBufferTime(300) - ``` +``` @@ -151,15 +151,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec +```objectivec + (void) setMaxEventBufferTime:(unsigned int)seconds; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setMaxEventBufferTime:(unsigned int)seconds; - ``` +``` ## Description [#description] @@ -213,23 +213,23 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL fiveMinuteLimitSet = [NewRelic setMaxEventBufferTime:600]; - ``` +``` ### Swift [#swift] - ```swift +```swift let fiveMinuteLimitSet = NewRelic.setMaxEventBufferTime(600) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setMaxEventBufferTime(options: { maxBufferTimeInSeconds: number; }) => void - ``` +``` ## Description [#description] @@ -287,18 +287,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.setMaxEventBufferTime({ maxBufferTimeInSeconds: 60 }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setMaxEventBufferTime(maxBufferTimeInSeconds: number): void; - ``` +``` ## Description [#description] @@ -342,17 +342,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.setMaxEventBufferTime(60); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetMaxEventBufferTime(int maxBufferTimeInSec) void; - ``` +``` ## Description [#description] @@ -396,18 +396,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.SetMaxEventBufferTime(200); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setMaxEventBufferTime(int maxBufferTimeInSec) void; - ``` +``` ## Description [#description] @@ -451,18 +451,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.setMaxEventBufferTime(200); - ``` +``` ## Syntax [#syntax] - ```js +```js setMaxEventBufferTime(maxBufferTimeInSeconds: number): void; - ``` +``` ## Description [#description] @@ -506,17 +506,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.setMaxEventBufferTime(60); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetMaxEventBufferTime(int maxBufferTimeInSec) void; - ``` +``` ## Description [#description] @@ -560,17 +560,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp NewRelicAgent.SetMaxEventBufferTime(200); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp setMaxEventBufferTime(int64 maxBufferTimeInSec):void; - ``` +``` ## Description [#description] @@ -614,17 +614,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp +```cpp UNewRelicBPLibrary::setMaxEventBufferTime(60); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetMaxEventBufferTime(int maxBufferTimeInSec) void; - ``` +``` ## Description [#description] @@ -668,9 +668,9 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.SetMaxEventBufferTime(200); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-pool-size.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-pool-size.mdx index d77b2cbf777..3c9d9d46164 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-pool-size.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-event-pool-size.mdx @@ -67,15 +67,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.setMaxEventPoolSize(int $maxSize) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setMaxEventPoolSize(maxSize: Int) - ``` +``` ## Description [#description] @@ -132,15 +132,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.setMaxEventPoolSize(1000); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setMaxEventPoolSize(1000) - ``` +``` @@ -148,15 +148,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#objc] - ```objectivec +```objectivec + (void) setMaxEventPoolSize:(unsigned int)size; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setMaxEventPoolSize(unsigned int $size) - ``` +``` ## Description [#description] @@ -210,23 +210,23 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL poolSizeSet = [NewRelic setMaxEventPoolSize:1000]; - ``` +``` ### Swift [#swift] - ```swift +```swift let poolSizeSet = NewRelic.setMaxEventPoolSize(1000) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setMaxEventPoolSize(options: { maxPoolSize: number; }) => void - ``` +``` ## Description [#description] @@ -270,18 +270,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.setMaxEventPoolSize({ maxPoolSize: 2000 }) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setMaxEventPoolSize(maxSize: number): void; - ``` +``` ## Description [#description] @@ -325,17 +325,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.setMaxEventPoolSize(2000); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetMaxEventPoolSize(int maxPoolSize): void; - ``` +``` ## Description [#description] @@ -379,18 +379,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.SetMaxEventPoolSize(1500); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript setMaxEventPoolSize(int maxSize): void; - ``` +``` ## Description [#description] @@ -434,17 +434,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart NewrelicMobile.instance.setMaxEventPoolSize(10000); - ``` +``` ## Syntax [#syntax] - ```js +```js setMaxEventPoolSize(maxSize: number): void; - ``` +``` ## Description [#description] @@ -488,17 +488,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.setMaxEventPoolSize(2000); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetMaxEventPoolSize(int maxPoolSize): void; - ``` +``` ## Description [#description] @@ -542,17 +542,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp NewRelicAgent.SetMaxEventPoolSize(1500); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp setMaxEventPoolSize(int64 maxSize): void; - ``` +``` ## Description [#description] @@ -596,19 +596,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" UNewRelicBPLibrary::setMaxEventPoolSize(2000); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp SetMaxEventPoolSize(int maxPoolSize): void; - ``` +``` ## Description [#description] @@ -652,9 +652,9 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.SetMaxEventPoolSize(1500); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage.mdx index 78c91ae6d43..c4d45fe3cbc 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage.mdx @@ -60,9 +60,9 @@ This method controls the maximum amount of offline storage that can be stored in Offline storage is disabled by default. To enable it, add the following feature flag: - ```java + ```java NewRelic.enableFeature(FeatureFlag.OfflineStorage) - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#android). @@ -71,15 +71,15 @@ This method controls the maximum amount of offline storage that can be stored in ### Java [#java] - ```java +```java NewRelic.setMaxOfflineStorageSize(int $megaBytes) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setMaxOfflineStorageSize(megaBytes: Int) - ``` +``` ## Parameters [#parameters] @@ -123,24 +123,24 @@ This method controls the maximum amount of offline storage that can be stored in ### Java [#java] - ```java +```java NewRelic.setMaxOfflineStorageSize(1000); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.setMaxOfflineStorageSize(1000) - ``` +``` Offline storage is disabled by default. To enable it, add the following feature flag: - ```swift + ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_OfflineStorage) - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#ios). @@ -149,15 +149,15 @@ This method controls the maximum amount of offline storage that can be stored in ### Objective-C [#objc] - ```objectivec +```objectivec + (void) setMaxOfflineStorageSize:(unsigned int)size; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.setMaxOfflineStorageSize(unsigned int $size) - ``` +``` ## Parameters [#parameters] @@ -199,33 +199,33 @@ This method controls the maximum amount of offline storage that can be stored in ### Objective-C [#obj-c] - ```objectivec +```objectivec BOOL poolSizeSet = [NewRelic setMaxOfflineStorageSize:1000]; - ``` +``` ### Swift [#swift] - ```swift +```swift let poolSizeSet = NewRelic.setMaxOfflineStorageSize(1000) - ``` +``` Offline storage is enabled by default. If you need to disable it, add the following feature flag: - ```typescript + ```typescript offlineStorageEnabled: false - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#capacitor). ## Syntax [#syntax] - ```typescript +```typescript setMaxOfflineStorageSize(options: { megabytes: number; }) => void - ``` +``` ## Parameters [#parameters] @@ -265,27 +265,27 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.setMaxOfflineStorageSize({ megaBytes: 200 }) - ``` +``` Offline storage is enabled by default. If you need to disable it, add the following feature flag: - ```typescript + ```typescript OFFLINE_STORAGE_ENABLED = "false" - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#cordova). ## Syntax [#syntax] - ```typescript +```typescript setMaxOfflineStorageSize(megabytes: number): void; - ``` +``` ## Parameters [#parameters] @@ -325,27 +325,27 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```js +```js NewRelic.setMaxOfflineStorageSize(200); - ``` +``` Offline storage is enabled by default. If you need to disable it, add the following feature flag: - ```csharp + ```csharp offlineStorageEnabled: false - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#maui). ## Syntax [#syntax] - ```csharp +```csharp setMaxOfflineStorageSize(int megabytes): void; - ``` +``` ## Parameters [#parameters] @@ -385,27 +385,27 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```C# +```C# CrossNewRelic.Current.SetMaxOfflineStorageSize(200); - ``` +``` Offline storage is enabled by default. If you need to disable it, add the following feature flag: - ```typescript + ```typescript offlineStorageEnabled: false - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#flutter). ## Syntax [#syntax] - ```typescript +```typescript setMaxOfflineStorageSize(int megabytes): void; - ``` +``` ## Parameters [#parameters] @@ -445,27 +445,27 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```dart +```dart NewrelicMobile.instance.setMaxOfflineStorageSize(200); - ``` +``` Offline storage is enabled by default. If you need to disable it, add the following feature flag: - ```typescript + ```typescript offlineStorageEnabled: false - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#react). ## Syntax [#syntax] - ```js +```js setMaxOfflineStorageSize(megabytes: number): void; - ``` +``` ## Parameters [#parameters] @@ -505,9 +505,9 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```js +```js NewRelic.setMaxOfflineStorageSize(200); - ``` +``` @@ -517,9 +517,9 @@ This method controls the maximum amount of offline storage that can be stored in ## Syntax [#syntax] - ```csharp +```csharp SetMaxOfflineStorageSize(int maxOfflineStorageSize): void; - ``` +``` ## Parameters [#parameters] @@ -559,27 +559,27 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```csharp +```csharp NewRelicAgent.SetMaxOfflineStorageSize(200); - ``` +``` Offline storage is enabled by default. If you need to disable it, add the following feature flag: - ```typescript + ```typescript offlineStorageEnabled: false - ``` + ``` For details on adding feature flags, see [Configure mobile monitoring settings](/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings/#xamarin). ## Syntax [#syntax] - ```csharp +```csharp SetMaxOfflineStorageSize(int megabytes): void; - ``` +``` ## Parameters [#parameters] @@ -619,9 +619,9 @@ This method controls the maximum amount of offline storage that can be stored in ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.SetMaxOfflineStorageSize(200); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/shut-down-agent.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/shut-down-agent.mdx index c918e332ee3..f5382777644 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/shut-down-agent.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/shut-down-agent.mdx @@ -54,15 +54,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.shutdown() - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.shutdown() - ``` +``` ## Description [#description] @@ -72,15 +72,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.shutdown() - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.shutdown() - ``` +``` @@ -88,15 +88,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ```objectivec +```objectivec + (void) shutdown(); - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.shutdown() -> Void - ``` +``` ## Description [#description] @@ -106,23 +106,23 @@ freshnessValidatedDate: 2023-07-21 ### Objective-C [#obj-c] - ```objectivec +```objectivec [NewRelic shutdown]; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.shutdown() - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript shutdown(options?: {} | undefined) => void - ``` +``` ## Description [#description] @@ -130,17 +130,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.shutdown(); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript shutdown() : void; - ``` +``` ## Description [#description] @@ -148,17 +148,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.shutdown(); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp Shutdown() : void - ``` +``` ## Description [#description] @@ -166,17 +166,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.Shutdown()); - ``` +``` ## Syntax [#syntax] - ```js +```js shutdown() : void; - ``` +``` ## Description [#description] @@ -184,17 +184,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js NewRelic.shutdown(); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp shutdown(): void; - ``` +``` ## Description [#description] @@ -202,17 +202,17 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```cpp +```cpp UNewRelicBPLibrary::shutdown();; - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp Shutdown(): void; - ``` +``` ## Description [#description] @@ -220,9 +220,9 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.Shutdown(); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/start-interaction.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/start-interaction.mdx index 15e3c516239..c80aee2f6b3 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/start-interaction.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/start-interaction.mdx @@ -68,15 +68,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.startInteraction(string $interactionName) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.startInteraction(actionName: String) - ``` +``` ## Description [#description] @@ -130,7 +130,7 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java public class MainActivity extends Activity { ... @Override @@ -146,11 +146,11 @@ freshnessValidatedDate: 2023-07-20 } ... } - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin class MainActivity : AppCompatActivity() { ..... @@ -169,7 +169,7 @@ freshnessValidatedDate: 2023-07-20 } .... } - ``` +``` @@ -177,15 +177,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec +```objectivec + (NSString*) startInteractionWithName:(NSString*)interactionName; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.startInteraction(string: "myInteractionName") - ``` +``` ## Description [#description] @@ -196,9 +196,9 @@ freshnessValidatedDate: 2023-07-20 If you use these methods, the instrumented interactions will not show up on the [Interactions](/docs/mobile-monitoring/mobile-monitoring-ui/mobile-app-pages/interactions-page) page, but they can be still found with a NRQL query, such as: - ```sql + ```sql query SELECT name FROM Mobile SINCE 7 DAYS AGO - ``` + ``` ## Parameters [#parameters] @@ -245,25 +245,25 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec +```objectivec NSString *identifier = [NewRelic startInteractionWithName: @"myInteractionName"]; [NewRelic stopCurrentInteraction: identifier]; - ``` +``` ### Swift [#swift] - ```swift +```swift let identifier = NewRelic.startInteraction(withName: "myInteractionName") NewRelic.stopCurrentInteraction(identifier) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript startInteraction(options: { value: string; }) => Promise<{ value: string; }> - ``` +``` ## Description [#description] @@ -307,7 +307,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript const badApiLoad = async () => { const id = await NewRelicCapacitorPlugin.startInteraction({ value: 'StartLoadBadApiCall' }); console.log(id); @@ -322,15 +322,15 @@ freshnessValidatedDate: 2023-07-20 console.error(error); }); }; - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript startInteraction(interactionName: string, cb?: function): Promise; - ``` +``` ## Description [#description] @@ -374,7 +374,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js const badApiLoad = async () => { const interactionId = await NewRelic.startInteraction('StartLoadBadApiCall'); console.log(interactionId); @@ -389,15 +389,15 @@ freshnessValidatedDate: 2023-07-20 console.error(error); }); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp StartInteraction(string interactionName): string; - ``` +``` ## Description [#description] @@ -441,7 +441,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# +```C# HttpClient myClient = new HttpClient(CrossNewRelic.Current.GetHttpMessageHandler()); string interactionId = CrossNewRelic.Current.StartInteraction("Getting data from service"); @@ -457,15 +457,15 @@ freshnessValidatedDate: 2023-07-20 CrossNewRelic.Current.EndInteraction(interactionId); - ``` +``` ## Syntax [#syntax] - ```dart +```dart startInteraction(String actionName); - ``` +``` ## Description [#description] @@ -509,7 +509,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```dart +```dart var id = await NewrelicMobile.instance.startInteraction("Getting Data from Service"); try { var dio = Dio(); @@ -521,15 +521,15 @@ freshnessValidatedDate: 2023-07-20 } catch (e) { print(e); } - ``` +``` ## Syntax [#syntax] - ```js +```js startInteraction(interactionName: string): Promise; - ``` +``` ## Description [#description] @@ -573,7 +573,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js const badApiLoad = async () => { const interactionId = await NewRelic.startInteraction('StartLoadBadApiCall'); console.log(interactionId); @@ -589,15 +589,15 @@ freshnessValidatedDate: 2023-07-20 });; }; - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp StartInteractionWithName((string interactionName): string; - ``` +``` ## Description [#description] @@ -641,7 +641,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp string interActionId = NewRelicAgent.StartInteractionWithName("Unity InterAction Example"); for(int i =0; i < 4;i++) @@ -651,15 +651,15 @@ freshnessValidatedDate: 2023-07-20 NewRelicAgent.StopCurrentInteraction(interActionId); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp startInterAction(FString interActionName):FString; - ``` +``` ## Description [#description] @@ -703,7 +703,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" FString id = UNewRelicBPLibrary::startInterAction("test Unreal InterAction"); @@ -712,7 +712,7 @@ freshnessValidatedDate: 2023-07-20 UNewRelicBPLibrary::endInterAction(id); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp StartInteraction(string interactionName): string; - ``` +``` ## Description [#description] @@ -770,7 +770,7 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp HttpClient myClient = new HttpClient(CrossNewRelicClient.Current.GetHttpMessageHandler()); string interactionId = CrossNewRelicClient.Current.StartInteraction("Getting data from service"); @@ -786,7 +786,7 @@ freshnessValidatedDate: 2023-07-20 CrossNewRelicClient.Current.EndInteraction(interactionId); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/stop-interaction.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/stop-interaction.mdx index 34f79231182..0d31bd822d8 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/stop-interaction.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/stop-interaction.mdx @@ -65,15 +65,15 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java NewRelic.endInteraction(string $interactionID) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic. endInteraction(id : String!) - ``` +``` ## Description [#description] @@ -124,7 +124,7 @@ freshnessValidatedDate: 2023-07-21 ### Java [#java] - ```java +```java public class MainActivity extends Activity { ... @Override @@ -141,7 +141,7 @@ freshnessValidatedDate: 2023-07-21 } ... } - ``` +``` @@ -149,15 +149,15 @@ freshnessValidatedDate: 2023-07-21 ### Objective-c [#objc] - ``` +``` + (void) stopCurrentInteraction:(NSString*)interactionIdentifier; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.stopInteraction(string: "myInteractionName") - ``` +``` ## Description [#description] @@ -204,25 +204,25 @@ freshnessValidatedDate: 2023-07-21 ### Objective-C [#obj-c] - ```objectivec +```objectivec NSString *identifier = [NewRelic startInteractionWithName: @"myInteractionName"]; [NewRelic stopCurrentInteraction: identifier]; - ``` +``` ### Swift [#swift] - ```swift +```swift let identifier = NewRelic.startInteraction(withName: "myInteractionName") NewRelic.stopCurrentInteraction(identifier) - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript endInteraction(options: { interactionId: string; }) => void - ``` +``` ## Description [#description] @@ -267,7 +267,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```typescript +```typescript const badApiLoad = async () => { const id = await NewRelicCapacitorPlugin.startInteraction({ value: 'StartLoadBadApiCall' }); console.log(id); @@ -282,16 +282,16 @@ freshnessValidatedDate: 2023-07-21 console.error(error); }); }; - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript endInteraction(id: InteractionId): void; - ``` +``` ## Description [#description] @@ -336,7 +336,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js const badApiLoad = async () => { const interactionId = await NewRelic.startInteraction('StartLoadBadApiCall'); console.log(interactionId); @@ -351,15 +351,15 @@ freshnessValidatedDate: 2023-07-21 console.error(error); }); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp EndInteraction(string interactionId): void; - ``` +``` ## Description [#description] @@ -404,7 +404,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```C# +```C# HttpClient myClient = new HttpClient(CrossNewRelic.Current.GetHttpMessageHandler()); string interactionId = CrossNewRelic.Current.StartInteraction("Getting data from service"); @@ -420,15 +420,15 @@ freshnessValidatedDate: 2023-07-21 CrossNewRelic.Current.EndInteraction(interactionId); - ``` +``` ## Syntax [#syntax] - ```dart +```dart endInteraction(String interactionId): void; - ``` +``` ## Description [#description] @@ -473,7 +473,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```dart +```dart var id = await NewrelicMobile.instance.startInteraction("Getting Data from Service"); try { var dio = Dio(); @@ -485,15 +485,15 @@ freshnessValidatedDate: 2023-07-21 } catch (e) { print(e); } - ``` +``` ## Syntax [#syntax] - ```js +```js endInteraction(id: InteractionId): void; - ``` +``` ## Description [#description] @@ -538,7 +538,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```js +```js const badApiLoad = async () => { const interactionId = await NewRelic.startInteraction('StartLoadBadApiCall'); console.log(interactionId); @@ -554,15 +554,15 @@ freshnessValidatedDate: 2023-07-21 });; }; - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp StopCurrentInteraction(string interactionId): void; - ``` +``` ## Description [#description] @@ -607,7 +607,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp string interActionId = NewRelicAgent.StartInteractionWithName("Unity InterAction Example"); for(int i =0; i < 4;i++) @@ -617,15 +617,15 @@ freshnessValidatedDate: 2023-07-21 NewRelicAgent.StopCurrentInteraction(interActionId); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp endInterAction(FString interActionId): void; - ``` +``` ## Description [#description] @@ -670,7 +670,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" FString id = UNewRelicBPLibrary::startInterAction("test Unreal InterAction"); @@ -679,7 +679,7 @@ freshnessValidatedDate: 2023-07-21 UNewRelicBPLibrary::endInterAction(id); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp EndInteraction(string interactionId): void; - ``` +``` ## Description [#description] @@ -738,7 +738,7 @@ freshnessValidatedDate: 2023-07-21 ## Example [#example] - ```csharp +```csharp HttpClient myClient = new HttpClient(CrossNewRelicClient.Current.GetHttpMessageHandler()); string interactionId = CrossNewRelicClient.Current.StartInteraction("Getting data from service"); @@ -754,7 +754,7 @@ freshnessValidatedDate: 2023-07-21 CrossNewRelicClient.Current.EndInteraction(interactionId); - ``` +``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/test-crash-reporting.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/test-crash-reporting.mdx index 5e37be6cbd8..eb38fc66fb1 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/test-crash-reporting.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/test-crash-reporting.mdx @@ -58,15 +58,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.crashNow(string $message) - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin NewRelic.crashNow(message:String!) - ``` +``` ## Description [#description] @@ -114,15 +114,15 @@ freshnessValidatedDate: 2023-07-20 ### Java [#java] - ```java +```java NewRelic.crashNow("This is my test message"); - ``` +``` ### Kotlin [#kotlin] - ```kotlin +```kotlin dNewRelic.crashNow("This is my test message") - ``` +``` @@ -130,15 +130,15 @@ freshnessValidatedDate: 2023-07-20 ### Objective-c [#objc] - ```objectivec +```objectivec + (void) crashNow:(NSString* __nullable)message; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.crashNow() - ``` +``` ## Description [#description] @@ -186,23 +186,23 @@ freshnessValidatedDate: 2023-07-20 ### Objective-C [#obj-c] - ```objectivec +```objectivec [NewRelic crashNow:@"This is a test crash"]; - ``` +``` ### Swift [#swift] - ```swift +```swift NewRelic.crashNow("This is a test crash") - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript crashNow(options?: { message: string; } | undefined) => void - ``` +``` ## Description [#description] @@ -246,19 +246,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```typescript +```typescript NewRelicCapacitorPlugin.crashNow(); NewRelicCapacitorPlugin.crashNow({ message: "A demo crash message" }); - ``` +``` ## Syntax [#syntax] - ```typescript +```typescript crashNow(message?: string): void; - ``` +``` ## Description [#description] @@ -302,19 +302,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.crashNow(); NewRelic.crashNow("New Relic example crash message"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp CrashNow(string message = "") : void; - ``` +``` ## Description [#description] @@ -358,17 +358,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```C# +```C# CrossNewRelic.Current.CrashNow(); - ``` +``` ## Syntax [#syntax] - ```js +```js crashNow(message?: string): void; - ``` +``` ## Description [#description] @@ -412,18 +412,18 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```js +```js NewRelic.crashNow(); NewRelic.crashNow("New Relic example crash message"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp CrashNow(string message = "") : void; - ``` +``` ## Description [#description] @@ -467,17 +467,17 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp NewRelicAgent.CrashNow("this is crash"); - ``` +``` ## Syntax [#syntax] - ```cpp +```cpp crashNow(FString message): void; - ``` +``` ## Description [#description] @@ -521,19 +521,19 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```cpp +```cpp #include "NewRelicBPLibrary.h" UNewRelicBPLibrary::crashNow("This is test"); - ``` +``` ## Syntax [#syntax] - ```csharp +```csharp CrashNow(string message = "") : void; - ``` +``` ## Description [#description] @@ -577,9 +577,9 @@ freshnessValidatedDate: 2023-07-20 ## Example [#example] - ```csharp +```csharp CrossNewRelicClient.Current.CrashNow(); - ``` +``` From 9e42af1d38e6856aeaf444f3ff7b7168a3ce9286 Mon Sep 17 00:00:00 2001 From: Shawn Kilburn Date: Fri, 11 Oct 2024 16:59:54 -0700 Subject: [PATCH 3/5] fix(Mobile): Fixed some of the other indentation issues in these code blocks and a weird title --- .../mobile-sdk/add-tracked-headers.mdx | 125 +++++++++--------- .../mobile-sdk/current-session-id.mdx | 10 +- .../mobile-sdk/record-breadcrumb.mdx | 116 ++++++++-------- 3 files changed, 125 insertions(+), 126 deletions(-) diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx index 08a6957d332..af575735aba 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx @@ -1,5 +1,5 @@ --- -title: Mobile SDK guide +title: Track HTTP requests headers tags: - Mobile monitoring - API guides @@ -49,13 +49,13 @@ freshnessValidatedDate: 2023-11-02 ### Java [#java] ```java - NewRelic.addHTTPHeadersTrackingFor(List headers) +NewRelic.addHTTPHeadersTrackingFor(List headers) ``` ### Kotlin [#kotlin] ```kotlin - NewRelic.addHTTPHeadersTrackingFor(List headers) +NewRelic.addHTTPHeadersTrackingFor(List headers) ``` ## Description [#description] @@ -110,38 +110,37 @@ freshnessValidatedDate: 2023-11-02 ### Java [#java] ```java - List headers = new ArrayList(); - headers.add("httpClient"); - headers.add("CustomAttribute"); - NewRelic.addHTTPHeadersTrackingFor(headers);` - - // Okhttp3 - Request request = new Request.Builder() - .url("https://speed.hetzner.de/1GB.bin") - .addHeader("httpClient","Okhttp3") - .addHeader("CustomAttribute","OutOfMemoryAPI") - .build(); +List headers = new ArrayList(); +headers.add("httpClient"); +headers.add("CustomAttribute"); +NewRelic.addHTTPHeadersTrackingFor(headers);` + +// Okhttp3 +Request request = new Request.Builder() + .url("https://speed.hetzner.de/1GB.bin") + .addHeader("httpClient","Okhttp3") + .addHeader("CustomAttribute","OutOfMemoryAPI") + .build(); ``` ### Kotlin [#kotlin] ```kotlin - - val headers = mutableListOf() - headers.add("httpClient") - headers.add("CustomAttribute") - NewRelic.addHTTPHeadersTrackingFor(headers). - val client = OkHttpClient().newBuilder() - .addInterceptor(new MyInterceptor()) - .cache(cache) - .build() - - - val request: Request = Builder() - .url("https://speed.hetzner.de/1GB.bin") - .addHeader("httpClient", "Okhttp3") - .addHeader("CustomAttribute", "OutOfMemoryAPI") - .build() +val headers = mutableListOf() +headers.add("httpClient") +headers.add("CustomAttribute") +NewRelic.addHTTPHeadersTrackingFor(headers). +val client = OkHttpClient().newBuilder() + .addInterceptor(new MyInterceptor()) + .cache(cache) + .build() + + +val request: Request = Builder() + .url("https://speed.hetzner.de/1GB.bin") + .addHeader("httpClient", "Okhttp3") + .addHeader("CustomAttribute", "OutOfMemoryAPI") + .build() ``` @@ -151,13 +150,13 @@ freshnessValidatedDate: 2023-11-02 ### Objective-c ```objectivec - (void)addHTTPHeaderTrackingFor:(NSArray*_Nonnull)headers; +(void)addHTTPHeaderTrackingFor:(NSArray*_Nonnull)headers; ``` ### Swift [#swift] ```swift - func addHTTPHeaderTracking(for: [String]) +func addHTTPHeaderTracking(for: [String]) ``` ## Description [#description] @@ -206,23 +205,23 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: ```objectivec - [NewRelic addHTTPHeadersTrackingFor:@[@"Example", @"Example2"]]; - - NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.newrelic.com"]]; - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - [mutableRequest addValue:@"Test" forHTTPHeaderField:@"Example"]; - [mutableRequest addValue:@"Test2" forHTTPHeaderField:@"Example2"]; - request = [mutableRequest copy]; - [[NSURLSession sharedSession] dataTaskWithRequest:request]; +[NewRelic addHTTPHeadersTrackingFor:@[@"Example", @"Example2"]]; + +NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.newrelic.com"]]; +NSMutableURLRequest *mutableRequest = [request mutableCopy]; +[mutableRequest addValue:@"Test" forHTTPHeaderField:@"Example"]; +[mutableRequest addValue:@"Test2" forHTTPHeaderField:@"Example2"]; +request = [mutableRequest copy]; +[[NSURLSession sharedSession] dataTaskWithRequest:request]; ``` ```swift - NewRelic.addHTTPHeadersTracking(for:["Example", "Example2"]) +NewRelic.addHTTPHeadersTracking(for:["Example", "Example2"]) - var request = URLRequest(url: URL(string:"https://www.newrelic.com")!) - request.addValue("Test", forHTTPHeaderField: "Example") - request.addValue("Test2", forHTTPHeaderField: "Example2") - URLSession.shared.dataTask(with: request) +var request = URLRequest(url: URL(string:"https://www.newrelic.com")!) +request.addValue("Test", forHTTPHeaderField: "Example") +request.addValue("Test2", forHTTPHeaderField: "Example2") +URLSession.shared.dataTask(with: request) ``` @@ -232,7 +231,7 @@ freshnessValidatedDate: 2023-11-02 ### Typescript [#typescript] ```js - NewRelic.addHTTPHeadersTrackingFor((options:{headers: string[]})) +NewRelic.addHTTPHeadersTrackingFor((options:{headers: string[]})) ``` ## Description [#description] @@ -287,7 +286,7 @@ freshnessValidatedDate: 2023-11-02 ### Typescript [#typescript] ```ts - NewRelicCapacitorPlugin.addHTTPHeadersTrackingFor({headers:["Car","Music"]}); +NewRelicCapacitorPlugin.addHTTPHeadersTrackingFor({headers:["Car","Music"]}); ``` @@ -297,7 +296,7 @@ freshnessValidatedDate: 2023-11-02 ### Javascript [#javascript] ```js - NewRelic.addHTTPHeadersTrackingFor(headers) +NewRelic.addHTTPHeadersTrackingFor(headers) ``` ## Description [#description] @@ -351,7 +350,7 @@ freshnessValidatedDate: 2023-11-02 ### Javascript [#javascript] ```js - NewRelic.addHTTPHeadersTrackingFor(["Car"]); +NewRelic.addHTTPHeadersTrackingFor(["Car"]); ``` @@ -360,7 +359,7 @@ freshnessValidatedDate: 2023-11-02 ## Syntax [#syntax] ```csharp - NewRelic.addHTTPHeadersTrackingFor(List headers) +NewRelic.addHTTPHeadersTrackingFor(List headers) ``` ## Description [#description] @@ -412,10 +411,10 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: ```csharp - List headers = new List(); - headers.Add("Car"); - headers.Add("Music"); - CrossNewRelic.Current.AddHTTPHeadersTrackingFor(headers); +List headers = new List(); +headers.Add("Car"); +headers.Add("Music"); +CrossNewRelic.Current.AddHTTPHeadersTrackingFor(headers); ``` @@ -423,7 +422,7 @@ freshnessValidatedDate: 2023-11-02 ## Syntax [#syntax] ```dart - NewRelic.addHTTPHeadersTrackingFor(List headers) +NewRelic.addHTTPHeadersTrackingFor(List headers) ``` ## Description [#description] @@ -475,7 +474,7 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: ```dart - NewRelic.addHTTPHeadersTrackingFor(["Car"]); +NewRelic.addHTTPHeadersTrackingFor(["Car"]); ``` @@ -484,7 +483,7 @@ freshnessValidatedDate: 2023-11-02 ## Syntax [#syntax] ```js - NewRelic.addHTTPHeadersTrackingFor(headers:string[]) +NewRelic.addHTTPHeadersTrackingFor(headers:string[]) ``` ## Description [#description] @@ -537,7 +536,7 @@ freshnessValidatedDate: 2023-11-02 Here's an example of adding some HTTP header fields: ```js - NewRelic.addHTTPHeadersTrackingFor(["Car"]); +NewRelic.addHTTPHeadersTrackingFor(["Car"]); ``` @@ -545,7 +544,7 @@ freshnessValidatedDate: 2023-11-02 ## Syntax [#syntax] ```csharp - NewRelic.addHTTPHeadersTrackingFor(List headers) +NewRelic.addHTTPHeadersTrackingFor(List headers) ``` ## Description [#description] @@ -599,10 +598,10 @@ freshnessValidatedDate: 2023-11-02 ## Example [#example] ```csharp - List headers = new List(); - headers.Add("Car"); - headers.Add("Music"); - CrossNewRelic.Current.AddHTTPHeadersTrackingFor(headers); +List headers = new List(); +headers.Add("Car"); +headers.Add("Music"); +CrossNewRelic.Current.AddHTTPHeadersTrackingFor(headers); ``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx index 40ee0eb92ff..c5e519a71e1 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/current-session-id.mdx @@ -98,7 +98,7 @@ String sessionId = NewRelic.currentSessionId(); ### Kotlin [#kotlin] ```kotlin - val sessionId = NewRelic.currentSessionId() +val sessionId = NewRelic.currentSessionId() ``` @@ -158,7 +158,7 @@ currentSessionId(options?: {} | undefined) => Promise<{ sessionId: string; }> ## Example [#example] ```typescript - let { sessionId } = await NewRelicCapacitorPlugin.currentSessionId(); +let { sessionId } = await NewRelicCapacitorPlugin.currentSessionId(); ``` @@ -188,7 +188,7 @@ let sessionId = await NewRelic.currentSessionId(); ## Syntax [#syntax] ```csharp - CurrentSessionId() : string; +CurrentSessionId() : string; ``` ## Description [#description] @@ -246,7 +246,7 @@ currentSessionId(): Promise; ## Example [#example] ```js - let sessionId = await NewRelic.currentSessionId(); +let sessionId = await NewRelic.currentSessionId(); ``` @@ -268,7 +268,7 @@ currentSessionId() : string; ## Example [#example] ```csharp - string sessionId = NewRelicAgent.CurrentSessionId(); +string sessionId = NewRelicAgent.CurrentSessionId(); ``` diff --git a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx index 689c7eae9ac..6d1fb34981d 100644 --- a/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx +++ b/src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/record-breadcrumb.mdx @@ -74,10 +74,10 @@ freshnessValidatedDate: 2023-07-18 ### Kotlin [#kotlin] ```kotlin - NewRelic.recordBreadcrumb( - breadcrumbName: String?, - attributes: MutableMap? - ) +NewRelic.recordBreadcrumb( + breadcrumbName: String?, + attributes: MutableMap? + ) ``` ## Description [#description] @@ -147,17 +147,17 @@ freshnessValidatedDate: 2023-07-18 ### Java [#java] ```java - Map attributes = new HashMap(); - attributes.put("attributeName1", "value1"); - attributes.put("attributeName1", 2); - boolean eventRecorded = NewRelic.recordBreadcrumb("Name", attributes); +Map attributes = new HashMap(); +attributes.put("attributeName1", "value1"); +attributes.put("attributeName1", 2); +boolean eventRecorded = NewRelic.recordBreadcrumb("Name", attributes); ``` ### Kotlin [#kotlin] ```kotlin - val map = mutableMapOf("attributeName1" to "value1", "attributeName1" to 2) - val eventRecorded = NewRelic.recordBreadcrumb("Name", map) +val map = mutableMapOf("attributeName1" to "value1", "attributeName1" to 2) +val eventRecorded = NewRelic.recordBreadcrumb("Name", map) ``` Here's an example of a breadcrumb event with real-world values: @@ -165,18 +165,18 @@ freshnessValidatedDate: 2023-07-18 ### Java [#java] ```java - Map attributes = new HashMap(); - attributes.put("button", "sign-in"); - attributes.put("location", "LaunchFragment"); +Map attributes = new HashMap(); +attributes.put("button", "sign-in"); +attributes.put("location", "LaunchFragment"); - NewRelic.recordBreadcrumb("user tapped sign in button", attributes); +NewRelic.recordBreadcrumb("user tapped sign in button", attributes); ``` ### Kotlin [#kotlin] ```kotlin - val attributes = mutableMapOf("button" to "sign-in", "location" to "LaunchFragment") - NewRelic.recordBreadcrumb("user tapped sign in button", attributes) +val attributes = mutableMapOf("button" to "sign-in", "location" to "LaunchFragment") +NewRelic.recordBreadcrumb("user tapped sign in button", attributes) ``` @@ -186,13 +186,13 @@ freshnessValidatedDate: 2023-07-18 ### Objective-c [#objc] ```objectivec - recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes; +recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes; ``` ### Swift [#swift] ```swift - NewRelic.recordBreadcrumb(string $Name, map $eventAttributes) +NewRelic.recordBreadcrumb(string $Name, map $eventAttributes) ``` ## Description [#description] @@ -265,15 +265,15 @@ freshnessValidatedDate: 2023-07-18 ### Objective-C [#obj-c] ```objectivec - [NewRelic recordBreadcrumb:@"user 11-3435 tapped sign-in button on LaunchViewController" - attributes:@{ @"button" : @"sign-in", @"action" : @"tapped", @"userId" : @"11-3435", @"location" : @"LaunchViewController"}]; +[NewRelic recordBreadcrumb:@"user 11-3435 tapped sign-in button on LaunchViewController" +attributes:@{ @"button" : @"sign-in", @"action" : @"tapped", @"userId" : @"11-3435", @"location" : @"LaunchViewController"}]; ``` ### Swift [#swift] ```swift - let eventRecorded = NewRelic.recordBreadcrumb("user 11-3435 tapped sign-in from LaunchViewController", - attributes:["button" : "sign-in", "userId" : "11-3435", "action" : "tapped", "location" : "LaunchViewController"]) +let eventRecorded = NewRelic.recordBreadcrumb("user 11-3435 tapped sign-in from LaunchViewController", + attributes:["button" : "sign-in", "userId" : "11-3435", "action" : "tapped", "location" : "LaunchViewController"]) ``` @@ -281,7 +281,7 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```typescript - recordBreadcrumb(options: { name: string; eventAttributes: object; }) => void +recordBreadcrumb(options: { name: string; eventAttributes: object; }) => void ``` ## Description [#description] @@ -347,7 +347,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```typescript - NewRelicCapacitorPlugin.recordBreadcrumb({ name: "shoe", eventAttributes: {"shoeColor": "blue","shoesize": 9,"shoeLaces": true} }); +NewRelicCapacitorPlugin.recordBreadcrumb({ name: "shoe", eventAttributes: {"shoeColor": "blue","shoesize": 9,"shoeLaces": true} }); ``` @@ -355,7 +355,7 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```typescript - recordBreadcrumb(eventName: string, attributes?: {[key: string]: boolean | number | string}): void; +recordBreadcrumb(eventName: string, attributes?: {[key: string]: boolean | number | string}): void; ``` ## Description [#description] @@ -421,7 +421,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```js - NewRelic.recordBreadcrumb("shoe", {"shoeColor": "blue","shoesize": 9,"shoeLaces": true}); +NewRelic.recordBreadcrumb("shoe", {"shoeColor": "blue","shoesize": 9,"shoeLaces": true}); ``` @@ -429,7 +429,7 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```csharp - RecordBreadcrumb(string name, Dictionary attributes): bool; +RecordBreadcrumb(string name, Dictionary attributes): bool; ``` ## Description [#description] @@ -495,13 +495,13 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```C# - CrossNewRelic.Current.RecordBreadcrumb("MAUIExampleBreadcrumb", new Dictionary() - { - {"BreadNumValue", 12.3 }, - {"BreadStrValue", "MAUIBread" }, - {"BreadBoolValue", true } - } - ); +CrossNewRelic.Current.RecordBreadcrumb("MAUIExampleBreadcrumb", new Dictionary() + { + {"BreadNumValue", 12.3 }, + {"BreadStrValue", "MAUIBread" }, + {"BreadBoolValue", true } + } +); ``` @@ -509,7 +509,7 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```dart - recordBreadcrumb(String name,{Map? eventAttributes}): void; +recordBreadcrumb(String name,{Map? eventAttributes}): void; ``` ## Description [#description] @@ -575,7 +575,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```dart - NewrelicMobile.instance.recordBreadcrumb("Button Got Pressed on Screen 3"); +NewrelicMobile.instance.recordBreadcrumb("Button Got Pressed on Screen 3"); ``` @@ -583,7 +583,7 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```js - recordBreadcrumb(name: string, attributes?: {[key: string]: any}): void; +recordBreadcrumb(name: string, attributes?: {[key: string]: any}): void; ``` ## Description [#description] @@ -649,7 +649,7 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```js - NewRelic.recordBreadcrumb("shoe", {"shoeColor": "blue","shoesize": 9,"shoeLaces": true}); +NewRelic.recordBreadcrumb("shoe", {"shoeColor": "blue","shoesize": 9,"shoeLaces": true}); ``` @@ -657,7 +657,7 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```csharp - RecordBreadcrumb(string name, Dictionary attributes): bool; +RecordBreadcrumb(string name, Dictionary attributes): bool; ``` ## Description [#description] @@ -723,10 +723,10 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```csharp - Dictionary dic = new Dictionary(); - dic.Add("Unity Attribute", "Data1"); +Dictionary dic = new Dictionary(); +dic.Add("Unity Attribute", "Data1"); - NewRelicAgent.RecordBreadCrumb("Unity BreadCrumb Example", dic); +NewRelicAgent.RecordBreadCrumb("Unity BreadCrumb Example", dic); ``` @@ -734,9 +734,9 @@ freshnessValidatedDate: 2023-07-18 ## Syntax [#syntax] ```cpp - recordBreadCrumb(FString breadcrumbName); +recordBreadCrumb(FString breadcrumbName); - recordBreadCrumbWithAttributes(FString breadcrumbName, TMap customData):void +recordBreadCrumbWithAttributes(FString breadcrumbName, TMap customData):void ``` ## Description [#description] @@ -798,15 +798,15 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```cpp - #include "NewRelicBPLibrary.h" +#include "NewRelicBPLibrary.h" - UNewRelicBPLibrary::.recordBreadCrumb("Unreal Breadcrumb Without Attribute"); +UNewRelicBPLibrary::.recordBreadCrumb("Unreal Breadcrumb Without Attribute"); - TMap breadCrumbMap; - breadCrumbMap.Add("place", TEXT("Robots")); - breadCrumbMap.Add("user", TEXT("Nisarg")); +TMap breadCrumbMap; +breadCrumbMap.Add("place", TEXT("Robots")); +breadCrumbMap.Add("user", TEXT("Nisarg")); - UNewRelicBPLibrary::recordBreadCrumbWithAttributes("Unreal Breadcrumb",breadCrumbMap); +UNewRelicBPLibrary::recordBreadCrumbWithAttributes("Unreal Breadcrumb",breadCrumbMap); ``` attributes): bool; +RecordBreadcrumb(string name, Dictionary attributes): bool; ``` ## Description [#description] @@ -886,13 +886,13 @@ freshnessValidatedDate: 2023-07-18 ## Example [#example] ```csharp - CrossNewRelicClient.Current.RecordBreadcrumb("XamarinExampleBreadcrumb", new Dictionary() - { - {"BreadNumValue", 12.3 }, - {"BreadStrValue", "XamBread" }, - {"BreadBoolValue", true } - } - ); +CrossNewRelicClient.Current.RecordBreadcrumb("XamarinExampleBreadcrumb", new Dictionary() + { + {"BreadNumValue", 12.3 }, + {"BreadStrValue", "XamBread" }, + {"BreadBoolValue", true } + } +); ``` From 47f45ca2c7441ea4ebaa6a5d641db6d7da4ae789 Mon Sep 17 00:00:00 2001 From: ally sassman <42753584+ally-sassman@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:22:19 -0700 Subject: [PATCH 4/5] Update src/content/docs/style-guide/cheat-sheet.mdx --- src/content/docs/style-guide/cheat-sheet.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/docs/style-guide/cheat-sheet.mdx b/src/content/docs/style-guide/cheat-sheet.mdx index 0cd2ad598f3..4896145507a 100644 --- a/src/content/docs/style-guide/cheat-sheet.mdx +++ b/src/content/docs/style-guide/cheat-sheet.mdx @@ -77,4 +77,5 @@ Welcome to our style guide cheat sheet. This handy resource is designed to quick - \ No newline at end of file + + \ No newline at end of file From 69c3b7d0a03405392bc0a03a772a73acd75a05c0 Mon Sep 17 00:00:00 2001 From: Brian Hensley <48165493+brnhensley@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:38:37 -0700 Subject: [PATCH 5/5] chore: add syntax highting and formatting to code --- ...erdgraph-manage-license-keys-user-keys.mdx | 53 ++++++++++++++----- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/src/content/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-user-keys.mdx b/src/content/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-user-keys.mdx index 545460da8bb..2c7fb7bc799 100644 --- a/src/content/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-user-keys.mdx +++ b/src/content/docs/apis/nerdgraph/examples/use-nerdgraph-manage-license-keys-user-keys.mdx @@ -53,10 +53,18 @@ To create multiple keys (user key or license key) in a single mutation, for mult Example of creating a key: -``` +```graphql mutation { - apiAccessCreateKeys(keys: {ingest: {accountId: YOUR_ACCOUNT_ID, ingestType: - BROWSER, name: "Browser Key", notes: "A note."}}) { + apiAccessCreateKeys( + keys: { + ingest: { + accountId: YOUR_ACCOUNT_ID + ingestType: BROWSER + name: "Browser Key" + notes: "A note." + } + } + ) { createdKeys { id key @@ -91,9 +99,16 @@ Here's an example of using this query to create a [user key](/docs/apis/get-star > To create a [user key](/docs/apis/get-started/intro-apis/types-new-relic-api-keys#user-api-key), you'd change the above query slightly, in the `keys` section: - ``` + ```graphql mutation { - apiAccessCreateKeys(keys: {user: {accountId: YOUR_ACCOUNT_ID, userId: YOUR_USER_ID}}) { + apiAccessCreateKeys( + keys: { + user: { + accountId: YOUR_ACCOUNT_ID, + userId: YOUR_USER_ID + } + } + ) { createdKeys { id key @@ -123,10 +138,17 @@ Here's an example of using this query to create a [user key](/docs/apis/get-star The update mutation takes the key ID, not the key string, to identify keys. -``` +```graphql mutation { - apiAccessUpdateKeys(keys: {ingest: {keyId: KEY_ID, name: "Updated name", notes: - "A new note!"}}) { + apiAccessUpdateKeys( + keys: { + ingest: { + keyId: KEY_ID, + name: "Updated name", + notes: "A new note!" + } + } + ) { updatedKeys { id key @@ -147,9 +169,9 @@ Results will vary depending on your data. Use the [GraphiQL explorer](https://ap The delete mutation takes the key ID, not the key string, to identify keys. Deleted keys will no longer grant access to New Relic systems and will no longer be returned by queries to the API access GraphQL API. -``` +```graphql mutation { - apiAccessDeleteKeys(keys: {ingestKeyIds: INGEST_KEY_ID}) { + apiAccessDeleteKeys(keys: { ingestKeyIds: INGEST_KEY_ID }) { deletedKeys { id } @@ -168,7 +190,7 @@ You can access ingest and user keys by querying a single key or all keys, scoped Single key example query: -``` +```graphql query { actor { apiAccess { @@ -187,11 +209,16 @@ query { Key search example query: -``` +```graphql query { actor { apiAccess { - keySearch(query: {types: INGEST, scope: {ingestTypes: BROWSER}}) { + keySearch(query: { + types: INGEST, + scope: { + ingestTypes: BROWSER + } + }) { keys { name key