Skip to content

Commit

Permalink
[Issue open-telemetry#1111] Add test to test status code change and s…
Browse files Browse the repository at this point in the history
…tatus description for Zipkin exporter
  • Loading branch information
wilguo committed Sep 17, 2020
1 parent 9a31db1 commit 9a7ec13
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from opentelemetry.sdk.trace.export import SpanExportResult
from opentelemetry.sdk.util.instrumentation import InstrumentationInfo
from opentelemetry.trace import TraceFlags
from opentelemetry.trace.status import Status, StatusCanonicalCode


class MockResponse:
Expand Down Expand Up @@ -174,6 +175,9 @@ def test_export(self):
otel_spans[0].set_attribute("key_bool", False)
otel_spans[0].set_attribute("key_string", "hello_world")
otel_spans[0].set_attribute("key_float", 111.22)
otel_spans[0].set_status(
Status(StatusCanonicalCode.UNKNOWN, "Example description")
)
otel_spans[0].end(end_time=end_times[0])

otel_spans[1].start(start_time=start_times[1])
Expand Down Expand Up @@ -213,7 +217,8 @@ def test_export(self):
"key_bool": "False",
"key_string": "hello_world",
"key_float": "111.22",
"ot.status_code": 0,
"ot.status_code": 2,
"ot.status_description": "Example description",
},
"annotations": [
{
Expand Down

0 comments on commit 9a7ec13

Please sign in to comment.