Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to establish a new connection with aplicationinsights.azure.com #1215

Open
kevinco26 opened this issue Aug 10, 2023 · 1 comment
Open
Labels
azure Microsoft Azure bug

Comments

@kevinco26
Copy link

Describe your environment.
Using Opencensus-ext-azure==1.1.3
Python 3.11
Windows machine.

my python code has:

import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
logger = logging.getLogger(__name__)
logger.addHandler(AzureLogHandler(
    connection_string='<instrumentation key>)
)
logger.exception('Captured an exception.')

This code is running inside my FastAPI backend

When I run my backend api I get the following error repeatedly multiple times
Retrying due to transient client side error HTTPSConnectionPool(host='westus-0.in.applicationinsights.azure.com', port=443): Max retries exceeded with url: //v2.1/track (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001E8062DFED0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')).

Also, I don't see anything being logged to application insights.. I used to see it and not anymore.. not sure what changed.
Steps to reproduce.
Describe exactly how to reproduce the error. Include a code sample if applicable.

What is the expected behavior?
Expecting to see logs in azure and expecting to not see Failed to establish connection?

What is the actual behavior?
No logs in app insights and connection error emmitted by the handler

@kevinco26 kevinco26 added the bug label Aug 10, 2023
@lzchen
Copy link
Contributor

lzchen commented Sep 15, 2023

Are you running this in any container of some sort? Perhaps something with your backend api is preventing network calls to be made to the app insights backend

@lzchen lzchen added the azure Microsoft Azure label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure Microsoft Azure bug
Projects
None yet
Development

No branches or pull requests

2 participants