You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exporter expects an int value for HTTP_STATUS_CODE attribute, not an IntEnum. http.HTTPStatus.OK.value would be the preferred attribute value. The casting to str is for backend purposes.
Describe your environment.
I'm using the OpenCensus Azure extension (opencensus-ext-azure==1.1.7) with Python 3.10.7.
Steps to reproduce.
Create a trace with the AzureExporter (as describe in here: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-azure#trace) and add the http status code as an attribute:
What is the expected behavior?
The response code in Azure shows a string
HTTPStatus.OK
.What is the actual behavior?
The response code in Azure should show
200
.Additional context.
It goes wrong because the attribute value is an IntEnum. The status_code is casted to a string (https://github.com/census-instrumentation/opencensus-python/blob/master/contrib/opencensus-ext-azure/opencensus/ext/azure/trace_exporter/__init__.py#L140-L143 and https://github.com/census-instrumentation/opencensus-python/blob/master/contrib/opencensus-ext-azure/opencensus/ext/azure/trace_exporter/__init__.py#L179-L180). The comparision with the integers goes okay, but the casting to a string gives an unexpected result here.
The text was updated successfully, but these errors were encountered: