Ho to control "Microsoft.Azure.WebJobs.Script.WebHost.Middleware.SystemTraceMiddleware" logs being sent to my Datadaog?

Vijayasundhar Nanjundan 0 Reputation points
2025-02-17T05:24:50.19+00:00

We have integrated the datadog for capturing the azure function application insights logs.
Its taking too much of our datadog resources. How to control that?
I tried many methods like putting different values in the host.json, But nothing is working.
Below screenshot shows the sample datadog log that is being put in.
This lead to incuring too much of cost for our datadog infrastructure.Screenshot 2025-02-17 at 10.51.46 AM

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,504 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,333 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,575 Reputation points Microsoft Employee
    2025-02-17T10:46:04.91+00:00

    Hello @Vijayasundhar Nanjundan

    To control which logs are sent to Datadog, you can use Azure resource tags to configure the inclusion or exclusion of specific logs.

    Here are the steps you can follow to manage the logs being sent to Datadog:

    1. Tag Rules for Sending Logs:
      • By default, logs are collected for all resources.
      • Azure resources with Include tags send logs to Datadog.
      • Azure resources with Exclude tags don't send logs to Datadog.
      • If there's a conflict between inclusion and exclusion rules, exclusion takes priority.
    2. Configuration:
      • You can configure the Azure resources to include or exclude specific logs based on tags.
      • Ensure that the resources associated with the logs you want to control are tagged appropriately.
    3. Example: If you want to exclude logs from Microsoft.Azure.WebJobs.Script.WebHost.Middleware.SystemTraceMiddleware from being sent to Datadog, you can set up exclusion rules using tags.

    Unfortunately, without specific details on your Azure Function configuration and the exact methods you have tried, it's challenging to provide a precise solution. However, by utilizing Azure resource tags effectively, you should be able to control which logs are sent to Datadog. If you need further assistance or have more specific details to share, please provide additional information so that I can offer more tailored guidance.

    I hope this helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.