You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/api-custom-events-metrics.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,8 @@ If you don't have a reference on Application Insights SDK yet:
34
34
35
35
* Add the Application Insights SDK to your project:
36
36
37
-
*[ASP.NET project](./asp-net.md)
38
-
*[ASP.NET Core project](./asp-net-core.md)
37
+
*[.NET project](./asp-net.md)
38
+
*[.NETCore project](./asp-net-core.md)
39
39
*[Java project](./java-in-process-agent.md)
40
40
*[Node.js project](./nodejs.md)
41
41
*[JavaScript in each webpage](./javascript.md)
@@ -53,7 +53,7 @@ If you don't have a reference on Application Insights SDK yet:
53
53
54
54
Get an instance of `TelemetryClient` (except in JavaScript in webpages):
55
55
56
-
For [ASP.NET Core](asp-net-core.md#how-can-i-track-telemetry-thats-not-automatically-collected) apps and [Non HTTP/Worker for .NET/.NET Core](worker-service.md#how-can-i-track-telemetry-thats-not-automatically-collected) apps, it is recommended to get an instance of `TelemetryClient` from the dependency injection container as explained in their respective documentation.
56
+
For [.NetCore](asp-net-core.md#how-can-i-track-telemetry-thats-not-automatically-collected) apps and [Non HTTP/Worker for .NET/.NETCore](worker-service.md#how-can-i-track-telemetry-thats-not-automatically-collected) apps, it is recommended to get an instance of `TelemetryClient` from the dependency injection container as explained in their respective documentation.
57
57
58
58
If you use AzureFunctions v2+ or Azure WebJobs v3+ - follow [this document](../../azure-functions/functions-monitoring.md).
59
59
@@ -85,7 +85,7 @@ var telemetry = applicationInsights.defaultClient;
85
85
86
86
TelemetryClient is thread-safe.
87
87
88
-
For ASP.NET and Java projects, incoming HTTP Requests are automatically captured. You might want to create additional instances of TelemetryClient for other module of your app. For instance, you may have one TelemetryClient instance in your middleware class to report business logic events. You can set properties such as UserId and DeviceId to identify the machine. This information is attached to all events that the instance sends.
88
+
For .NET and Java projects, incoming HTTP Requests are automatically captured. You might want to create additional instances of TelemetryClient for other module of your app. For instance, you may have one TelemetryClient instance in your middleware class to report business logic events. You can set properties such as UserId and DeviceId to identify the machine. This information is attached to all events that the instance sends.
89
89
90
90
*C#*
91
91
@@ -414,7 +414,7 @@ catch (ex)
414
414
415
415
The SDKs catch many exceptions automatically, so you don't always have to call TrackException explicitly.
416
416
417
-
*ASP.NET: [Write code to catch exceptions](./asp-net-exceptions.md).
417
+
* .NET: [Write code to catch exceptions](./asp-net-exceptions.md).
418
418
* Java EE: [Exceptions are caught automatically](./java-in-process-agent.md).
419
419
* JavaScript: Exceptions are caught automatically. If you want to disable automatic collection, add a line to the code snippet that you insert in your webpages:
420
420
@@ -673,7 +673,7 @@ function Authenticated(signInId) {
673
673
}
674
674
```
675
675
676
-
In an ASP.NET web MVC application, for example:
676
+
In an .NET web MVC application, for example:
677
677
678
678
*Razor*
679
679
@@ -703,7 +703,7 @@ In [Metrics Explorer](../essentials/metrics-charts.md), you can create a chart t
703
703
You can also [Search](./diagnostic-search.md) for client data points with specific user names and accounts.
704
704
705
705
> [!NOTE]
706
-
> The [EnableAuthenticationTrackingJavaScript property in the ApplicationInsightsServiceOptions class](https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/NETCORE/src/Shared/Extensions/ApplicationInsightsServiceOptions.cs) in the .NET Core SDK simplifies the JavaScript configuration needed to inject the username as the Auth Id for each trace sent by the Application Insights JavaScript SDK. When this property is set to true, the username from the user in the ASP.NET Core is printed along with [client-side telemetry](asp-net-core.md#enable-client-side-telemetry-for-web-applications), so adding `appInsights.setAuthenticatedUserContext` manually wouldn't be needed anymore, as it is already injected by the SDK for ASP.NET Core. The Auth Id will also be sent to the server where the SDK in .NET Core will identify it and use it for any server-side telemetry, as described in the [JavaScript API reference](https://github.com/microsoft/ApplicationInsights-JS/blob/master/API-reference.md#setauthenticatedusercontext). However, for JavaScript applications that don't work in the same way as ASP.NET Core MVC (such as SPA web apps), you would still need to add `appInsights.setAuthenticatedUserContext` manually.
706
+
> The [EnableAuthenticationTrackingJavaScript property in the ApplicationInsightsServiceOptions class](https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/NETCORE/src/Shared/Extensions/ApplicationInsightsServiceOptions.cs) in the .NET Core SDK simplifies the JavaScript configuration needed to inject the username as the Auth Id for each trace sent by the Application Insights JavaScript SDK. When this property is set to true, the username from the user in the .NetCore is printed along with [client-side telemetry](asp-net-core.md#enable-client-side-telemetry-for-web-applications), so adding `appInsights.setAuthenticatedUserContext` manually wouldn't be needed anymore, as it is already injected by the SDK for .NetCore. The Auth Id will also be sent to the server where the SDK in .NET Core will identify it and use it for any server-side telemetry, as described in the [JavaScript API reference](https://github.com/microsoft/ApplicationInsights-JS/blob/master/API-reference.md#setauthenticatedusercontext). However, for JavaScript applications that don't work in the same way as .NetCore MVC (such as SPA web apps), you would still need to add `appInsights.setAuthenticatedUserContext` manually.
707
707
708
708
## <aname="properties"></a>Filtering, searching, and segmenting your data by using properties
To avoid mixing up telemetry from development, test, and production environments, you can [create separate Application Insights resources](./create-new-resource.md) and change their keys, depending on the environment.
1025
1025
1026
-
Instead of getting the instrumentation key from the configuration file, you can set it in your code. Set the key in an initialization method, such as global.aspx.cs in an ASP.NET service:
1026
+
Instead of getting the instrumentation key from the configuration file, you can set it in your code. Set the key in an initialization method, such as global.aspx.cs in an .NET service:
In webpages, you might want to set it from the web server's state, rather than coding it literally into the script. For example, in a webpage generated in an ASP.NET app:
1047
+
In webpages, you might want to set it from the web server's state, rather than coding it literally into the script. For example, in a webpage generated in an .NET app:
1048
1048
1049
1049
*JavaScript in Razor*
1050
1050
@@ -1100,14 +1100,14 @@ To determine how long data is kept, see [Data retention and privacy](./data-rete
0 commit comments