Skip to content

Commit

Permalink
style edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoliver authored Nov 8, 2019
1 parent 173ff59 commit f020040
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions articles/azure-monitor/app/api-filtering-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,23 @@ public void Process(ITelemetry item)

**Filtering using ITelemetryInitializer**

1. Create a telemetry initializer callback function. The callback function takes an ITelemetryItem as a parameter, which is the event that is being processed. Returning false from this callback will result in the telemetry item to be filtered out.
1. Create a telemetry initializer callback function. The callback function takes `ITelemetryItem` as a parameter, which is the event that is being processed. Returning `false` from this callback results in the telemetry item to be filtered out.

```JS
var filteringFunction = (envelope) => {
if (envelope.data.someField === 'tobefilteredout') {
return false;
}
```JS
var filteringFunction = (envelope) => {
if (envelope.data.someField === 'tobefilteredout') {
return false;
}

return true;
};
```
return true;
};
```

2. Add your telemetry initializer callback
2. Add your telemetry initializer callback:

```JS
appInsights.addTelemetryInitializer(filteringFunction);
```
```JS
appInsights.addTelemetryInitializer(filteringFunction);
```

## Add/modify properties: ITelemetryInitializer

Expand Down

0 comments on commit f020040

Please sign in to comment.