Share via

How to reduce Application Insights telemetry from Azure Functions and understand daily caps

Dharmesh Joshi 21 Reputation points
2026-06-15T11:16:17.9333333+00:00

Hi,

I have multiple Azure Function Apps created from Visual Studio projects. Application Insights is enabled for each Function App, but I’m finding that some apps are capturing more telemetry than I need.

I would like to optimize what is sent to Application Insights so that I’m not capturing everything unnecessarily. Ideally, I want to capture useful information such as exceptions and selected log messages, but reduce noisy traces, requests, dependencies, or other telemetry where appropriate.

What is the recommended way to configure this in an Azure Functions project? For example, should this be controlled through host.json, application settings, logging levels, sampling, or code-level logging?

Also, I noticed that there are daily cap settings both on the Application Insights resource and on the associated Log Analytics workspace.

Am I correct in understanding that:

Application Insights daily cap = limits telemetry for that specific Application Insights resource
Log Analytics workspace daily cap = limits total ingestion for all resources sending data to that workspace

If multiple Application Insights resources are connected to the same workspace, would the workspace cap affect all of them once the workspace limit is reached?

My goal is to keep telemetry useful while limiting data ingestion and ideally staying within the monthly free allowance.

Thanks.
DJ

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


2 answers

Sort by: Most helpful
  1. Pravallika KV 17,205 Reputation points Microsoft External Staff Moderator
    2026-06-15T16:33:33.2133333+00:00

    Hi @Dharmesh Joshi ,

    There are a couple of different levers involved:

    1. reducing what your Function Apps send (sampling + filtering + log levels), and
    2. protecting/limiting ingestion with daily caps (Application Insights and/or the Log Analytics workspace).
    1. Reducing noisy telemetry from Azure Functions (recommended approach)

    For Azure Functions =>Application Insights, the platform supports controlling telemetry volume primarily via sampling and host.json telemetry settings, plus log levels.

    A. Sampling (default on for Functions)

    Azure Functions enables sampling by default, which reduces telemetry volume during high activity. If you still see too much data (or want to improve the signal), you can adjust sampling so more (or different) telemetry is retained.

    In Functions, a common pattern is to tune sampling for your scenario rather than turning it off everywhere.

    B. Exclude noisy telemetry types via host.json

    A practical approach is to keep exceptions and selected traces, while excluding the most verbose categories.

    You can do this by using the excludedTypes section in host.json under the Application Insights configuration. The Functions templates even exclude Request telemetry by default (since it can be very information-dense due to bindings/triggers).

    C. Adjust local log levels in host.json

    Your host.json log configuration can also cause telemetry to be omitted. For example, if executions are mapped to a host logging category and that category is set to Warning, you won’t see what would have been captured at Information.

    So if you want “useful” data (like exceptions) but fewer background info traces, a combination of:

    • higher default level (for broad categories), and
    • lower level for the specific categories you care about

    is often effective.

    D. Consider whether the “noisy app” needs extra filtering

    Since one of your Function Apps is IoT Hub triggered, it’s very likely that it produces high-volume telemetry. For that app, it’s especially useful to apply the selective controls above (sampling adjustments and/or excludedTypes) rather than affecting all Function Apps the same way.

    Summary recommendation for your goal (“exceptions + selected log messages, reduce requests/dependencies/traces”):

    • keep sampling enabled (don’t disable in production)
    • use excludedTypes to exclude specific telemetry types you don’t need
    • ensure log levels in host.json match what you want to keep
    1. Understanding Application Insights daily cap vs Log Analytics daily cap

    You’re mostly correct, with one key nuance: both caps apply and whichever cap is reached first stops ingestion.

    • Application Insights daily cap limits the daily ingestion for that specific Application Insights resource.
    • Log Analytics workspace daily cap limits the daily ingestion for the Log Analytics workspace (for all data sent to that workspace).

    When both are in play (workspace-based scenarios), ingestion stops when either cap is hit.

    Also:

    • Daily cap is evaluated as GB/day (and there can be a small overflow as part of ingestion optimization).
    • If the daily cap is reached, you lose ingestion for the remainder of the day (so it’s intended as a guardrail for unexpected spikes, not a target to “hit”.)

    If multiple Application Insights resources send to the same workspace

    Yes, because the workspace daily cap limits total ingestion into that workspace, it can impact all sources sending data to the same workspace when the workspace limit is reached (since the workspace cap is shared).

    1. Staying within monthly free allowance
    • Use sampling + filtering to reduce volume before it becomes costly.
    • Use daily caps to protect against unexpected bursts, but don’t rely on hitting the cap to manage your steady-state ingestion (because you’ll lose telemetry once it’s reached).

    Hope this helps!


    If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

    Was this answer helpful?


  2. AI answer

    2026-06-15T11:16:44.7033333+00:00

    To reduce Azure Functions telemetry and control costs, use a combination of sampling, selective logging, and daily caps.

    1. Configure sampling for Azure Functions

    Sampling is the primary tool to reduce telemetry volume while keeping metrics statistically meaningful.

    For Azure Functions, sampling is configured in host.json under logging.applicationInsights.samplingSettings. Sampling is enabled by default and can cause partial/missing logs if the rate is low.

    Example default-style configuration (from the documentation):

    {
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "maxTelemetryItemsPerSecond" : 20,
            "excludedTypes": "Request;Exception"
          }
        }
      }
    }
    

    Key points:

    • isEnabled: turn sampling on/off.
    • maxTelemetryItemsPerSecond: cap the number of items; lower values reduce volume more aggressively.
    • excludedTypes: telemetry types that are never sampled (for example, keep all Request and Exception items, but allow sampling of traces and dependencies).

    To verify the effective sampling rate, use a query like:

    union requests,dependencies,pageViews,browserTimings,exceptions,traces
    | where timestamp > todatetime("mm/dd/yyyy hh:mm:ss") and timestamp < todatetime("mm/dd/yyyy hh:mm:ss")
    | summarize TelemetrySavedPercentage = 100/avg(itemCount), TelemetryDroppedPercentage = 100-100/avg(itemCount) by bin(timestamp, 1d), itemType
    | sort by timestamp asc
    

    If TelemetrySavedPercentage < 100 for a type, that type is being sampled.

    1. Tune what is logged (traces, requests, dependencies)

    Use these levers together:

    • Log levels and trace volume: Reduce noisy traces by lowering log levels in the Functions app so that only warnings/errors or selected information logs are written. This directly reduces entries in the traces table, which is often a major cost driver.
    • Disable or limit specific auto-collected telemetry: For some SDKs (for example, Java agent), you can disable specific instrumentation or logging modules, or suppress telemetry for specific methods or health checks. While the example in context is Java, the pattern is the same: disable unneeded modules and suppress low-value telemetry to reduce traces and dependencies volume.
    • Selective telemetry collection: Focus on essential telemetry in production (exceptions, key requests, and a subset of traces). Avoid excessive custom telemetry unless it provides clear value.
    1. Use Application Insights cost-optimization practices

    Recommended practices for Application Insights cost control include:

    • Use sampling as the primary control to tune data volume.
    • Disable unneeded modules and limit noisy logging (for example, host/general traces) using log levels.
    • Limit custom metrics and use preaggregated OpenTelemetry metric instruments where applicable.
    • Ensure workspace-based Application Insights is used so that features like Basic Logs, commitment tiers, and table-level retention can be applied.

    If high ingestion is already occurring, the documented methods to reduce costs include:

    • Adjust the daily cap configuration.
    • Switch table plans (for example, use Basic Logs where appropriate).
    • Use SDK features and sampling overrides to reduce specific tables such as traces and dependencies.
    1. Daily caps: Application Insights vs Log Analytics workspace

    The understanding of daily caps is correct:

    • Application Insights daily cap
      • Configured per Application Insights resource.
      • Limits how much telemetry that specific Application Insights resource can ingest per day.
      • When the cap is reached, ingestion for that resource stops until the next day.
    • Log Analytics workspace daily cap
      • Configured on the Log Analytics workspace.
      • Limits total data ingestion into that workspace per day, across all connected resources (including all Application Insights resources and other Azure Monitor data sources).
      • By default, the workspace daily cap is off; it must be explicitly enabled before adjusting the limit.

    If multiple Application Insights resources send data to the same workspace:

    • Each Application Insights resource’s own daily cap applies to that resource’s telemetry.
    • The workspace daily cap applies to the aggregate of all data sent to the workspace.
    • Once the workspace cap is reached, ingestion to that workspace stops for all connected resources, so all Application Insights resources using that workspace are affected.
    1. How to use caps safely
    • Use sampling and selective logging as the primary tools to stay within the free allowance and control costs.
    • Use daily caps (on Application Insights and/or the workspace) as a last-resort safety net to prevent unexpected cost spikes, understanding that hitting a cap will create gaps in telemetry until the next day.
    1. Summary configuration approach for Azure Functions

    For each Function App:

    1. Configure host.json sampling so that:
      • Exceptions and key requests are excluded from sampling.
      • Traces and dependencies are sampled to reduce noise.
    2. Adjust log levels so that only important logs (for example, warnings/errors and selected information logs) are emitted.
    3. Disable or suppress low-value auto-collected telemetry where supported by the SDK.
    4. Optionally set an Application Insights daily cap per Function App resource.
    5. Optionally set a Log Analytics workspace daily cap to protect against aggregate spikes across all apps.

    This combination keeps telemetry useful (exceptions and key signals preserved) while limiting ingestion volume and helping stay within the free allowance.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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