Skip to content

Commit 6b24900

Browse files
committed
small
1 parent cb55bfa commit 6b24900

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

articles/azure-monitor/app/api-filtering-sampling.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ ms.author: mbullwin
1717
---
1818
# Filtering and preprocessing telemetry in the Application Insights SDK
1919

20-
21-
You can write and configure plug-ins for the Application Insights SDK to customize how telemetry is captured and processed before it is sent to the Application Insights service.
20+
You can write and configure plug-ins for the Application Insights SDK to customize how telemetry can be enriched and processed before it is sent to the Application Insights service.
2221

2322
* [Sampling](../../azure-monitor/app/sampling.md) reduces the volume of telemetry without affecting your statistics. It keeps together related data points so that you can navigate between them when diagnosing a problem. In the portal, the total counts are multiplied to compensate for the sampling.
2423
* Filtering with Telemetry Processors [for ASP.NET or ASP.NET Core](#filtering) or [Java](../../azure-monitor/app/java-filter-telemetry.md) lets you select or modify telemetry in the SDK before it is sent to the server. For example, you could reduce the volume of telemetry by excluding requests from robots. But filtering is a more basic approach to reducing traffic than sampling. It allows you more control over what is transmitted, but you have to be aware that it affects your statistics - for example, if you filter out all successful requests.
@@ -384,12 +383,12 @@ The following sample initializer sets cloud role name to every tracked telemetry
384383

385384
```csharp
386385
public void Initialize(ITelemetry telemetry)
387-
{
388-
if(string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName))
389-
{
390-
telemetry.Context.Cloud.RoleName = "MyCloudRoleName";
391-
}
392-
}
386+
{
387+
if(string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName))
388+
{
389+
telemetry.Context.Cloud.RoleName = "MyCloudRoleName";
390+
}
391+
}
393392
```
394393

395394
## ITelemetryProcessor and ITelemetryInitializer
@@ -400,6 +399,7 @@ What's the difference between telemetry processors and telemetry initializers?
400399
* TelemetryInitializers always run before TelemetryProcessors.
401400
* TelemetryInitializers may be called more than once. By convention, they do not set any property that has already been set.
402401
* TelemetryProcessors allow you to completely replace or discard a telemetry item.
402+
* Use TelemetryInitializers to enrich telemetry, and use TelemetryProcessor to filter out telemetry.
403403

404404
## Troubleshooting ApplicationInsights.config
405405

0 commit comments

Comments
 (0)