This Worker extension provides the ability to modify and/or skip RequestTelemetry events generated in the Azure Functions host.
- 
Add the Worker.Extensions.HttpTelemetryProcessor NuGet package to your Isolated Azure Functions project. 
- 
Apply the HttpTelemetryProcessorattribute to your HTTP trigger function parameters. Configure the following properties:- DiscardSuccessfulRequestTelemetry: When set to- true,- RequestTelemetryevents generated by the functions host will be discarded if the trigger response code is- < 400.
- FailureStatusCodeIsRequestFailure: When set to- true, the- Successproperty of- RequestTelemetrywill be set to- falseif the trigger response code is- >= 400.
 
Example:
[Function("Ping")]
public HttpResponseData Ping([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "ping")] HttpRequestData req, 
[HttpTelemetryProcessor( DiscardSuccessfulRequestTelemetry = true, FailureStatusCodeIsRequestFailure = true)] object ignore)
{
    // ... your code ...
}- 
When DiscardSuccessfulRequestTelemetryis enabled, specific metrics in your Azure Function will be affected. For example, stats and charts reliant on individual request telemetry, such as theHTTP 2xxchart in the functions overview, will not display data for successful events. Similarly, theMonitortab will show inaccurateSuccess Count, and no items will be listed in theInvocation Tracestable. This is not an exhaustive list of the potential impacts.
- 
Aggregate telemetry, such as Total Execution CountandSuccessful Execution Count, is not affected. These metrics use aggregated event data created before theHttpTelemetryProcessordiscards individual request telemetry.
The WebJobs extension WebJobs.Extensions.HttpTelemetry (available on NuGet) will be loaded by the functions host. The functions.metadata file is parsed during the startup to determine the configuration of each HttpTelemetryProcessor attribute on your HTTP triggers. The existing TelemetryConfiguration registered by the function host is then overridden with a new configuration that includes our custom HttpTelemetryProcessor. This processor is responsible for modifying or discarding RequestTelemetry events based on your configurations.