Skip to content

Commit

Permalink
Fixed debug field usage in zipkin exporter
Browse files Browse the repository at this point in the history
Zipkin spec expects the debug field to be a boolean, not an integer. OpenTelemetry collector rejects spans exported by the Python Zipkin exporter with the following error message:

```
Traces cannot be uploaded; status code: 400, message json: cannot unmarshal number into Go struct field .debug of type bool
```

Zipkin data model confirm that the field should be a boolean here: https://zipkin.io/zipkin-api/
  • Loading branch information
owais committed Apr 3, 2020
1 parent aea6530 commit 464cfa2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _translate_to_zipkin(self, spans: Sequence[Span]):
}

if context.trace_flags.sampled:
zipkin_span["debug"] = 1
zipkin_span["debug"] = True

if isinstance(span.parent, Span):
zipkin_span["parentId"] = format(
Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-zipkin/tests/test_zipkin_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_export(self):
"value": "event0",
}
],
"debug": 1,
"debug": True,
"parentId": format(parent_id, "x"),
},
{
Expand Down

0 comments on commit 464cfa2

Please sign in to comment.