census-instrumentation / opencensus-python

A stats collection and distributed tracing framework
Apache License 2.0
669 stars 250 forks source link

Azure extension: Data drop 400: 106: Field 'outerId' on type 'ExceptionDetail' is of incorrect type. Expected: int. #1201

Closed JeremyVriens closed 1 year ago

JeremyVriens commented 1 year ago

Describe your environment. I'm using the Python Opencensus library with the Azure extension. The code is sending a string value, where an integer value is expected.

Steps to reproduce. I don't have a reproduceable example yet, but I found where it goes wrong: https://github.com/census-instrumentation/opencensus-python/blob/b85e4767edcd6524515d263853247335f9ee69f4/contrib/opencensus-ext-azure/opencensus/ext/azure/trace_exporter/__init__.py#L104

What is the expected behavior? Not get a 400 bad request from Azure.

What is the actual behavior? You get a 400 bad request from Azure.

Additional context.

tunstek commented 1 year ago

I'm getting this when I do a raise Exception('THIS IS AN EXCEPTION')

mgedmin commented 1 year ago

I've found some documentation for the meaning of the outerId field in the upcoming OpenTelemetry-based Azure Application Insights exporter. It's meant for exception chaining, is not really applicable here, and should be set to 0 here like AzureLogHandler does.

MrAlexBailey commented 1 year ago

+1 Also seeing this issue on a Django project with

opencensus==0.11.2 opencensus-ext-azure==1.1.9 opencensus-ext-django==0.8.0

It looks like the logs are still saved in AI, despite the 400 error coming back.

valeonte commented 1 year ago

+1 Same issue on Flask on Azure App Service

opencensus==0.11.2 opencensus-context==0.1.3 opencensus-ext-azure==1.1.9 opencensus-ext-flask==0.8.2

The error is visible in AI and the message has the original exception thrown.

chadgates commented 1 year ago

+1

mark-at-kluster commented 1 year ago

Getting this also

mark-at-kluster commented 1 year ago

Sorted the above by creating a modified exporter however now getting "Data drop 400: 106: Field 'parsedStack' on type 'ExceptionDetails' is of incorrect type. Expected: array."