Skip to content

Commit f41f75a

Browse files
authored
Update api-custom-events-metrics.md
Standardizing .NET and .NetCore.
1 parent 15bc662 commit f41f75a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/azure-monitor/app/api-custom-events-metrics.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ If you don't have a reference on Application Insights SDK yet:
3434

3535
* Add the Application Insights SDK to your project:
3636

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)
3939
* [Java project](./java-in-process-agent.md)
4040
* [Node.js project](./nodejs.md)
4141
* [JavaScript in each webpage](./javascript.md)
@@ -53,7 +53,7 @@ If you don't have a reference on Application Insights SDK yet:
5353

5454
Get an instance of `TelemetryClient` (except in JavaScript in webpages):
5555

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.
5757

5858
If you use AzureFunctions v2+ or Azure WebJobs v3+ - follow [this document](../../azure-functions/functions-monitoring.md).
5959

@@ -85,7 +85,7 @@ var telemetry = applicationInsights.defaultClient;
8585

8686
TelemetryClient is thread-safe.
8787

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.
8989

9090
*C#*
9191

@@ -414,7 +414,7 @@ catch (ex)
414414

415415
The SDKs catch many exceptions automatically, so you don't always have to call TrackException explicitly.
416416

417-
* ASP.NET: [Write code to catch exceptions](./asp-net-exceptions.md).
417+
* .NET: [Write code to catch exceptions](./asp-net-exceptions.md).
418418
* Java EE: [Exceptions are caught automatically](./java-in-process-agent.md).
419419
* 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:
420420

@@ -673,7 +673,7 @@ function Authenticated(signInId) {
673673
}
674674
```
675675

676-
In an ASP.NET web MVC application, for example:
676+
In an .NET web MVC application, for example:
677677

678678
*Razor*
679679

@@ -703,7 +703,7 @@ In [Metrics Explorer](../essentials/metrics-charts.md), you can create a chart t
703703
You can also [Search](./diagnostic-search.md) for client data points with specific user names and accounts.
704704

705705
> [!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.
707707
708708
## <a name="properties"></a>Filtering, searching, and segmenting your data by using properties
709709

@@ -1023,7 +1023,7 @@ telemetry.InstrumentationKey = "---my key---";
10231023

10241024
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.
10251025

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:
10271027

10281028
*C#*
10291029

@@ -1044,7 +1044,7 @@ protected void Application_Start()
10441044
appInsights.config.instrumentationKey = myKey;
10451045
```
10461046

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 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:
10481048

10491049
*JavaScript in Razor*
10501050

@@ -1100,14 +1100,14 @@ To determine how long data is kept, see [Data retention and privacy](./data-rete
11001100

11011101
## Reference docs
11021102

1103-
* [ASP.NET reference](/dotnet/api/overview/azure/insights)
1103+
* [.NET reference](/dotnet/api/overview/azure/insights)
11041104
* [Java reference](/java/api/overview/azure/appinsights)
11051105
* [JavaScript reference](https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md)
11061106

11071107
## SDK code
11081108

1109-
* [ASP.NET Core SDK](https://github.com/Microsoft/ApplicationInsights-dotnet)
1110-
* [ASP.NET](https://github.com/Microsoft/ApplicationInsights-dotnet)
1109+
* [.NETCore SDK](https://github.com/Microsoft/ApplicationInsights-dotnet)
1110+
* [.NET](https://github.com/Microsoft/ApplicationInsights-dotnet)
11111111
* [Windows Server packages](https://github.com/Microsoft/ApplicationInsights-dotnet)
11121112
* [Java SDK](https://github.com/Microsoft/ApplicationInsights-Java)
11131113
* [Node.js SDK](https://github.com/Microsoft/ApplicationInsights-Node.js)

0 commit comments

Comments
 (0)