Closed Marvedog closed 1 year ago
@Marvedog
The opencensus azure monitor log exporter will collect logging calls made using the python logger depending on which logger you attach it to. The reason you are seeing trace telemetry for error messages generated from the exporter (which ideally you should not be) is because your log exporter (AzureLogHandler) is being attached to the root logger. You should probably use a named logger within your application code and then attach the AzureLogHandler in your django settings to ONLY track your APPLICATION level logs and not logs generated from the exporter itself.
A side note, the azure monitor exporters sends telemetry to the backend in batches. The 206 response code is returned if some of the data fails to send. The Telemetry Sampled out
error message might mean you have hit some sort of quota or threshold. Please check your Application Insights resource for your daily volume cap or if you have enabled sampling of some sort.
Describe your environment. Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on master.
python
: 3.11django
: 4.1opencensus-context
: 0.1.3opencensus-ext-azure
: 1.1.7opencesus-ext-requests
: 0.8.0opencensus-ext-django
: 0.8.0opencensus
: 0.11.0Steps to reproduce. I am a bit unsure exactly how to reproduce this. Here is our logging config:
What is the expected behavior? We are seeing a lot of ERRORS with
Data drop: 206 Telemetry Sampled out
, and it is unclear what the issue actually is. It seems that traces are added to log each response from Azure Application Insights that return 206. Is this actually the expected behaviour? The result from our end is that with each request log, we also store several traces to document that we obtained a HTTP 206 from Azure Application Insights. This seems to be quite excessive from our end.What is the actual behavior? We would expect to be able to limit these traces, but we are unsure of their purpose and why they exist at all. We are therefore unsure about how to proceed.
Additional context. Add any other context about the problem here.