Duplicated messages in Azure Application Insights
See original GitHub issueEnvironment
Python 3.9.6 - 64 bit Windows 10 pip 21.3.1 opencensus==0.8.0 opencensus-context==0.1.2 opencensus-ext-azure==1.1.0
Steps to reproduce
I tried running the following code in mutliple places including new venvs that have just the opencensus-ext-azure library
import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
logger = logging.getLogger(__name__)
handler = AzureLogHandler(connection_string="<My-InstrumentationKey>")
logger.addHandler(handler)
properties = {"custom_dimensions": {"key_1*****": "value_1", "key_2********": "value_2"}}
logger.error("Error 12 : Hello, World!", extra=properties)
What is the expected behavior?
We expect to see 1 message in the traces table in application insights
What is the actual behavior?
Duplicate records with the exact timestamp :
Additional info
I am aware of the issue #901 and i think it’s not the same cause.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:19 (7 by maintainers)
Top Results From Across the Web
Application Insights Duplicate Telemetry - Microsoft Q&A
I have application insights setup and configured in workspace mode and for a web app on the linux app service plan, I am...
Read more >Azure Application Insights showing duplicate entries
Right now we are trying to review some performance issue and what we are observing is that Application Insights is showing duplicate records ......
Read more >Duplicated messages in Azure Application Insights · Issue #901
This will in turn pass every log record through every handler attached to logger and as a result, export multiple of the exact...
Read more >TelemetryClient (core 2.6.2 API) - javadoc.io
Sends a TraceTelemetry record to Application Insights. Appears in "traces" in Analytics and Search. Parameters: message - A log message. Max length 10000....
Read more >Azure Application Insights — How not to burn money using it
In this blog post, I'm going to talk about Azure Application Insights and how I learned not to take certain things for granted...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@lzchen adding of the AzureLogHandler multiple times to the root logger was indeed the issue for me (even though I had it wrapped arounf check of streamlit session state, but thats another issue).
Resolved by checking length of logger handlers. Thanks!
@simonsben seen that many time repeat of same telemtry as well