-
Notifications
You must be signed in to change notification settings - Fork 251
Exclude Azure´s AlwaysOn calls #1102
Description
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()
opencensus-python/opencensus/trace/utils.py
Lines 45 to 70 in d63d295
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
LennardSchwarz commentedon Jun 7, 2023
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.