Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Exclude Azure´s AlwaysOn calls #1102

@pmierzwa

Description

@pmierzwa

Is your feature request related to a problem?
Using Azure´s "Always On" feature pings "/" every 5 minutes. This fills up my applications insights with messages that has no use to me. It also shows up in the application map, which then gives me a false number for the amount of requests.

This path cannot be excluded in the OPENCENSUS EXCLUDELIST_PATHS, is it is using a string.startswith()

def disable_tracing_url(url, excludelist_paths=None):
"""Disable tracing on the provided excludelist paths, by default not tracing
the health check request.
If the url path starts with the excludelisted path, return True.
:type excludelist_paths: list
:param excludelist_paths: Paths that not tracing.
:rtype: bool
:returns: True if not tracing, False if tracing.
"""
if excludelist_paths is None:
excludelist_paths = DEFAULT_EXCLUDELIST_PATHS
# Remove the 'https?|ftp://' if exists
url = re.sub(URL_PATTERN, '', url)
# Split the url by the first '/' and get the path part
url_path = url.split('/', 1)[1]
for path in excludelist_paths:
if url_path.startswith(path):
return True
return False

Describe the solution you'd like.
I would like some sort of pattern to exclude the Azure AlwaysOn feature. Eg. ["!!AzureAlwaysOn"].

Describe alternatives you've considered.
I would be able to use [""] as a EXCLUDELIST_PATHS, but that would exclude everything.

Additional context.
Using Django.

The Azure AlwaysOn call example: http://localhost:8000/ eg. GET /

Activity

linked a pull request that will close this issue on Feb 18, 2022
LennardSchwarz

LennardSchwarz commented on Jun 7, 2023

@LennardSchwarz

Hi,
any progress on this?

At work we are using the FastAPI extension to log to Azure Insights and the Azure pings to “/“ are really cluttering our logs.

I would be very grateful for a solution or workaround on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @lzchen@pmierzwa@LennardSchwarz

      Issue actions

        Exclude Azure´s AlwaysOn calls · Issue #1102 · census-instrumentation/opencensus-python