-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an article on a new mobile agents api for tracking http headers
- Loading branch information
Showing
2 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
177 changes: 177 additions & 0 deletions
177
...tent/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
--- | ||
title: Mobile SDK guide | ||
tags: | ||
- Mobile monitoring | ||
- API guides | ||
metaDescription: 'Customize your mobile agent instrumentation to capture specific HTTP header fields.' | ||
--- | ||
|
||
<Tabs> | ||
<TabsBar> | ||
<TabsBarItem id="android"> | ||
Android | ||
</TabsBarItem> | ||
<TabsBarItem id="ios"> | ||
iOS | ||
</TabsBarItem> | ||
<TabsBarItem id="maui"> | ||
.NET MAUI | ||
</TabsBarItem> | ||
<TabsBarItem id="xamarin"> | ||
Xamarin | ||
</TabsBarItem> | ||
</TabsBar> | ||
|
||
<TabsPages> | ||
<TabsPageItem id="android"> | ||
## Syntax [#syntax] | ||
|
||
### Java [#java] | ||
|
||
```java | ||
NewRelic.addHTTPHeadersTrackingFor(List<String> headers) | ||
``` | ||
|
||
### Kotlin [#kotlin] | ||
|
||
```kotlin | ||
NewRelic.addHTTPHeadersTrackingFor(List<String> headers) | ||
``` | ||
|
||
## Description [#description] | ||
|
||
This API allows you to add any header field strings to a list that gets recorded as attributes with networking request events. | ||
|
||
## Parameters [#parameters] | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th width="30%"> | ||
Parameter | ||
</th> | ||
|
||
<th width="30%"> | ||
Type | ||
</th> | ||
<th> | ||
Description | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<tr> | ||
<td> | ||
`$headers` | ||
</td> | ||
|
||
<td> | ||
`Exception` | ||
</td> | ||
|
||
<td> | ||
Required. The HTTP header fields to be added. | ||
</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
|
||
## Return values [#return-values] | ||
|
||
Returns `true` if added successfully, or `false` if not. | ||
|
||
## Examples [#examples] | ||
|
||
Here's an example of adding some HTTP header fields: | ||
|
||
### Java [#java] | ||
|
||
```java | ||
public class MainActivity extends Activity { | ||
... | ||
|
||
... | ||
} | ||
``` | ||
|
||
### Kotlin [#kotlin] | ||
|
||
```kotlin | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
.... | ||
|
||
........ | ||
``` | ||
</TabsPageItem> | ||
<TabsPageItem id="ios"> | ||
|
||
## Syntax [#syntax] | ||
|
||
### Objective-c | ||
Check warning on line 114 in src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx GitHub Actions / vale-linter
|
||
|
||
```objectivec | ||
(void)addHTTPHeaderTrackingFor:(NSArray<NSString*>*_Nonnull)headers; | ||
``` | ||
|
||
### Swift [#swift] | ||
|
||
```swift | ||
NewRelic.addHTTPHeaderTracking(for: [String]) | ||
``` | ||
|
||
## Description [#description] | ||
|
||
This API allows you to add any header field strings to a list that gets recorded as attributes with networking request events. | ||
|
||
## Parameters [#parameters] | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th width="30%"> | ||
Parameter | ||
</th> | ||
|
||
<th width={200}> | ||
Type | ||
</th> | ||
<th> | ||
Description | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<tr> | ||
<td> | ||
`headers` | ||
</td> | ||
|
||
<td> | ||
`NSArray<NSString*>*_Nonnull` | ||
</td> | ||
|
||
<td> | ||
Required. The HTTP header fields to be added. | ||
</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
|
||
|
||
## Examples [#examples] | ||
|
||
Here's an example of adding some HTTP header fields: | ||
```objectivec | ||
[NewRelic addHTTPHeadersTrackingFor:@[@"Example", @"Example2"]]; | ||
``` | ||
```swift | ||
NewRelic.addHTTPHeadersTracking(for:["Example", "Example2"]) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters