Application Insights Sampling

OctavioCunha-8450 25 Reputation points
2023-02-01T18:22:17.0433333+00:00

Hey

I have been reading Application Insights documentation but I still have some doubts and would like to ask following questions regarding sampling in application insights:

Currently I am using java application insights agent to collect telemetry data and send it to application insights (v3.4.8) (spring boot project)

  1. If I don't specify any sampling at the agent level my understanding is that it will have the default rate-limited sampling of 5 requests per second. With this scenario can I activate ingestion sampling at the application insights level (will it work)?
  2. Can I activate ingestion sampling at the application insights level if I have APPLICATIONINSIGHTS_SAMPLING_PERCENTAGE environment property set in my project? (it seems to work if this variable is 100 but not for other scenarios)
  3. Is it possible to change java agent configuration at runtime (without the need of a restart). For example if I change APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL environment property at runtime will the agent pick the new value without restart?

Thank you for your time

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,658 questions
{count} vote

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 21,551 Reputation points Moderator
    2023-02-06T06:52:12.6233333+00:00

    Thank you for this question. Please find the response below:

    1. You are correct, with agent version > 3.4.0, the rate limit sampling is default. Therefore, the ingestion sampling would not be in effect. Ingestion sampling is only supported if no other sampling is in effect. Please see this link for an overview.
    2. No, it would not work, as mentioned in the point above, as sampling is enabled. When you set APPLICATIONINSIGHTS_SAMPLING_PERCENTAGE to 100%, it basically disables sampling (collect all data).
    3. No, when updating the app setting (like environment variable), an app restart gets triggered if the application is hosted as Azure Web Apps. It is because the environment variables are read at application start for AppInsights configuration and loaded in memory.

    Hope this helps. Please let me know if you have any questions.

    2 people found this answer helpful.

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.