- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedGood issue for contributors to OpenTelemetry Service to pick upGood issue for contributors to OpenTelemetry Service to pick up
Description
In the json zipkin v1 format, the span kind is inferred from the annotations (sr, ss = kind SERVER). The inference is working correctly, but ends up creating empty annotations when used with a v2 Exporter. These annotations contain just a timestamp and no other information. I believe these should be removed.
Example v1 span
[
    {
        "id": "cfa93400b6c64114",
        "name": "GET",
        "annotations": [
            {
                "timestamp": 1589329047638966,
                "value": "sr",
                "endpoint": {
                    "ipv4": "172.29.0.3",
                    "port": 0,
                    "serviceName": "my-service"
                }
            },
            {
                "timestamp": 1589329047643097,
                "value": "ss",
                "endpoint": {
                    "ipv4": "172.29.0.3",
                    "port": 0,
                    "serviceName": "my-service"
                }
            }
        ],
        "binaryAnnotations": [
            {
                "key": "http.host",
                "value": "localhost:5000",
                "endpoint": {
                    "ipv4": "172.29.0.3",
                    "port": 0,
                    "serviceName": "my-service"
                }
            },
            {
                "key": "http.uri",
                "value": "http://localhost:5000/healthcheck",
                "endpoint": {
                    "ipv4": "172.29.0.3",
                    "port": 0,
                    "serviceName": "my-service"
                }
            },
            {
                "key": "http.path",
                "value": "/healthcheck",
                "endpoint": {
                    "ipv4": "172.29.0.3",
                    "port": 0,
                    "serviceName": "my-service"
                }
            }
        ],
        "debug": false,
        "traceId": "778fff36dc3e06cd",
        "timestamp": 1589329047638966,
        "duration": 4130
    }
]
I expect this to produce a span that looks like this
[
    {
        "traceId": "778fff36dc3e06cd",
        "id": "cfa93400b6c64114",
        "kind": "SERVER",
        "name": "get",
        "timestamp": 1589329047638966,
        "duration": 4130,
        "localEndpoint": {
            "serviceName": "my-service",
            "ipv4": "172.29.0.3"
        },
        "tags": {
            "http.host": "localhost:5000",
            "http.path": "/healthcheck",
            "http.uri": "http://localhost:5000/healthcheck"
        }
    }
]
But instead it produces this
[
    {
        "traceId": "690dba9272ff7f43",
        "id": "1691fe50b928203c",
        "kind": "SERVER",
        "name": "get",
        "timestamp": 1589329265584397,
        "duration": 10734,
        "localEndpoint": {
            "serviceName": "my-service",
            "ipv4": "172.29.0.3"
        },
        "annotations": [
            {
                "timestamp": 1589329265584397,
                "value": ""
            },
            {
                "timestamp": 1589329265595132,
                "value": ""
            }
        ],
        "tags": {
            "http.host": "localhost:5000",
            "http.path": "/healthcheck",
            "http.uri": "http://localhost:5000/healthcheck"
        }
    }
]
docker-compose.yml
version: "2"
services:
  otel-collector:
    image: otelcontribcol:latest
    command: ["--config=/etc/otel-collector-config.yaml", "--mem-ballast-size-mib", "4000"]
    volumes:
      - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
    ports:
      - "8080:9411" # zipkin
    depends_on:
      - zipkin-all-in-one
  zipkin-all-in-one:
    image: openzipkin/zipkin:latest
    ports:
      - "9411:9411"
otel-collector-config.yaml
receivers:
  zipkin:
    endpoint: :9411
exporters:
  zipkin:
    url: "http://zipkin-all-in-one:9411/api/v2/spans"
processors:
  queued_retry:
service:
  pipelines:
    traces:
      receivers: [zipkin]
      processors: [queued_retry]
      exporters: [zipkin]
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedGood issue for contributors to OpenTelemetry Service to pick upGood issue for contributors to OpenTelemetry Service to pick up