diff --git a/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/__init__.py b/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/__init__.py index 9f42336ed..1e544bcda 100644 --- a/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/__init__.py +++ b/exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/__init__.py @@ -184,9 +184,9 @@ class ZipkinSpanExporter(SpanExporter): ] = span.instrumentation_info.version if span.status is not None: - zipkin_span["tags"]["otel.status_code"] = str( - span.status.canonical_code.value - ) + zipkin_span["tags"][ + "otel.status_code" + ] = span.status.canonical_code.value if span.status.description is not None: zipkin_span["tags"][ "otel.status_description" diff --git a/exporter/opentelemetry-exporter-zipkin/tests/test_zipkin_exporter.py b/exporter/opentelemetry-exporter-zipkin/tests/test_zipkin_exporter.py index b36817f92..49d1c2ffe 100644 --- a/exporter/opentelemetry-exporter-zipkin/tests/test_zipkin_exporter.py +++ b/exporter/opentelemetry-exporter-zipkin/tests/test_zipkin_exporter.py @@ -217,7 +217,7 @@ class TestZipkinSpanExporter(unittest.TestCase): "key_bool": "False", "key_string": "hello_world", "key_float": "111.22", - "otel.status_code": "2", + "otel.status_code": 2, "otel.status_description": "Example description", }, "annotations": [ @@ -239,7 +239,7 @@ class TestZipkinSpanExporter(unittest.TestCase): "kind": None, "tags": { "key_resource": "some_resource", - "otel.status_code": "0", + "otel.status_code": 0, }, "annotations": None, }, @@ -254,7 +254,7 @@ class TestZipkinSpanExporter(unittest.TestCase): "tags": { "key_string": "hello_world", "key_resource": "some_resource", - "otel.status_code": "0", + "otel.status_code": 0, }, "annotations": None, }, @@ -269,7 +269,7 @@ class TestZipkinSpanExporter(unittest.TestCase): "tags": { "otel.instrumentation_library.name": "name", "otel.instrumentation_library.version": "version", - "otel.status_code": "0", + "otel.status_code": 0, }, "annotations": None, }, @@ -335,7 +335,7 @@ class TestZipkinSpanExporter(unittest.TestCase): "duration": duration // 10 ** 3, "localEndpoint": local_endpoint, "kind": None, - "tags": {"otel.status_code": "0"}, + "tags": {"otel.status_code": 0}, "annotations": None, "debug": True, "parentId": "0aaaaaaaaaaaaaaa",