py_zipkin span is not accepted by the openzipkin collector.
See original GitHub issue-
Run
docker run -d --net host openzipkin/zipkin
-
Install py-zipkin
pip install py-zipkin==0.8.3
-
Run the following python script:
#!/usr/bin/env python
import requests
from py_zipkin.zipkin import zipkin_span
def http_transport(encoded_span):
# The collector expects a thrift-encoded list of spans.
requests.post(
'http://localhost:9411/api/v1/spans',
data=encoded_span,
headers={'Content-Type': 'application/x-thrift'},
)
if __name__ == '__main__':
with zipkin_span(
service_name='test_service',
transport_handler=http_transport,
sample_rate=100.0,
):
print "Work"
I see the following log line in the collector and get a 400 responce
2017-08-07 00:43:04.851 WARN 7 --- [nio-9411-exec-7] zipkin.server.ZipkinHttpCollector : [Malformed reading List<Span> from TBinary]([url](url))
java.lang.IllegalArgumentException: Malformed reading List<Span> from TBinary
at zipkin.internal.ThriftCodec.exceptionReading(ThriftCodec.java:600) ~[zipkin-1.29.1.jar!/:na]
at zipkin.internal.ThriftCodec.readList(ThriftCodec.java:564) ~[zipkin-1.29.1.jar!/:na]
at zipkin.internal.ThriftCodec.readSpans(ThriftCodec.java:88) ~[zipkin-1.29.1.jar!/:na]
at zipkin.collector.Collector.acceptSpans(Collector.java:93) ~[zipkin-1.29.1.jar!/:na]
at zipkin.server.ZipkinHttpCollector.validateAndStoreSpans(ZipkinHttpCollector.java:88) [classes/:na]
at zipkin.server.ZipkinHttpCollector.uploadSpansThrift(ZipkinHttpCollector.java:73) [classes/:na]
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
openzipkin/zipkin - Gitter
Change sampler to never sample and see if zipkin is still creating a span. If not, it means zipkin isn't receiving the trace...
Read more >Server extensions and choices · OpenZipkin
Zipkin server bundles extension for span collection and storage. By default spans can be collected over http, Kafka or RabbitMQ transports and stored ......
Read more >OpenTelemetry to Zipkin Transformation
Zipkin service name MUST be set to the value of the resource attribute: service.name . If no service.name is contained in a Span's...
Read more >Using Spring Cloud Sleuth
The project comes with OpenZipkin Brave implementation. ... span is recorded) and, if the span is sampled, it is eligible for collection (e.g....
Read more >Zipkin Tutorial: Get Started Easily With Distributed Tracing
Zipkin is an open source distributed tracing system based on Dapper's ... as a single span asynchronously to the collector (keep reading to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe the core difference is the https://github.com/Yelp/py_zipkin/blob/master/py_zipkin/thrift/__init__.py#L181
My issue was caused by using old http transport code, that basically was:
As I understand: b’\x0c\x00\x00\x00\x01’ - stands for list with length 1 and 0.9.0 already encodes everything as a list so it doesn’t required anymore.
@cybergrind Thanks for posting this. We should’ve been clearer about that backwards incompatibility. Glad you got it resolved.
I’m going to go ahead and close this. Others can open a new issue or reach out on the zipkin gitter if they run into similar problems.