Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Sending Traces From Spring Cloud Sleuth Zipkin Exporter #37

Closed
patrickbray opened this issue Oct 25, 2019 · 3 comments
Closed

Sending Traces From Spring Cloud Sleuth Zipkin Exporter #37

patrickbray opened this issue Oct 25, 2019 · 3 comments

Comments

@patrickbray
Copy link

Hi All,

I am trying to get up and running sending traces from an existing Spring Cloud Sleuth instrumented Spring Boot application to honeycomb-opentracing-proxy and it is failing with the following error in the proxy console:

time="2019-10-25T02:51:55Z" level=info msg="error unmarshaling spans" error="json: cannot unmarshal bool into Go struct field binaryAnnotation.value of type string" type=application/json

Spring Boot Version: 2.1.3.RELEASE
Spring Cloud Sleuth Version: 2.1.1.RELEASE

I am running the open tracing proxy with the following docker command:

docker run -p 9411:9411 honeycombio/honeycomb-opentracing-proxy -k $KEY -d $DATA_SET

From reading the documentation the honeycomb-opentracing-proxy only supports v1 of the JSON API so I have explicitly set that in spring cloud config as this appears to default to v2.

application.properties

spring.zipkin.sender.type=web
spring.zipkin.base-url=http://localhost:9411
spring.zipkin.enabled=true
spring.zipkin.encoder=json_v1

Any help would be greatly appreciated. Also raised on Stack Overflow here

@codefromthecrypt
Copy link

codefromthecrypt commented Oct 25, 2019

it looks like this is not completely implementing the v1 format (that's what the marshaling error is about). there are "address annotations" which are semantically the same as span.remoteEndpoint in v2 format.

Here's an example of "sa" which is "server address" on a client span:

{
  "traceId": "6b221d5bc9e6496c",
  "id": "6b221d5bc9e6496c",
--snip--
  "binaryAnnotations": [
    {
      "key": "sa",
      "value": true,
      "endpoint": {
        "serviceName": "foo"
      }
    }
  ]
}

The problem is that the codec used here is not expecting the value field to be conditionally string or boolean type.

https://github.com/openzipkin/zipkin-api/blob/master/zipkin-api.yaml#L322

If this was due to swagger, at the time swagger didn't implement anyOf. Anyway v1 was a dead format since before this project existed.

It would be better if this was using v2 format, but I suspect the fix here shouldn't be difficult.

@codefromthecrypt
Copy link

FYI: what jaeger does is set the value field to interface, then check if it is bool or not

https://github.com/jaegertracing/jaeger/blob/343fcc6ddd3bdb94dec864bddc2ff8794d6666a8/cmd/collector/app/zipkin/json.go#L209

@nathanleclaire
Copy link
Contributor

Should be fixed by #41. Thanks @fbcbarbosa !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants